Skip to content

Commit 4b6f910

Browse files
committed
[c++/m] Remove Section.propertiesMap
Closes #143 Removes Section.propertiesMap from C++ and Matlab.
1 parent ee4a497 commit 4b6f910

File tree

4 files changed

+1
-53
lines changed

4 files changed

+1
-53
lines changed

+nix/Section.m

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
% namespace reference for nix-mx functions
1515
alias = 'Section'
1616
end;
17-
18-
properties(Dependent)
19-
allProperties
20-
allPropertiesMap
21-
end;
22-
17+
2318
methods
2419
function obj = Section(h)
2520
@@ -170,19 +165,6 @@
170165
'Section::openPropertyIdx', idx, @nix.Property);
171166
end;
172167

173-
function props = get.allProperties(obj)
174-
props = nix_mx('Section::propertiesMap', obj.nix_handle);
175-
end;
176-
177-
function p_map = get.allPropertiesMap(obj)
178-
p_map = containers.Map();
179-
props = obj.allProperties;
180-
181-
for i=1:length(props)
182-
p_map(props{i}.name) = cell2mat(props{i}.values);
183-
end
184-
end;
185-
186168
function c = property_count(obj)
187169
c = nix_mx('Section::propertyCount', obj.nix_handle);
188170
end

nix_mx.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ void mexFunction(int nlhs,
408408
.reg("referringMultiTags", GETTER(std::vector<nix::MultiTag>, nix::Section, referringMultiTags))
409409
.reg("referringSources", GETTER(std::vector<nix::Source>, nix::Section, referringSources))
410410
.reg("referringBlocks", GETTER(std::vector<nix::Block>, nix::Section, referringBlocks));
411-
methods->add("Section::propertiesMap", nixsection::propertiesMap);
412411
methods->add("Section::createProperty", nixsection::createProperty);
413412
methods->add("Section::createPropertyWithValue", nixsection::createPropertyWithValue);
414413
methods->add("Section::referringBlockSources", nixsection::referringBlockSources);

src/nixsection.cc

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,6 @@ namespace nixsection {
3434
return sb.array();
3535
}
3636

37-
void propertiesMap(const extractor &input, infusor &output) {
38-
nix::Section section = input.entity<nix::Section>(1);
39-
std::vector<nix::Property> properties = section.properties();
40-
41-
const mwSize size = static_cast<mwSize>(properties.size());
42-
mxArray *lst = mxCreateCellArray(1, &size);
43-
44-
for (size_t i = 0; i < properties.size(); i++) {
45-
46-
nix::Property pr = properties[i];
47-
std::vector<nix::Value> values = pr.values();
48-
49-
mxArray *mx_values = make_mx_array(values);
50-
51-
struct_builder sb({ 1 }, {
52-
"name", "id", "definition", "mapping", "unit", "values"
53-
});
54-
55-
sb.set(pr.name());
56-
sb.set(pr.id());
57-
sb.set(pr.definition());
58-
sb.set(pr.mapping());
59-
sb.set(pr.unit());
60-
sb.set(mx_values);
61-
62-
mxSetCell(lst, i, sb.array());
63-
}
64-
65-
output.set(0, lst);
66-
}
67-
6837
void createProperty(const extractor &input, infusor &output) {
6938
nix::Section currObj = input.entity<nix::Section>(1);
7039

src/nixsection.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ namespace nixsection {
1515

1616
mxArray *describe(const nix::Section &section);
1717

18-
void propertiesMap(const extractor &input, infusor &output);
19-
2018
void createProperty(const extractor &input, infusor &output);
2119

2220
void createPropertyWithValue(const extractor &input, infusor &output);

0 commit comments

Comments
 (0)