|
86 | 86 | % ------------------
|
87 | 87 |
|
88 | 88 | function [] = add_reference(obj, add_this)
|
89 |
| - if(strcmp(class(add_this),'nix.DataArray')) |
90 |
| - addID = add_this.id; |
91 |
| - else |
92 |
| - addID = add_this; |
93 |
| - end; |
94 |
| - nix_mx('Tag::addReference', obj.nix_handle, addID); |
95 |
| - obj.referencesCache.lastUpdate = 0; |
| 89 | + obj.referencesCache = nix.Utils.add_entity(obj, ... |
| 90 | + add_this, 'nix.DataArray', 'Tag::addReference', obj.referencesCache); |
96 | 91 | end;
|
97 | 92 |
|
98 | 93 | function delCheck = remove_reference(obj, del)
|
99 |
| - if(strcmp(class(del),'nix.DataArray')) |
100 |
| - delID = del.id; |
101 |
| - else |
102 |
| - delID = del; |
103 |
| - end; |
104 |
| - delCheck = nix_mx('Tag::removeReference', obj.nix_handle, delID); |
105 |
| - obj.referencesCache.lastUpdate = 0; |
| 94 | + [delCheck, obj.referencesCache] = nix.Utils.delete_entity(obj, ... |
| 95 | + del, 'nix.DataArray', 'Tag::removeReference', obj.referencesCache); |
106 | 96 | end;
|
107 | 97 |
|
108 | 98 | function retObj = open_reference(obj, id_or_name)
|
|
160 | 150 | % ------------------
|
161 | 151 |
|
162 | 152 | function [] = add_source(obj, add_this)
|
163 |
| - if(strcmp(class(add_this),'nix.Source')) |
164 |
| - addID = add_this.id; |
165 |
| - else |
166 |
| - addID = add_this; |
167 |
| - end; |
168 |
| - nix_mx('Tag::addSource', obj.nix_handle, addID); |
169 |
| - obj.sourcesCache.lastUpdate = 0; |
| 153 | + obj.sourcesCache = nix.Utils.add_entity(obj, ... |
| 154 | + add_this, 'nix.Source', 'Tag::addSource', obj.sourcesCache); |
170 | 155 | end;
|
171 | 156 |
|
172 | 157 | function delCheck = remove_source(obj, del)
|
173 |
| - if(strcmp(class(del),'nix.Source')) |
174 |
| - delID = del.id; |
175 |
| - else |
176 |
| - delID = del; |
177 |
| - end; |
178 |
| - delCheck = nix_mx('Tag::removeSource', obj.nix_handle, delID); |
179 |
| - obj.sourcesCache.lastUpdate = 0; |
| 158 | + [delCheck, obj.sourcesCache] = nix.Utils.delete_entity(obj, ... |
| 159 | + del, 'nix.Source', 'Tag::removeSource', obj.sourcesCache); |
180 | 160 | end;
|
181 | 161 |
|
182 | 162 | function retObj = open_source(obj, id_or_name)
|
|
0 commit comments