www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@mbcfoundation/@propertycollection/redirect.m

    function P = redirect(P,fInternalGet,fInternalSet,props)
%REDIRECT - redirect the get and set functions for the object properties
%
% P = redirect(P,fInternalGet,fInternalSet,props)
%
%     @(m) fInternalGet( fGet, m)
%     @(m,v) fInternalSet( fSet, m, v );

%  Copyright 2006-2007 The MathWorks, Inc.

if nargin<4
    props = properties(P);
end

S = P.ObjectProperties;
for i=1:length(props)
   S.(props{i}) = redirect(S.(props{i}),fInternalGet,fInternalSet);
end

P.ObjectProperties = S;