@@ -42,50 +42,6 @@ static void entity_updated_at(const extractor &input, infusor &output)
42
42
43
43
// *** ***
44
44
45
- typedef void (*fn_t )(const extractor &input, infusor &output);
46
-
47
- struct fendpoint {
48
-
49
- fendpoint (std::string name, fn_t fn) : name(name), fn(fn) {}
50
-
51
- std::string name;
52
- fn_t fn;
53
- };
54
-
55
- const std::vector<fendpoint> funcs = {
56
- // File
57
- { " File::createBlock" , nixfile::create_block },
58
- { " File::createSection" , nixfile::create_section },
59
-
60
- // Block
61
- { " Block::describe" , nixblock::describe },
62
-
63
- // Data Array
64
- { " DataArray::describe" , nixdataarray::describe },
65
- { " DataArray::readAll" , nixdataarray::read_all },
66
-
67
- // Tag
68
- { " Tag::describe" , nixtag::describe },
69
- { " Tag::retrieveData" , nixtag::retrieve_data },
70
- { " Tag::featureRetrieveData" , nixtag::retrieve_feature_data },
71
-
72
- // Multi Tag
73
- { " MultiTag::describe" , nixmultitag::describe },
74
- { " MultiTag::retrieveData" , nixmultitag::retrieve_data },
75
- { " MultiTag::featureRetrieveData" , nixmultitag::retrieve_feature_data },
76
-
77
- // Source
78
- { " Source::describe" , nixsource::describe },
79
-
80
- // Feature
81
- { " Feature::describe" , nixfeature::describe },
82
- { " Feature::linkType" , nixfeature::link_type },
83
-
84
- // Section
85
- { " Section::describe" , nixsection::describe },
86
- { " Section::properties" , nixsection::properties }
87
- };
88
-
89
45
// glue "globals"
90
46
std::once_flag init_flag;
91
47
static glue::registry *methods = nullptr ;
@@ -139,9 +95,12 @@ void mexFunction(int nlhs,
139
95
.reg (" deleteBlock" , REMOVER (nix::Block, nix::File, deleteBlock))
140
96
.reg (" deleteSection" , REMOVER (nix::Section, nix::File, deleteSection))
141
97
.reg (" openBlock" , GETBYSTR (nix::Block, nix::File, getBlock))
142
- .reg (" openSection" , GETBYSTR (nix::Section, nix::File, getSection));
98
+ .reg (" openSection" , GETBYSTR (nix::Section, nix::File, getSection))
99
+ .reg (" createBlock" , &nix::File::createBlock)
100
+ .reg (" createSection" , &nix::File::createSection);
143
101
144
102
classdef<nix::Block>(" Block" , methods)
103
+ .desc (&nixblock::describe)
145
104
.reg (" dataArrays" , &nix::Block::dataArrays)
146
105
.reg (" createSource" , &nix::Block::createSource)
147
106
// .reg("createDataArray", static_cast<nix::DataArray(nix::Block::*)(const std::string &, const std::string &, nix::DataType, const nix::NDSize &)>(&nix::Block::createDataArray))
@@ -160,25 +119,32 @@ void mexFunction(int nlhs,
160
119
methods->add (" Block::createDataArray" , nixblock::create_data_array);
161
120
162
121
classdef<nix::DataArray>(" DataArray" , methods)
122
+ .desc (&nixdataarray::describe)
163
123
.reg (" sources" , GETSOURCES (IDataArray))
164
124
.reg (" openMetadataSection" , GETMETADATA (IDataArray));
125
+ methods->add (" DataArray::readAll" , nixdataarray::read_all);
165
126
methods->add (" DataArray::writeAll" , nixdataarray::write_all);
166
127
167
128
classdef<nix::Source>(" Source" , methods)
129
+ .desc (&nixsource::describe)
168
130
.reg (" sources" , &nix::Source::sources)
169
131
.reg (" openSource" , GETBYSTR (nix::Source, nix::Source, getSource))
170
132
.reg (" openMetadataSection" , GETCONTENT (nix::Section, nix::Source, metadata));
171
133
172
134
classdef<nix::Tag>(" Tag" , methods)
135
+ .desc (&nixtag::describe)
173
136
.reg (" references" , GETTER (std::vector<nix::DataArray>, nix::Tag, references))
174
137
.reg (" features" , &nix::Tag::features)
175
138
.reg (" sources" , GETSOURCES (ITag))
176
139
.reg (" openReferenceDataArray" , GETBYSTR (nix::DataArray, nix::Tag, getReference))
177
140
.reg (" openFeature" , GETBYSTR (nix::Feature, nix::Tag, getFeature))
178
141
.reg (" openSource" , GETBYSTR (nix::Source, nix::Tag, getSource))
179
142
.reg (" openMetadataSection" , GETCONTENT (nix::Section, nix::Tag, metadata));
143
+ methods->add (" Tag::retrieveData" , nixtag::retrieve_data);
144
+ methods->add (" Tag::featureRetrieveData" , nixtag::retrieve_feature_data);
180
145
181
146
classdef<nix::MultiTag>(" MultiTag" , methods)
147
+ .desc (&nixmultitag::describe)
182
148
.reg (" references" , GETTER (std::vector<nix::DataArray>, nix::MultiTag, references))
183
149
.reg (" features" , &nix::MultiTag::features)
184
150
.reg (" sources" , GETSOURCES (IMultiTag))
@@ -189,17 +155,23 @@ void mexFunction(int nlhs,
189
155
.reg (" openFeature" , GETBYSTR (nix::Feature, nix::MultiTag, getFeature))
190
156
.reg (" openSource" , GETBYSTR (nix::Source, nix::MultiTag, getSource))
191
157
.reg (" openMetadataSection" , GETCONTENT (nix::Section, nix::MultiTag, metadata));
158
+ methods->add (" MultiTag::retrieveData" , nixmultitag::retrieve_data);
159
+ methods->add (" MultiTag::featureRetrieveData" , nixmultitag::retrieve_feature_data);
192
160
193
161
classdef<nix::Section>(" Section" , methods)
162
+ .desc (&nixsection::describe)
194
163
.reg (" sections" , &nix::Section::sections)
195
164
.reg (" openSection" , GETBYSTR (nix::Section, nix::Section, getSection))
196
165
.reg (" hasProperty" , GETBYSTR (bool , nix::Section, hasProperty))
197
166
.reg (" hasSection" , GETBYSTR (bool , nix::Section, hasSection))
198
167
.reg (" link" , GETCONTENT (nix::Section, nix::Section, link))
199
168
.reg (" parent" , GETCONTENT (nix::Section, nix::Section, parent));
169
+ methods->add (" Section::properties" , nixsection::properties);
200
170
201
171
classdef<nix::Feature>(" Feature" , methods)
172
+ .desc (&nixfeature::describe)
202
173
.reg (" openData" , GETCONTENT (nix::DataArray, nix::Feature, data));
174
+ methods->add (" Feature::linkType" , nixfeature::link_type);
203
175
204
176
mexAtExit (on_exit);
205
177
});
@@ -215,18 +187,6 @@ void mexFunction(int nlhs,
215
187
}
216
188
#endif
217
189
218
- for (const auto &fn : funcs) {
219
-
220
- if (processed) {
221
- break ;
222
- }
223
-
224
- if (fn.name == cmd) {
225
- fn.fn (input, output);
226
- processed = true ;
227
- }
228
- }
229
-
230
190
}
231
191
catch (const std::invalid_argument &e) {
232
192
mexErrMsgIdAndTxt (" nix:arg:inval" , e.what ());
0 commit comments