www.gusucode.com > mbcexpr 工具箱 matlab 源码程序 > mbcexpr/@cgnormfunction/checkLinks.m

    function LT = checkLinks(LT)
%CHECKLINKS Check parent links are valid
%
%   OBJ = CHECKLINKS(OBJ) is called during loading in order to check that
%   the lookup object has valid links to its parents, be they features or
%   tables.

%   Copyright 2005 The MathWorks, Inc.


% Check that all of the feature links are valid, and that this table is
% actually still in those features.
if ~isempty(LT.SFlist)
    % remove invalid pointers and pointers that are not features
    LT.SFlist = LT.SFlist(isvalid(LT.SFlist));
    ok = parrayeval(LT.SFlist, @isa, {'cgfeature'}, mbclogical);
    LT.SFlist = LT.SFlist(ok);

    % Check that the remaining features actually contain this table.
    pTab = pveceval(LT.SFlist, @geteqchain);
    pLT = address(LT);
    ok = false(size(pTab));
    for i = 1:length(pTab)
        % Is table in this feature
        ok(i) = any(pTab{i}==pLT);
    end

    LT.SFlist = LT.SFlist(ok);
end