26 #if defined (HAVE_CONFIG_H)
46 std::string::size_type pos = nm.find_last_of (
'.');
48 if (pos != std::string::npos)
49 return nm.substr (pos + 1);
81 bool load_if_not_found)
85 return cdm.
find_class (name, error_if_not_found, load_if_not_found);
112 std::list<cdef_class>
115 std::list<cdef_class> retval;
117 for (
int i = 0; i < cls_list.
numel (); i++)
121 retval.push_back (c);
146 error (
"cannot convert '%s' into 'object'", val.
type_name().c_str ());
155 error (
"cannot convert '%s' into 'object'", val.
type_name().c_str ());
167 to_ov (
const std::list<cdef_class>& class_list)
169 Cell cls (class_list.size (), 1);
172 for (
const auto& cdef_cls : class_list)
173 cls(i++) =
to_ov (cdef_cls);
189 if (! uf || ! uf->
body ())
201 bool allow_equal,
int max_depth)
205 if (allow_equal && clsa == clsb)
207 else if (max_depth != 0)
211 for (
int i = 0; ! retval && i < c.
numel (); i++)
218 max_depth < 0 ? max_depth : max_depth-1);
239 bool load_if_not_found)
243 return cdm.
find_package (name, error_if_not_found, load_if_not_found);
250 in_constructor =
false;
264 if (! dispatch_class.empty ())
287 std::string dummy_string;
295 const std::string& meth_name,
const std::string& prop_name,
302 if (acc_s ==
"public")
312 if (acc_s ==
"private")
314 else if (acc_s ==
"protected")
325 if (! meth_name.empty ())
331 m.get (
"Access"), meth_name);
335 else if (! prop_name.empty ())
346 prop_name, is_prop_set);
390 for (
int i = 0; i < acc.
numel (); i++)
400 error (
"invalid property/method access in class '%s'",
406 OCTAVE_END_NAMESPACE(
octave)
bool is_superclass(const cdef_class &clsa, const cdef_class &clsb, bool allow_equal, int max_depth)
bool check_access(const cdef_class &cls, const octave_value &acc, const std::string &meth_name, const std::string &prop_name, bool is_prop_set)
bool is_strict_superclass(const cdef_class &clsa, const cdef_class &clsb)
bool is_dummy_method(const octave_value &fcn)
cdef_object to_cdef(const octave_value &val)
std::list< cdef_class > lookup_classes(const Cell &cls_list)
cdef_object & to_cdef_ref(const octave_value &val)
cdef_class get_class_context(std::string &name, bool &in_constructor)
cdef_class lookup_class(const std::string &name, bool error_if_not_found, bool load_if_not_found)
std::string get_base_name(const std::string &nm)
octave_value to_ov(const cdef_object &obj)
cdef_package lookup_package(const std::string &name, bool error_if_not_found, bool load_if_not_found)
void make_function_of_class(const std::string &class_name, const octave_value &fcn)
bool is_direct_superclass(const cdef_class &clsa, const cdef_class &clsb)
octave_idx_type numel() const
Number of elements in the array.
cdef_method find_method(const std::string &nm, bool local=false)
std::string get_name() const
cdef_property find_property(const std::string &nm)
cdef_package find_package(const std::string &name, bool error_if_not_found=true, bool load_if_not_found=true)
cdef_class find_class(const std::string &name, bool error_if_not_found=true, bool load_if_not_found=true)
octave_value get(const std::string &pname) const
virtual octave_user_function * user_function_value(bool silent=false)
octave_value get_property(octave_idx_type idx, const std::string &name) const
virtual bool is_anonymous_function_of_class(const std::string &="") const
std::string dispatch_class() const
bool is_class_method(const std::string &cname="") const
bool is_private_function() const
virtual bool is_classdef_constructor(const std::string &="") const
void stash_dispatch_class(const std::string &nm)
octave::tree_statement_list * body()
void mark_as_classdef_method()
void mark_as_classdef_constructor()
octave_base_value * internal_rep() const
octave_user_function * user_function_value(bool silent=false) const
octave_function * function_value(bool silent=false) const
octave_idx_type numel() const
std::string string_value(bool force=false) const
bool is_user_function() const
std::string type_name() const
std::string get_dispatch_class() const
octave_function * current_function(bool skip_first=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void() error(const char *fmt,...)
#define panic_impossible()
cdef_manager & __get_cdef_manager__()
tree_evaluator & __get_evaluator__()
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))