Mercurial > hg > octave-lyh
comparison src/ov-class.cc @ 13874:c1b754d93572
copy parent class info when performing operations on class objects
* ov.h (octave_value::octave_value (const Octave_map&,
const std::string&, const std::list<std::string>&)):
Don't provide default value for parent_list argument.
Change all callers that used only two arguments.
* ov-class.h (octave_class::octave_class (const octave_map&,
const std::string&, const std::list<std::string>&)): Likewise.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 17 Nov 2011 04:01:04 -0500 |
parents | 0bbe319bf26b |
children | 72c96de7a403 |
comparison
equal
deleted
inserted
replaced
13873:1bf8c244040a | 13874:c1b754d93572 |
---|---|
513 skip++; | 513 skip++; |
514 } | 514 } |
515 } | 515 } |
516 else | 516 else |
517 retval(0) = octave_value (map.index (idx.front ()), | 517 retval(0) = octave_value (map.index (idx.front ()), |
518 class_name ()); | 518 c_name, parent_list); |
519 } | 519 } |
520 break; | 520 break; |
521 | 521 |
522 case '.': | 522 case '.': |
523 { | 523 { |
589 retval = octave_value (retval, true); | 589 retval = octave_value (retval, true); |
590 } | 590 } |
591 else | 591 else |
592 { | 592 { |
593 if (type.length () == 1 && type[0] == '(') | 593 if (type.length () == 1 && type[0] == '(') |
594 retval(0) = octave_value (map.index (idx.front ()), class_name (), | 594 retval(0) = octave_value (map.index (idx.front ()), c_name, |
595 parent_class_name_list ()); | 595 parent_list); |
596 else | 596 else |
597 gripe_invalid_index1 (); | 597 gripe_invalid_index1 (); |
598 } | 598 } |
599 } | 599 } |
600 | 600 |
991 octave_value meth = symbol_table::find_method ("subsindex", class_name ()); | 991 octave_value meth = symbol_table::find_method ("subsindex", class_name ()); |
992 | 992 |
993 if (meth.is_defined ()) | 993 if (meth.is_defined ()) |
994 { | 994 { |
995 octave_value_list args; | 995 octave_value_list args; |
996 args(0) = octave_value (new octave_class (map, c_name)); | 996 args(0) = octave_value (new octave_class (map, c_name, parent_list)); |
997 | 997 |
998 octave_value_list tmp = feval (meth.function_value (), args, 1); | 998 octave_value_list tmp = feval (meth.function_value (), args, 1); |
999 | 999 |
1000 if (!error_state && tmp.length () >= 1) | 1000 if (!error_state && tmp.length () >= 1) |
1001 { | 1001 { |
1121 octave_value meth = symbol_table::find_method ("char", class_name ()); | 1121 octave_value meth = symbol_table::find_method ("char", class_name ()); |
1122 | 1122 |
1123 if (meth.is_defined ()) | 1123 if (meth.is_defined ()) |
1124 { | 1124 { |
1125 octave_value_list args; | 1125 octave_value_list args; |
1126 args(0) = octave_value (new octave_class (map, c_name)); | 1126 args(0) = octave_value (new octave_class (map, c_name, parent_list)); |
1127 | 1127 |
1128 octave_value_list tmp = feval (meth.function_value (), args, 1); | 1128 octave_value_list tmp = feval (meth.function_value (), args, 1); |
1129 | 1129 |
1130 if (!error_state && tmp.length () >= 1) | 1130 if (!error_state && tmp.length () >= 1) |
1131 { | 1131 { |
1952 octave_map m = args(0).map_value (); | 1952 octave_map m = args(0).map_value (); |
1953 | 1953 |
1954 if (! error_state) | 1954 if (! error_state) |
1955 { | 1955 { |
1956 if (nargin == 2) | 1956 if (nargin == 2) |
1957 retval = octave_value (new octave_class (m, id)); | 1957 retval |
1958 = octave_value (new octave_class | |
1959 (m, id, std::list<std::string> ())); | |
1958 else | 1960 else |
1959 { | 1961 { |
1960 octave_value_list parents = args.slice (2, nargin-2); | 1962 octave_value_list parents = args.slice (2, nargin-2); |
1961 | 1963 |
1962 retval | 1964 retval |