@@ -18,9 +18,9 @@ class argument_helper {
18
18
19
19
bool check_size (size_t pos, bool fatal = false ) const {
20
20
bool res = pos + 1 > number;
21
- if (!res && fatal) {
22
- throw std::out_of_range (" argument position is out of bounds" );
23
- }
21
+ if (!res && fatal) {
22
+ throw std::out_of_range (" argument position is out of bounds" );
23
+ }
24
24
return res;
25
25
}
26
26
@@ -49,7 +49,7 @@ class argument_helper {
49
49
size_t number;
50
50
};
51
51
52
- class extractor : public argument_helper < const mxArray> {
52
+ class extractor : public argument_helper < const mxArray > {
53
53
public:
54
54
extractor (const mxArray **arr, int n) : argument_helper(arr, n) { }
55
55
@@ -76,7 +76,7 @@ class extractor : public argument_helper<const mxArray> {
76
76
nix::NDSize ndsize (size_t pos) const {
77
77
return mx_to_ndsize (array[pos]);
78
78
}
79
-
79
+
80
80
nix::DataType dtype (size_t pos) const {
81
81
return dtype_mex2nix (array[pos]);
82
82
}
@@ -97,7 +97,7 @@ class extractor : public argument_helper<const mxArray> {
97
97
}
98
98
99
99
handle hdl (size_t pos) const {
100
- handle h = handle (num<uint64_t >(pos));
100
+ handle h = handle (num<uint64_t >(pos));
101
101
return h;
102
102
}
103
103
@@ -114,24 +114,28 @@ class extractor : public argument_helper<const mxArray> {
114
114
return mxGetPr (array[pos]);
115
115
}
116
116
117
+ const mxArray *get_mx_array (size_t pos) const {
118
+ return array[pos];
119
+ }
120
+
117
121
private:
118
122
};
119
123
120
124
template <>
121
125
inline std::vector<std::string> extractor::vec (size_t pos) const {
122
- return mx_to_strings (array[pos]);
126
+ return mx_to_strings (array[pos]);
123
127
}
124
128
125
129
126
130
class infusor : public argument_helper <mxArray> {
127
131
public:
128
132
infusor (mxArray **arr, int n) : argument_helper(arr, n) { }
129
133
130
- template <typename T>
131
- void set (size_t pos, T &&value) {
132
- mxArray *array = make_mx_array (std::forward<T>(value));
133
- set (pos, array);
134
- }
134
+ template <typename T>
135
+ void set (size_t pos, T &&value) {
136
+ mxArray *array = make_mx_array (std::forward<T>(value));
137
+ set (pos, array);
138
+ }
135
139
136
140
void set (size_t pos, mxArray *arr) {
137
141
array[pos] = arr;
0 commit comments