Mercurial > octave-nkf
comparison libinterp/octave-value/ov-classdef.cc @ 18441:b0aba84cf80f
Support handle to classdef constructor.
* ov-classdef.cc (octave_classdef_meta::is_classdef_constructor): New
method, makes the meta-object to look like a cdef constructor.
* ov-fcn-handle.cc (make_fcn_handle): Handle classdef constructors like
legacy class constructors.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Sat, 08 Feb 2014 19:17:25 -0500 |
parents | d5aa615dcf4c |
children | 00ba456b9aa8 |
comparison
equal
deleted
inserted
replaced
18440:96a495813047 | 18441:b0aba84cf80f |
---|---|
1126 return subsref (type, l, nargout); | 1126 return subsref (type, l, nargout); |
1127 } | 1127 } |
1128 | 1128 |
1129 bool is_postfix_index_handled (char type) const | 1129 bool is_postfix_index_handled (char type) const |
1130 { return object.meta_is_postfix_index_handled (type); } | 1130 { return object.meta_is_postfix_index_handled (type); } |
1131 | |
1132 bool | |
1133 is_classdef_constructor (const std::string& cname = std::string ()) const | |
1134 { | |
1135 bool retval = false; | |
1136 | |
1137 if (object.is_class ()) | |
1138 { | |
1139 if (cname.empty ()) | |
1140 retval = true; | |
1141 else | |
1142 { | |
1143 cdef_class cls (object); | |
1144 | |
1145 if (cls.get_name () == cname) | |
1146 retval = true; | |
1147 } | |
1148 } | |
1149 | |
1150 return retval; | |
1151 } | |
1131 | 1152 |
1132 private: | 1153 private: |
1133 cdef_meta_object object; | 1154 cdef_meta_object object; |
1134 }; | 1155 }; |
1135 | 1156 |