comparison src/ov.h @ 3523:b80bbb43a1a9

[project @ 2000-02-02 10:25:52 by jwe]
author jwe
date Wed, 02 Feb 2000 10:26:25 +0000
parents d14c483b3c12
children 6cfa474c5b99
comparison
equal deleted inserted replaced
3522:bd422cf62f0c 3523:b80bbb43a1a9
139 el_or_eq, 139 el_or_eq,
140 num_assign_ops, 140 num_assign_ops,
141 unknown_assign_op 141 unknown_assign_op
142 }; 142 };
143 143
144 static string unary_op_as_string (unary_op); 144 static std::string unary_op_as_string (unary_op);
145 145
146 static string binary_op_as_string (binary_op); 146 static std::string binary_op_as_string (binary_op);
147 147
148 static string assign_op_as_string (assign_op); 148 static std::string assign_op_as_string (assign_op);
149 149
150 enum magic_colon { magic_colon_t }; 150 enum magic_colon { magic_colon_t };
151 enum all_va_args { all_va_args_t }; 151 enum all_va_args { all_va_args_t };
152 152
153 octave_value (void); 153 octave_value (void);
164 octave_value (const ComplexColumnVector& v); 164 octave_value (const ComplexColumnVector& v);
165 octave_value (bool b); 165 octave_value (bool b);
166 octave_value (const boolMatrix& bm); 166 octave_value (const boolMatrix& bm);
167 octave_value (char c); 167 octave_value (char c);
168 octave_value (const char *s); 168 octave_value (const char *s);
169 octave_value (const string& s); 169 octave_value (const std::string& s);
170 octave_value (const string_vector& s); 170 octave_value (const string_vector& s);
171 octave_value (const charMatrix& chm, bool is_string = false); 171 octave_value (const charMatrix& chm, bool is_string = false);
172 octave_value (double base, double limit, double inc); 172 octave_value (double base, double limit, double inc);
173 octave_value (const Range& r); 173 octave_value (const Range& r);
174 octave_value (const Octave_map& m); 174 octave_value (const Octave_map& m);
243 243
244 void assign (assign_op, const octave_value_list& idx, 244 void assign (assign_op, const octave_value_list& idx,
245 const octave_value& rhs); 245 const octave_value& rhs);
246 246
247 virtual void 247 virtual void
248 assign_struct_elt (assign_op, const string& elt_nm, 248 assign_struct_elt (assign_op, const std::string& elt_nm,
249 const octave_value& rhs); 249 const octave_value& rhs);
250 250
251 virtual void 251 virtual void
252 assign_struct_elt (assign_op, const string& elt_nm, 252 assign_struct_elt (assign_op, const std::string& elt_nm,
253 const octave_value_list& idx, const octave_value& rhs); 253 const octave_value_list& idx, const octave_value& rhs);
254 254
255 virtual idx_vector index_vector (void) const 255 virtual idx_vector index_vector (void) const
256 { return rep->index_vector (); } 256 { return rep->index_vector (); }
257 257
258 virtual octave_value 258 virtual octave_value
259 do_struct_elt_index_op (const string& nm, bool silent = false) 259 do_struct_elt_index_op (const std::string& nm, bool silent = false)
260 { return rep->do_struct_elt_index_op (nm, silent); } 260 { return rep->do_struct_elt_index_op (nm, silent); }
261 261
262 virtual octave_value 262 virtual octave_value
263 do_struct_elt_index_op (const string& nm, const octave_value_list& idx, 263 do_struct_elt_index_op (const std::string& nm, const octave_value_list& idx,
264 bool silent = false) 264 bool silent = false)
265 { return rep->do_struct_elt_index_op (nm, idx, silent); } 265 { return rep->do_struct_elt_index_op (nm, idx, silent); }
266 266
267 octave_lvalue struct_elt_ref (const string& nm); 267 octave_lvalue struct_elt_ref (const std::string& nm);
268 268
269 virtual octave_lvalue 269 virtual octave_lvalue
270 struct_elt_ref (octave_value *parent, const string& nm); 270 struct_elt_ref (octave_value *parent, const std::string& nm);
271 271
272 // Size. 272 // Size.
273 273
274 virtual int rows (void) const 274 virtual int rows (void) const
275 { return rep->rows (); } 275 { return rep->rows (); }
421 { return rep->char_matrix_value (frc_str_conv); } 421 { return rep->char_matrix_value (frc_str_conv); }
422 422
423 virtual string_vector all_strings (void) const 423 virtual string_vector all_strings (void) const
424 { return rep->all_strings (); } 424 { return rep->all_strings (); }
425 425
426 virtual string string_value (void) const 426 virtual std::string string_value (void) const
427 { return rep->string_value (); } 427 { return rep->string_value (); }
428 428
429 virtual Range range_value (void) const 429 virtual Range range_value (void) const
430 { return rep->range_value (); } 430 { return rep->range_value (); }
431 431
473 { return rep->convert_to_str (); } 473 { return rep->convert_to_str (); }
474 474
475 virtual void convert_to_row_or_column_vector (void) 475 virtual void convert_to_row_or_column_vector (void)
476 { rep->convert_to_row_or_column_vector (); } 476 { rep->convert_to_row_or_column_vector (); }
477 477
478 virtual void print (ostream& os, bool pr_as_read_syntax = false) const 478 virtual void print (std::ostream& os, bool pr_as_read_syntax = false) const
479 { rep->print (os, pr_as_read_syntax); } 479 { rep->print (os, pr_as_read_syntax); }
480 480
481 virtual void print_raw (ostream& os, bool pr_as_read_syntax = false) const 481 virtual void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const
482 { rep->print_raw (os, pr_as_read_syntax); } 482 { rep->print_raw (os, pr_as_read_syntax); }
483 483
484 virtual bool print_name_tag (ostream& os, const string& name) const 484 virtual bool print_name_tag (std::ostream& os, const std::string& name) const
485 { return rep->print_name_tag (os, name); } 485 { return rep->print_name_tag (os, name); }
486 486
487 void print_with_name (ostream& os, const string& name, 487 void print_with_name (std::ostream& os, const std::string& name,
488 bool print_padding = true) const; 488 bool print_padding = true) const;
489 489
490 virtual int type_id (void) const { return rep->type_id (); } 490 virtual int type_id (void) const { return rep->type_id (); }
491 491
492 virtual string type_name (void) const { return rep->type_name (); } 492 virtual std::string type_name (void) const { return rep->type_name (); }
493 493
494 // Unary and binary operations. 494 // Unary and binary operations.
495 495
496 friend octave_value do_unary_op (octave_value::unary_op, 496 friend octave_value do_unary_op (octave_value::unary_op,
497 const octave_value&); 497 const octave_value&);
521 { curr_print_indent_level -= 2; } 521 { curr_print_indent_level -= 2; }
522 522
523 int current_print_indent_level (void) const 523 int current_print_indent_level (void) const
524 { return curr_print_indent_level; } 524 { return curr_print_indent_level; }
525 525
526 void newline (ostream& os) const; 526 void newline (std::ostream& os) const;
527 527
528 void indent (ostream& os) const; 528 void indent (std::ostream& os) const;
529 529
530 void reset (void) const; 530 void reset (void) const;
531 531
532 private: 532 private:
533 533
636 // T_ID is the type id of struct objects, set by register_type(). 636 // T_ID is the type id of struct objects, set by register_type().
637 // T_NAME is the type name of struct objects. 637 // T_NAME is the type name of struct objects.
638 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA \ 638 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA \
639 public: \ 639 public: \
640 int type_id (void) const { return t_id; } \ 640 int type_id (void) const { return t_id; } \
641 string type_name (void) const { return t_name; } \ 641 std::string type_name (void) const { return t_name; } \
642 static volatile int static_type_id (void) { return t_id; } \ 642 static volatile int static_type_id (void) { return t_id; } \
643 static void register_type (void) \ 643 static void register_type (void) \
644 { t_id = octave_value_typeinfo::register_type (t_name); } \ 644 { t_id = octave_value_typeinfo::register_type (t_name); } \
645 \ 645 \
646 private: \ 646 private: \
647 static volatile int t_id; \ 647 static volatile int t_id; \
648 static const string t_name; 648 static const std::string t_name;
649 649
650 #define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n) \ 650 #define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n) \
651 volatile int t::t_id (-1); \ 651 volatile int t::t_id (-1); \
652 const string t::t_name (n) 652 const std::string t::t_name (n)
653 653
654 // If TRUE, allow assignments like 654 // If TRUE, allow assignments like
655 // 655 //
656 // octave> A(1) = 3; A(2) = 5 656 // octave> A(1) = 3; A(2) = 5
657 // 657 //