Mercurial > hg > octave-nkf
comparison src/ov-typeinfo.h @ 7336:745a8299c2b5
[project @ 2007-12-28 20:56:55 by jwe]
author | jwe |
---|---|
date | Fri, 28 Dec 2007 20:56:58 +0000 |
parents | a1dbe9d80eee |
children | 5861b95e9879 |
comparison
equal
deleted
inserted
replaced
7335:58f5fab3ebe5 | 7336:745a8299c2b5 |
---|---|
38 OCTINTERP_API | 38 OCTINTERP_API |
39 octave_value_typeinfo | 39 octave_value_typeinfo |
40 { | 40 { |
41 public: | 41 public: |
42 | 42 |
43 typedef octave_value (*unary_class_op_fcn) (const octave_value&); | |
44 | |
43 typedef octave_value (*unary_op_fcn) (const octave_base_value&); | 45 typedef octave_value (*unary_op_fcn) (const octave_base_value&); |
44 | 46 |
45 typedef void (*non_const_unary_op_fcn) (octave_base_value&); | 47 typedef void (*non_const_unary_op_fcn) (octave_base_value&); |
48 | |
49 typedef octave_value (*binary_class_op_fcn) | |
50 (const octave_value&, const octave_value&); | |
46 | 51 |
47 typedef octave_value (*binary_op_fcn) | 52 typedef octave_value (*binary_op_fcn) |
48 (const octave_base_value&, const octave_base_value&); | 53 (const octave_base_value&, const octave_base_value&); |
49 | 54 |
50 typedef octave_value (*cat_op_fcn) | 55 typedef octave_value (*cat_op_fcn) |
59 static bool instance_ok (void); | 64 static bool instance_ok (void); |
60 | 65 |
61 static int register_type (const std::string&, const std::string&, | 66 static int register_type (const std::string&, const std::string&, |
62 const octave_value&); | 67 const octave_value&); |
63 | 68 |
69 static bool register_unary_class_op (octave_value::unary_op, | |
70 unary_class_op_fcn); | |
71 | |
64 static bool register_unary_op (octave_value::unary_op, int, unary_op_fcn); | 72 static bool register_unary_op (octave_value::unary_op, int, unary_op_fcn); |
65 | 73 |
66 static bool register_non_const_unary_op (octave_value::unary_op, int, | 74 static bool register_non_const_unary_op (octave_value::unary_op, int, |
67 non_const_unary_op_fcn); | 75 non_const_unary_op_fcn); |
68 | 76 |
77 static bool register_binary_class_op (octave_value::binary_op, | |
78 binary_class_op_fcn); | |
79 | |
69 static bool register_binary_op (octave_value::binary_op, int, int, | 80 static bool register_binary_op (octave_value::binary_op, int, int, |
70 binary_op_fcn); | 81 binary_op_fcn); |
71 | 82 |
72 static bool register_cat_op (int, int, cat_op_fcn); | 83 static bool register_cat_op (int, int, cat_op_fcn); |
73 | 84 |
89 lookup_type (const std::string& nm) | 100 lookup_type (const std::string& nm) |
90 { | 101 { |
91 return instance->do_lookup_type (nm); | 102 return instance->do_lookup_type (nm); |
92 } | 103 } |
93 | 104 |
105 static unary_class_op_fcn | |
106 lookup_unary_class_op (octave_value::unary_op op) | |
107 { | |
108 return instance->do_lookup_unary_class_op (op); | |
109 } | |
110 | |
94 static unary_op_fcn | 111 static unary_op_fcn |
95 lookup_unary_op (octave_value::unary_op op, int t) | 112 lookup_unary_op (octave_value::unary_op op, int t) |
96 { | 113 { |
97 return instance->do_lookup_unary_op (op, t); | 114 return instance->do_lookup_unary_op (op, t); |
98 } | 115 } |
99 | 116 |
100 static non_const_unary_op_fcn | 117 static non_const_unary_op_fcn |
101 lookup_non_const_unary_op (octave_value::unary_op op, int t) | 118 lookup_non_const_unary_op (octave_value::unary_op op, int t) |
102 { | 119 { |
103 return instance->do_lookup_non_const_unary_op (op, t); | 120 return instance->do_lookup_non_const_unary_op (op, t); |
121 } | |
122 | |
123 static binary_class_op_fcn | |
124 lookup_binary_class_op (octave_value::binary_op op) | |
125 { | |
126 return instance->do_lookup_binary_class_op (op); | |
104 } | 127 } |
105 | 128 |
106 static binary_op_fcn | 129 static binary_op_fcn |
107 lookup_binary_op (octave_value::binary_op op, int t1, int t2) | 130 lookup_binary_op (octave_value::binary_op op, int t1, int t2) |
108 { | 131 { |
153 protected: | 176 protected: |
154 | 177 |
155 octave_value_typeinfo (void) | 178 octave_value_typeinfo (void) |
156 : num_types (0), types (init_tab_sz, std::string ()), | 179 : num_types (0), types (init_tab_sz, std::string ()), |
157 vals (init_tab_sz), | 180 vals (init_tab_sz), |
181 unary_class_ops (octave_value::num_unary_ops, 0), | |
158 unary_ops (octave_value::num_unary_ops, init_tab_sz, 0), | 182 unary_ops (octave_value::num_unary_ops, init_tab_sz, 0), |
159 non_const_unary_ops (octave_value::num_unary_ops, init_tab_sz, 0), | 183 non_const_unary_ops (octave_value::num_unary_ops, init_tab_sz, 0), |
184 binary_class_ops (octave_value::num_binary_ops, 0), | |
160 binary_ops (octave_value::num_binary_ops, init_tab_sz, init_tab_sz, 0), | 185 binary_ops (octave_value::num_binary_ops, init_tab_sz, init_tab_sz, 0), |
161 cat_ops (init_tab_sz, init_tab_sz, 0), | 186 cat_ops (init_tab_sz, init_tab_sz, 0), |
162 assign_ops (octave_value::num_assign_ops, init_tab_sz, init_tab_sz, 0), | 187 assign_ops (octave_value::num_assign_ops, init_tab_sz, init_tab_sz, 0), |
163 assignany_ops (octave_value::num_assign_ops, init_tab_sz, 0), | 188 assignany_ops (octave_value::num_assign_ops, init_tab_sz, 0), |
164 pref_assign_conv (init_tab_sz, init_tab_sz, -1), | 189 pref_assign_conv (init_tab_sz, init_tab_sz, -1), |
175 | 200 |
176 Array<std::string> types; | 201 Array<std::string> types; |
177 | 202 |
178 Array<octave_value> vals; | 203 Array<octave_value> vals; |
179 | 204 |
205 Array<unary_class_op_fcn> unary_class_ops; | |
206 | |
180 Array2<unary_op_fcn> unary_ops; | 207 Array2<unary_op_fcn> unary_ops; |
181 | 208 |
182 Array2<non_const_unary_op_fcn> non_const_unary_ops; | 209 Array2<non_const_unary_op_fcn> non_const_unary_ops; |
210 | |
211 Array<binary_class_op_fcn> binary_class_ops; | |
183 | 212 |
184 Array3<binary_op_fcn> binary_ops; | 213 Array3<binary_op_fcn> binary_ops; |
185 | 214 |
186 Array2<cat_op_fcn> cat_ops; | 215 Array2<cat_op_fcn> cat_ops; |
187 | 216 |
196 Array2<octave_base_value::type_conv_fcn> widening_ops; | 225 Array2<octave_base_value::type_conv_fcn> widening_ops; |
197 | 226 |
198 int do_register_type (const std::string&, const std::string&, | 227 int do_register_type (const std::string&, const std::string&, |
199 const octave_value&); | 228 const octave_value&); |
200 | 229 |
230 bool do_register_unary_class_op (octave_value::unary_op, unary_class_op_fcn); | |
231 | |
201 bool do_register_unary_op (octave_value::unary_op, int, unary_op_fcn); | 232 bool do_register_unary_op (octave_value::unary_op, int, unary_op_fcn); |
202 | 233 |
203 bool do_register_non_const_unary_op (octave_value::unary_op, int, | 234 bool do_register_non_const_unary_op (octave_value::unary_op, int, |
204 non_const_unary_op_fcn); | 235 non_const_unary_op_fcn); |
205 | 236 |
237 bool do_register_binary_class_op (octave_value::binary_op, | |
238 binary_class_op_fcn); | |
239 | |
206 bool do_register_binary_op (octave_value::binary_op, int, int, | 240 bool do_register_binary_op (octave_value::binary_op, int, int, |
207 binary_op_fcn); | 241 binary_op_fcn); |
208 | 242 |
209 bool do_register_cat_op (int, int, cat_op_fcn); | 243 bool do_register_cat_op (int, int, cat_op_fcn); |
210 | 244 |
220 | 254 |
221 bool do_register_widening_op (int, int, octave_base_value::type_conv_fcn); | 255 bool do_register_widening_op (int, int, octave_base_value::type_conv_fcn); |
222 | 256 |
223 octave_value do_lookup_type (const std::string& nm); | 257 octave_value do_lookup_type (const std::string& nm); |
224 | 258 |
259 unary_class_op_fcn do_lookup_unary_class_op (octave_value::unary_op); | |
260 | |
225 unary_op_fcn do_lookup_unary_op (octave_value::unary_op, int); | 261 unary_op_fcn do_lookup_unary_op (octave_value::unary_op, int); |
226 | 262 |
227 non_const_unary_op_fcn do_lookup_non_const_unary_op | 263 non_const_unary_op_fcn do_lookup_non_const_unary_op |
228 (octave_value::unary_op, int); | 264 (octave_value::unary_op, int); |
265 | |
266 binary_class_op_fcn do_lookup_binary_class_op (octave_value::binary_op); | |
229 | 267 |
230 binary_op_fcn do_lookup_binary_op (octave_value::binary_op, int, int); | 268 binary_op_fcn do_lookup_binary_op (octave_value::binary_op, int, int); |
231 | 269 |
232 cat_op_fcn do_lookup_cat_op (int, int); | 270 cat_op_fcn do_lookup_cat_op (int, int); |
233 | 271 |