comparison src/genprops.awk @ 7836:4fb2db9c87dd

Turn cdata properties into array_property. Add min/max computation to array_property.
author Michael Goffioul <michael.goffioul@gmail.com>
date Thu, 21 Feb 2008 13:45:04 +0100
parents 68550ad9ee9c
children 3d60445d3638
comparison
equal deleted inserted replaced
7835:ca8b97bb952c 7836:4fb2db9c87dd
209 209
210 printf (" data_property get_%s_property (void) const { return %s; }\n", 210 printf (" data_property get_%s_property (void) const { return %s; }\n",
211 name[i], name[i]); 211 name[i], name[i]);
212 } 212 }
213 213
214 ## array_property
215
216 function emit_get_array (i)
217 {
218 emit_get_accessor(i, "octave_value", "get");
219
220 printf (" array_property get_%s_property (void) const { return %s; }\n",
221 name[i], name[i]);
222 }
223
214 ## common section 224 ## common section
215 225
216 function emit_common_declarations () 226 function emit_common_declarations ()
217 { 227 {
218 printf ("public:\n"); 228 printf ("public:\n");
242 252
243 for (i = 1; i <= idx; i++) 253 for (i = 1; i <= idx; i++)
244 { 254 {
245 if (emit_get[i]) 255 if (emit_get[i])
246 { 256 {
247 if (type[i] == "array_property" \ 257 if (type[i] == "any_property")
248 || type[i] == "row_vector_property" \
249 || type[i] == "any_property")
250 emit_get_accessor(i, "octave_value", "get"); 258 emit_get_accessor(i, "octave_value", "get");
251 else if (type[i] == "handle_property") 259 else if (type[i] == "handle_property")
252 emit_get_accessor(i, "graphics_handle", "handle_value"); 260 emit_get_accessor(i, "graphics_handle", "handle_value");
253 else if (type[i] == "string_property") 261 else if (type[i] == "string_property")
254 emit_get_accessor(i, "std::string", "string_value"); 262 emit_get_accessor(i, "std::string", "string_value");
255 else if (type[i] == "double_property") 263 else if (type[i] == "double_property")
256 emit_get_accessor(i, "double", "double_value"); 264 emit_get_accessor(i, "double", "double_value");
257 else if (type[i] == "data_property") 265 else if (type[i] == "data_property")
258 emit_get_data(i); 266 emit_get_data(i);
267 else if (type[i] == "array_property" \
268 || type[i] == "row_vector_property")
269 emit_get_array(i);
259 else if (type[i] == "bool_property") 270 else if (type[i] == "bool_property")
260 emit_get_bool(i); 271 emit_get_bool(i);
261 else if (type[i] == "radio_property") 272 else if (type[i] == "radio_property")
262 emit_get_radio(i); 273 emit_get_radio(i);
263 else if (type[i] == "color_property") 274 else if (type[i] == "color_property")