File tree Expand file tree Collapse file tree 3 files changed +12
-19
lines changed Expand file tree Collapse file tree 3 files changed +12
-19
lines changed Original file line number Diff line number Diff line change 97
97
98
98
fname = strcat(obj .alias , ' ::createFeature' );
99
99
h = nix_mx(fname , obj .nix_handle , addID , link_type );
100
-
101
- r = {};
102
- if (h ~= 0 )
103
- r = nix .Feature(h );
104
- end
100
+ r = nix .Utils .createEntity(h , @nix .Feature );
105
101
end
106
102
107
103
function r = has_feature(obj , id_or_name )
Original file line number Diff line number Diff line change 99
99
100
100
fname = strcat(obj .alias , ' ::createFeature' );
101
101
h = nix_mx(fname , obj .nix_handle , addID , link_type );
102
-
103
- r = {};
104
- if (h ~= 0 )
105
- r = nix .Feature(h );
106
- end
102
+ r = nix .Utils .createEntity(h , @nix .Feature );
107
103
end
108
104
109
105
function r = has_feature(obj , id_or_name )
Original file line number Diff line number Diff line change 10
10
11
11
methods (Static )
12
12
13
+ function r = createEntity(handle , objConstructor )
14
+ r = {};
15
+ if (handle ~= 0 )
16
+ r = objConstructor(handle );
17
+ end
18
+ end
19
+
13
20
function r = createEntityArray(list , objConstructor )
14
21
r = cell(length(list ), 1 );
15
22
for i = 1 : length(list )
33
40
end
34
41
35
42
function r = fetchObj(nixMxFunc , handle , objConstructor )
36
- r = {};
37
43
h = nix_mx(nixMxFunc , handle );
38
- if (h ~= 0 )
39
- r = objConstructor(h );
40
- end
44
+ r = nix .Utils .createEntity(h , objConstructor );
41
45
end
42
46
43
47
function [] = add_entity(obj , add_this , nixEntity , mxMethod )
76
80
end
77
81
78
82
function r = open_entity(obj , mxMethod , id_or_name , objConstructor )
79
- handle = nix_mx(mxMethod , obj .nix_handle , id_or_name );
80
- r = {};
81
- if (handle ~= 0 )
82
- r = objConstructor(handle );
83
- end
83
+ h = nix_mx(mxMethod , obj .nix_handle , id_or_name );
84
+ r = nix .Utils .createEntity(h , objConstructor );
84
85
end
85
86
86
87
% -----------------------------------------------------------
You can’t perform that action at this time.
0 commit comments