comparison src/oct-lvalue.h @ 5846:db0598f94c0f

[project @ 2006-06-07 18:16:16 by jwe]
author jwe
date Wed, 07 Jun 2006 18:16:16 +0000
parents ace8d8d26933
children 93c65f2a5668
comparison
equal deleted inserted replaced
5845:8b4a99ae3b5e 5846:db0598f94c0f
43 { 43 {
44 public: 44 public:
45 45
46 octave_lvalue (octave_value *v = &dummy_val, 46 octave_lvalue (octave_value *v = &dummy_val,
47 symbol_record::change_function f = 0) 47 symbol_record::change_function f = 0)
48 : val (v), type (), idx (), chg_fcn (f), index_set (false) { } 48 : val (v), type (), idx (), chg_fcn (f), nel (1), index_set (false) { }
49 49
50 octave_lvalue (const octave_lvalue& vr) 50 octave_lvalue (const octave_lvalue& vr)
51 : val (vr.val), type (vr.type), idx (vr.idx), chg_fcn (vr.chg_fcn), 51 : val (vr.val), type (vr.type), idx (vr.idx), chg_fcn (vr.chg_fcn),
52 index_set (vr.index_set) { } 52 nel (vr.nel), index_set (vr.index_set) { }
53 53
54 octave_lvalue& operator = (const octave_lvalue& vr) 54 octave_lvalue& operator = (const octave_lvalue& vr)
55 { 55 {
56 if (this != &vr) 56 if (this != &vr)
57 { 57 {
58 val = vr.val; 58 val = vr.val;
59 type = vr.type; 59 type = vr.type;
60 idx = vr.idx; 60 idx = vr.idx;
61 chg_fcn = vr.chg_fcn; 61 chg_fcn = vr.chg_fcn;
62 nel = vr.nel;
62 index_set = vr.index_set; 63 index_set = vr.index_set;
63 } 64 }
64 65
65 return *this; 66 return *this;
66 } 67 }
74 bool is_map (void) { return val->is_map (); } 75 bool is_map (void) { return val->is_map (); }
75 76
76 void define (const octave_value& v) { *val = v; } 77 void define (const octave_value& v) { *val = v; }
77 78
78 void assign (octave_value::assign_op, const octave_value&); 79 void assign (octave_value::assign_op, const octave_value&);
80
81 void numel (octave_idx_type n) { nel = n; }
82
83 octave_idx_type numel (void) const { return nel; }
79 84
80 void set_index (const std::string& t, const std::list<octave_value_list>& i); 85 void set_index (const std::string& t, const std::list<octave_value_list>& i);
81 86
82 void clear_index (void) { type = std::string (); idx.clear (); } 87 void clear_index (void) { type = std::string (); idx.clear (); }
83 88
95 100
96 std::list<octave_value_list> idx; 101 std::list<octave_value_list> idx;
97 102
98 symbol_record::change_function chg_fcn; 103 symbol_record::change_function chg_fcn;
99 104
105 octave_idx_type nel;
106
100 bool index_set; 107 bool index_set;
101 }; 108 };
102 109
103 #endif 110 #endif
104 111