overwrite Handle class - hide 'isvalid' function and 'ObjectBeingDestroyed' event
Show older comments
Dear all,
I want to make a class that is to be used by people that are very unfamiliar with Matlab and they will be using the class by consulting doc('myClass'). The class is based on the handle class, the problem is that the functions inherited from the handle class are also displayed in the documentation. Some of these inherited functions can be hidden by overwritting them as follows (link to original post):
classdef myClass < handle
methods (Hidden)
function lh = addlistener(varargin)
lh = addlistener@handle(varargin{:});
end
function notify(varargin)
notify@handle(varargin{:});
end
function delete(varargin)
delete@handle(varargin{:});
end
function Hmatch = findobj(varargin)
Hmatch = findobj@handle(varargin{:});
end
function p = findprop(varargin)
p = findprop@handle(varargin{:});
end
function TF = eq(varargin)
TF = eq@handle(varargin{:});
end
function TF = ne(varargin)
TF = ne@handle(varargin{:});
end
function TF = lt(varargin)
TF = lt@handle(varargin{:});
end
function TF = le(varargin)
TF = le@handle(varargin{:});
end
function TF = gt(varargin)
TF = gt@handle(varargin{:});
end
function TF = ge(varargin)
TF = ge@handle(varargin{:});
end
end
end
However, the 'isvalid' function is 'sealed' and cannot be overwritten to hide it. The event 'ObjectBeingDestroyed' can also not be overwritten to hide it.
My question is therefore, is it possible to copy the source code of the original handle class into a new custom class which can then be altered to hide all the functions and events? Or is there some other way to hide this function and event?
Kind regards,
Dennis
Accepted Answer
More Answers (0)
Categories
Find more on Function Handles in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!