@@ -70,19 +70,16 @@ const std::vector<fendpoint> funcs = {
70
70
{ " Block::listSources" , nixblock::list_sources },
71
71
{ " Block::listTags" , nixblock::list_tags },
72
72
{ " Block::listMultiTags" , nixblock::list_multi_tags },
73
- { " Block::openMetadataSection" , nixblock::open_metadata_section },
74
73
75
74
// Data Array
76
75
{ " DataArray::describe" , nixdataarray::describe },
77
76
{ " DataArray::readAll" , nixdataarray::read_all },
78
- { " DataArray::openMetadataSection" , nixdataarray::open_metadata_section },
79
77
80
78
// Tag
81
79
{ " Tag::describe" , nixtag::describe },
82
80
{ " Tag::listReferences" , nixtag::list_references_array },
83
81
{ " Tag::listFeatures" , nixtag::list_features },
84
82
{ " Tag::listSources" , nixtag::list_sources },
85
- { " Tag::openMetadataSection" , nixtag::open_metadata_section },
86
83
{ " Tag::retrieveData" , nixtag::retrieve_data },
87
84
{ " Tag::featureRetrieveData" , nixtag::retrieve_feature_data },
88
85
@@ -91,19 +88,16 @@ const std::vector<fendpoint> funcs = {
91
88
{ " MultiTag::listReferences" , nixmultitag::list_references_array },
92
89
{ " MultiTag::listFeatures" , nixmultitag::list_features },
93
90
{ " MultiTag::listSources" , nixmultitag::list_sources },
94
- { " MultiTag::openMetadataSection" , nixmultitag::open_metadata_section },
95
91
{ " MultiTag::retrieveData" , nixmultitag::retrieve_data },
96
92
{ " MultiTag::featureRetrieveData" , nixmultitag::retrieve_feature_data },
97
93
98
94
// Source
99
95
{ " Source::describe" , nixsource::describe },
100
96
{ " Source::listSources" , nixsource::list_sources },
101
- { " Source::openMetadataSection" , nixsource::open_metadata_section },
102
97
103
98
// Feature
104
99
{ " Feature::describe" , nixfeature::describe },
105
100
{ " Feature::linkType" , nixfeature::link_type },
106
- { " Feature::openData" , nixfeature::open_data },
107
101
108
102
// Section
109
103
{ " Section::describe" , nixsection::describe },
@@ -127,6 +121,8 @@ static void on_exit() {
127
121
#define GETBYSTR (type, class, name ) static_cast <type(class ::*)(const std::string &)const >(&class ::name)
128
122
#define GETCONTENT (type, class, name ) static_cast <type(class ::*)()const >(&class ::name)
129
123
#define GETSOURCES (base__ ) static_cast <std::vector<nix::Source>(nix::base::EntityWithSources<nix::base::base__>::*)(std::function<bool (const nix::Source &)>)const >(&nix::base::EntityWithSources<nix::base::base__>::sources)
124
+ // required to open nix::Section from DataArray, normal GETCONTENT leads to a compiler error with Visual Studio 12
125
+ #define GETMETADATA (base__ ) static_cast <nix::Section(nix::base::EntityWithMetadata<nix::base::base__>::*)()const >(&nix::base::EntityWithMetadata<nix::base::base__>::metadata)
130
126
#define REMOVER (type, class, name ) static_cast <bool (class ::*)(const std::string&)>(&class ::name)
131
127
132
128
// main entry point
@@ -170,22 +166,26 @@ void mexFunction(int nlhs,
170
166
.reg (" openDataArray" , GETBYSTR (nix::DataArray, nix::Block, getDataArray))
171
167
.reg (" openSource" , GETBYSTR (nix::Source, nix::Block, getSource))
172
168
.reg (" openTag" , GETBYSTR (nix::Tag, nix::Block, getTag))
173
- .reg (" openMultiTag" , GETBYSTR (nix::MultiTag, nix::Block, getMultiTag));
169
+ .reg (" openMultiTag" , GETBYSTR (nix::MultiTag, nix::Block, getMultiTag))
170
+ .reg (" openMetadataSection" , GETCONTENT (nix::Section, nix::Block, metadata));
174
171
175
172
classdef<nix::DataArray>(" DataArray" , methods)
176
- .reg (" sources" , GETSOURCES (IDataArray));
173
+ .reg (" sources" , GETSOURCES (IDataArray))
174
+ .reg (" openMetadataSection" , GETMETADATA (IDataArray));
177
175
178
176
classdef<nix::Source>(" Source" , methods)
179
177
.reg (" sources" , &nix::Source::sources)
180
- .reg (" openSource" , GETBYSTR (nix::Source, nix::Source, getSource));
178
+ .reg (" openSource" , GETBYSTR (nix::Source, nix::Source, getSource))
179
+ .reg (" openMetadataSection" , GETCONTENT (nix::Section, nix::Source, metadata));
181
180
182
181
classdef<nix::Tag>(" Tag" , methods)
183
182
.reg (" references" , GETTER (std::vector<nix::DataArray>, nix::Tag, references))
184
183
.reg (" features" , &nix::Tag::features)
185
184
.reg (" sources" , GETSOURCES (ITag))
186
185
.reg (" openReferenceDataArray" , GETBYSTR (nix::DataArray, nix::Tag, getReference))
187
186
.reg (" openFeature" , GETBYSTR (nix::Feature, nix::Tag, getFeature))
188
- .reg (" openSource" , GETBYSTR (nix::Source, nix::Tag, getSource));
187
+ .reg (" openSource" , GETBYSTR (nix::Source, nix::Tag, getSource))
188
+ .reg (" openMetadataSection" , GETCONTENT (nix::Section, nix::Tag, metadata));
189
189
190
190
classdef<nix::MultiTag>(" MultiTag" , methods)
191
191
.reg (" references" , GETTER (std::vector<nix::DataArray>, nix::MultiTag, references))
@@ -196,7 +196,8 @@ void mexFunction(int nlhs,
196
196
.reg (" openExtents" , GETCONTENT (nix::DataArray, nix::MultiTag, extents))
197
197
.reg (" openReferences" , GETBYSTR (nix::DataArray, nix::MultiTag, getReference))
198
198
.reg (" openFeature" , GETBYSTR (nix::Feature, nix::MultiTag, getFeature))
199
- .reg (" openSource" , GETBYSTR (nix::Source, nix::MultiTag, getSource));
199
+ .reg (" openSource" , GETBYSTR (nix::Source, nix::MultiTag, getSource))
200
+ .reg (" openMetadataSection" , GETCONTENT (nix::Section, nix::MultiTag, metadata));
200
201
201
202
classdef<nix::Section>(" Section" , methods)
202
203
.reg (" sections" , &nix::Section::sections)
@@ -206,6 +207,9 @@ void mexFunction(int nlhs,
206
207
.reg (" link" , GETCONTENT (nix::Section, nix::Section, link))
207
208
.reg (" parent" , GETCONTENT (nix::Section, nix::Section, parent));
208
209
210
+ classdef<nix::Feature>(" Feature" , methods)
211
+ .reg (" openData" , GETCONTENT (nix::DataArray, nix::Feature, data));
212
+
209
213
mexAtExit (on_exit);
210
214
});
211
215
0 commit comments