Mercurial > octave-nkf
comparison src/ov-typeinfo.h @ 5759:ce79d238f142
[project @ 2006-04-13 13:04:32 by jwe]
author | jwe |
---|---|
date | Thu, 13 Apr 2006 13:04:33 +0000 |
parents | 4c8a2e4e0717 |
children | 8d7162924bd3 |
comparison
equal
deleted
inserted
replaced
5758:65208d959bf1 | 5759:ce79d238f142 |
---|---|
37 class | 37 class |
38 octave_value_typeinfo | 38 octave_value_typeinfo |
39 { | 39 { |
40 public: | 40 public: |
41 | 41 |
42 typedef octave_value (*unary_op_fcn) (const octave_base_value&); | |
43 | |
44 typedef void (*non_const_unary_op_fcn) (octave_base_value&); | |
45 | |
46 typedef octave_value (*binary_op_fcn) | |
47 (const octave_base_value&, const octave_base_value&); | |
48 | |
49 typedef octave_value (*cat_op_fcn) | |
50 (octave_base_value&, const octave_base_value&, const Array<int>& ra_idx); | |
51 | |
52 typedef octave_value (*assign_op_fcn) | |
53 (octave_base_value&, const octave_value_list&, const octave_base_value&); | |
54 | |
55 typedef octave_value (*assignany_op_fcn) | |
56 (octave_base_value&, const octave_value_list&, const octave_value&); | |
57 | |
42 static bool instance_ok (void); | 58 static bool instance_ok (void); |
43 | 59 |
44 static int register_type (const std::string&, const std::string&, | 60 static int register_type (const std::string&, const std::string&, |
45 const octave_value&); | 61 const octave_value&); |
46 | 62 |
56 | 72 |
57 static bool register_assign_op (octave_value::assign_op, int, int, | 73 static bool register_assign_op (octave_value::assign_op, int, int, |
58 assign_op_fcn); | 74 assign_op_fcn); |
59 | 75 |
60 static bool register_assignany_op (octave_value::assign_op, int, | 76 static bool register_assignany_op (octave_value::assign_op, int, |
61 assign_op_fcn); | 77 assignany_op_fcn); |
62 | 78 |
63 static bool register_pref_assign_conv (int, int, int); | 79 static bool register_pref_assign_conv (int, int, int); |
64 | 80 |
65 static bool register_type_conv_op (int, int, type_conv_fcn); | 81 static bool |
66 | 82 register_type_conv_op (int, int, octave_base_value::type_conv_fcn); |
67 static bool register_widening_op (int, int, type_conv_fcn); | 83 |
84 static bool | |
85 register_widening_op (int, int, octave_base_value::type_conv_fcn); | |
68 | 86 |
69 static octave_value | 87 static octave_value |
70 lookup_type (const std::string& nm) | 88 lookup_type (const std::string& nm) |
71 { | 89 { |
72 return instance->do_lookup_type (nm); | 90 return instance->do_lookup_type (nm); |
100 lookup_assign_op (octave_value::assign_op op, int t_lhs, int t_rhs) | 118 lookup_assign_op (octave_value::assign_op op, int t_lhs, int t_rhs) |
101 { | 119 { |
102 return instance->do_lookup_assign_op (op, t_lhs, t_rhs); | 120 return instance->do_lookup_assign_op (op, t_lhs, t_rhs); |
103 } | 121 } |
104 | 122 |
105 static assign_op_fcn | 123 static assignany_op_fcn |
106 lookup_assignany_op (octave_value::assign_op op, int t_lhs) | 124 lookup_assignany_op (octave_value::assign_op op, int t_lhs) |
107 { | 125 { |
108 return instance->do_lookup_assignany_op (op, t_lhs); | 126 return instance->do_lookup_assignany_op (op, t_lhs); |
109 } | 127 } |
110 | 128 |
112 lookup_pref_assign_conv (int t_lhs, int t_rhs) | 130 lookup_pref_assign_conv (int t_lhs, int t_rhs) |
113 { | 131 { |
114 return instance->do_lookup_pref_assign_conv (t_lhs, t_rhs); | 132 return instance->do_lookup_pref_assign_conv (t_lhs, t_rhs); |
115 } | 133 } |
116 | 134 |
117 static type_conv_fcn | 135 static octave_base_value::type_conv_fcn |
118 lookup_type_conv_op (int t, int t_result) | 136 lookup_type_conv_op (int t, int t_result) |
119 { | 137 { |
120 return instance->do_lookup_type_conv_op (t, t_result); | 138 return instance->do_lookup_type_conv_op (t, t_result); |
121 } | 139 } |
122 | 140 |
123 static type_conv_fcn | 141 static octave_base_value::type_conv_fcn |
124 lookup_widening_op (int t, int t_result) | 142 lookup_widening_op (int t, int t_result) |
125 { | 143 { |
126 return instance->do_lookup_widening_op (t, t_result); | 144 return instance->do_lookup_widening_op (t, t_result); |
127 } | 145 } |
128 | 146 |
144 init_tab_sz, (binary_op_fcn) 0), | 162 init_tab_sz, (binary_op_fcn) 0), |
145 cat_ops (init_tab_sz, init_tab_sz, (cat_op_fcn) 0), | 163 cat_ops (init_tab_sz, init_tab_sz, (cat_op_fcn) 0), |
146 assign_ops (octave_value::num_assign_ops, init_tab_sz, | 164 assign_ops (octave_value::num_assign_ops, init_tab_sz, |
147 init_tab_sz, (assign_op_fcn) 0), | 165 init_tab_sz, (assign_op_fcn) 0), |
148 assignany_ops (octave_value::num_assign_ops, init_tab_sz, | 166 assignany_ops (octave_value::num_assign_ops, init_tab_sz, |
149 (assign_op_fcn) 0), | 167 (assignany_op_fcn) 0), |
150 pref_assign_conv (init_tab_sz, init_tab_sz, -1), | 168 pref_assign_conv (init_tab_sz, init_tab_sz, -1), |
151 type_conv_ops (init_tab_sz, init_tab_sz, (type_conv_fcn) 0), | 169 type_conv_ops (init_tab_sz, init_tab_sz, (octave_base_value::type_conv_fcn) 0), |
152 widening_ops (init_tab_sz, init_tab_sz, (type_conv_fcn) 0) { } | 170 widening_ops (init_tab_sz, init_tab_sz, (octave_base_value::type_conv_fcn) 0) { } |
153 | 171 |
154 private: | 172 private: |
155 | 173 |
156 static const int init_tab_sz; | 174 static const int init_tab_sz; |
157 | 175 |
171 | 189 |
172 Array2<cat_op_fcn> cat_ops; | 190 Array2<cat_op_fcn> cat_ops; |
173 | 191 |
174 Array3<assign_op_fcn> assign_ops; | 192 Array3<assign_op_fcn> assign_ops; |
175 | 193 |
176 Array2<assign_op_fcn> assignany_ops; | 194 Array2<assignany_op_fcn> assignany_ops; |
177 | 195 |
178 Array2<int> pref_assign_conv; | 196 Array2<int> pref_assign_conv; |
179 | 197 |
180 Array2<type_conv_fcn> type_conv_ops; | 198 Array2<octave_base_value::type_conv_fcn> type_conv_ops; |
181 | 199 |
182 Array2<type_conv_fcn> widening_ops; | 200 Array2<octave_base_value::type_conv_fcn> widening_ops; |
183 | 201 |
184 int do_register_type (const std::string&, const std::string&, | 202 int do_register_type (const std::string&, const std::string&, |
185 const octave_value&); | 203 const octave_value&); |
186 | 204 |
187 bool do_register_unary_op (octave_value::unary_op, int, unary_op_fcn); | 205 bool do_register_unary_op (octave_value::unary_op, int, unary_op_fcn); |
196 | 214 |
197 bool do_register_assign_op (octave_value::assign_op, int, int, | 215 bool do_register_assign_op (octave_value::assign_op, int, int, |
198 assign_op_fcn); | 216 assign_op_fcn); |
199 | 217 |
200 bool do_register_assignany_op (octave_value::assign_op, int, | 218 bool do_register_assignany_op (octave_value::assign_op, int, |
201 assign_op_fcn); | 219 assignany_op_fcn); |
202 | 220 |
203 bool do_register_pref_assign_conv (int, int, int); | 221 bool do_register_pref_assign_conv (int, int, int); |
204 | 222 |
205 bool do_register_type_conv_op (int, int, type_conv_fcn); | 223 bool do_register_type_conv_op (int, int, octave_base_value::type_conv_fcn); |
206 | 224 |
207 bool do_register_widening_op (int, int, type_conv_fcn); | 225 bool do_register_widening_op (int, int, octave_base_value::type_conv_fcn); |
208 | 226 |
209 octave_value do_lookup_type (const std::string& nm); | 227 octave_value do_lookup_type (const std::string& nm); |
210 | 228 |
211 unary_op_fcn do_lookup_unary_op (octave_value::unary_op, int); | 229 unary_op_fcn do_lookup_unary_op (octave_value::unary_op, int); |
212 | 230 |
217 | 235 |
218 cat_op_fcn do_lookup_cat_op (int, int); | 236 cat_op_fcn do_lookup_cat_op (int, int); |
219 | 237 |
220 assign_op_fcn do_lookup_assign_op (octave_value::assign_op, int, int); | 238 assign_op_fcn do_lookup_assign_op (octave_value::assign_op, int, int); |
221 | 239 |
222 assign_op_fcn do_lookup_assignany_op (octave_value::assign_op, int); | 240 assignany_op_fcn do_lookup_assignany_op (octave_value::assign_op, int); |
223 | 241 |
224 int do_lookup_pref_assign_conv (int, int); | 242 int do_lookup_pref_assign_conv (int, int); |
225 | 243 |
226 type_conv_fcn do_lookup_type_conv_op (int, int); | 244 octave_base_value::type_conv_fcn do_lookup_type_conv_op (int, int); |
227 | 245 |
228 type_conv_fcn do_lookup_widening_op (int, int); | 246 octave_base_value::type_conv_fcn do_lookup_widening_op (int, int); |
229 | 247 |
230 string_vector do_installed_type_names (void); | 248 string_vector do_installed_type_names (void); |
231 | 249 |
232 // No copying! | 250 // No copying! |
233 | 251 |