Skip to content

Commit eb49435

Browse files
committed
[Matlab] Add basic nix.MetadataMixIn doc
1 parent 4211e86 commit eb49435

File tree

6 files changed

+46
-14
lines changed

6 files changed

+46
-14
lines changed

+nix/Block.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
% sources access to all first level nix.Source child entities.
2121
% tags access to all nix.Tag child entities.
2222
% multiTags access to all nix.MultiTag child entities.
23-
% sections access to all first level nix.Section child entities.
2423
%
2524
% See also nix.DataArray, nix.Source, nix.Group, nix.Tag, nix.MultiTag, nix.Section.
2625
%

+nix/DataArray.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
% nix.DataArray dynamic child entity properties:
4848
% dimensions access to all dimensions associated with a DataArray.
4949
% sources access to all first level nix.Source child entities.
50-
% sections access to all first level nix.Section child entities.
5150
%
5251
% See also nix.Source, nix.Section.
5352
%

+nix/Group.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
% tags access to all nix.Tag child entities.
2121
% multiTags access to all nix.MultiTag child entities.
2222
% sources access to all first level nix.Source child entities.
23-
% sections access to all first level nix.Section child entities.
2423
%
2524
% See also nix.DataArray, nix.Tag, nix.MultiTag, nix.Source, nix.Section.
2625
%

+nix/MetadataMixIn.m

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
% Mixin Class for entities that can be associated with additional metadata.
2+
%
3+
% The data part of the NIX data model consists of six main elements which all inherit
4+
% from the MetadataMixin Class: nix.Block, nix.Group, nix.DataArray, nix.Tag,
5+
% nix.MultiTag and nix.Source.
6+
% Common to all those entities is an optional property sections which provides a link
7+
% to one nix.Section entity and therefore makes it possible to annotate the entities
8+
% with additional metadata.
9+
%
10+
% Depends on nix.Entity.
11+
%
12+
% See also nix.Section, nix.Block, nix.Group, nix.DataArray, nix.Tag, nix.MultiTag, nix.Source, nix.Entity.
13+
%
14+
%
115
% Copyright (c) 2016, German Neuroinformatics Node (G-Node)
216
%
317
% All rights reserved.
@@ -7,26 +21,49 @@
721
% LICENSE file in the root of the Project.
822

923
classdef MetadataMixIn < handle
10-
%MetadataMixIn
11-
% mixin class for nix entities with metadata
12-
% depends on
13-
% - nix.Entity
1424

1525
properties (Abstract, Hidden)
1626
alias
1727
end
1828

1929
methods
2030
function r = openMetadata(obj)
31+
% Retrieves the referenced nix.Section from the invoking nix.Entity.
32+
%
33+
% Returns: (nix.Section) The Section or an empty cell,
34+
% if the Section was not found.
35+
%
36+
% Example: getSec = currEntity.openMetadata();
37+
%
38+
% See also nix.Section.
39+
2140
r = nix.Utils.fetchObj(obj, 'openMetadataSection', @nix.Section);
2241
end
2342

24-
function [] = setMetadata(obj, val)
25-
if (isempty(val))
43+
function [] = setMetadata(obj, idEntity)
44+
% Set a nix.Section as metadata of the invoking nix.Entity.
45+
%
46+
% If metadata was already set, using this method again will
47+
% replace the reference to the previous Section with a reference
48+
% to the provided Section.
49+
%
50+
% The link to a Section can be removed by handing an empty string
51+
% to the method. The referenced Section itself will not be removed.
52+
%
53+
% idEntity (char/nix.Section): The id of an existing Section,
54+
% or a valid nix.Section entity.
55+
%
56+
% Example: currEntity.setMetadata('some-section-id');
57+
% currEntity.setMetadata(currFile.sections{1});
58+
% currEntity.setMetadata(''); % remove reference to section
59+
%
60+
% See also nix.Section.
61+
62+
if (isempty(idEntity))
2663
fname = strcat(obj.alias, '::setNoneMetadata');
27-
nix_mx(fname, obj.nixhandle, val);
64+
nix_mx(fname, obj.nixhandle, idEntity);
2865
else
29-
nix.Utils.addEntity(obj, 'setMetadata', val, 'nix.Section');
66+
nix.Utils.addEntity(obj, 'setMetadata', idEntity, 'nix.Section');
3067
end
3168
end
3269
end

+nix/MultiTag.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
% references access to all nix.DataArray child entities referenced by the MultiTag.
3333
% features access to all nix.Features child entities referenced by the MultiTag.
3434
% sources access to all first level nix.Source child entities.
35-
% sections access to all first level nix.Section child entities.
3635
%
3736
% See also nix.DataArray, nix.Feature, nix.Source, nix.Section.
3837
%
@@ -487,7 +486,7 @@
487486
end
488487

489488
function [] = setExtents(obj, idNameEntity)
490-
% Set a nix.DataArray as the extents data of the invoking Tag.
489+
% Set a nix.DataArray as the extents data of the invoking MultiTag.
491490
%
492491
% If extents were already set, using this method again will
493492
% replace the reference to the old DataArray with a reference

+nix/Tag.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
% references access to all nix.DataArray child entities referenced by the Tag.
3838
% features access to all nix.Features child entities referenced by the Tag.
3939
% sources access to all first level nix.Source child entities.
40-
% sections access to all first level nix.Section child entities.
4140
%
4241
% See also nix.DataArray, nix.Feature, nix.Source, nix.Section.
4342
%

0 commit comments

Comments
 (0)