comparison m-toolbox/classes/+utils/@helper/ltpda_userclasses.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % LTPDA_USERCLASSES lists all the LTPDA user object types.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: LTPDA_USERCLASSES lists all the LTPDA user object types.
5 %
6 % CALL: classes = ltpda_userclasses()
7 %
8 % INPUTS:
9 %
10 % OUTPUTS: classes - a cell array with a list of recognised LTPDA user object types
11 %
12 % Returns a list of all ltpda classes which are derived from the ltpda_uo
13 % class.
14 %
15 % VERSION: $Id: ltpda_userclasses.m,v 1.6 2010/08/16 14:06:15 hewitson Exp $
16 %
17 % HISTORY: 14-02-08 M Hueller
18 % Creation
19 %
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21
22 function classes = ltpda_userclasses(varargin)
23
24 % prefs = getappdata(0, 'LTPDApreferences');
25 % vl = double(prefs.getDisplayPrefs.getDisplayVerboseLevel);
26 % LTPDAprefs('display', 'verboseLevel', -1);
27 classes = utils.helper.ltpda_classes;
28
29 for ii = 1:numel(classes)
30 try
31 if ~isa(eval(classes{ii}), 'ltpda_uo')
32 classes{ii} = {};
33 end
34 catch
35 classes{ii} = {};
36 end
37 end
38
39 classes = classes(~cellfun('isempty', classes));
40 classes = sort(classes);
41
42 end
43
44 function result = isabstract(cl)
45
46 mi = eval(['?' cl]);
47
48 hasAbstractMethod = false;
49 for kk=1:numel(mi.Methods)
50 if mi.Methods{kk}.Abstract
51 hasAbstractMethod = true;
52 break;
53 end
54 end
55
56 hasAbstractProperty = false;
57 if ~hasAbstractMethod
58 for kk=1:numel(mi.Properties)
59 if mi.Properties{kk}.Abstract
60 hasAbstractProperty = true;
61 break;
62 end
63 end
64 end
65
66 if hasAbstractProperty || hasAbstractMethod
67 result = true;
68 else
69 result = false;
70 end
71
72 end
73