26 #if defined (HAVE_CONFIG_H)
54 OCTAVE_NORETURN
static
64 acc_s =
"class-restricted";
66 error (
"%s: method '%s' has %s access and cannot be run in this context",
67 from.c_str (), meth.
get_name ().c_str (), acc_s.c_str ());
82 std::string pack_name;
84 size_t pos = cls_name.rfind (
'.');
86 if (pos != std::string::npos)
88 pack_name = cls_name.substr (0, pos);
89 cls_name = cls_name.substr (pos + 1);
96 if (! file_name.empty ())
116 error (
"no definition found for method '%s' of class '%s'",
123 int nargout,
bool do_check_access,
124 const std::string& who)
131 if (
get (
"Abstract").bool_value ())
132 error (
"%s: cannot execute abstract method",
133 get (
"Name").string_value ().c_str ());
137 if (
function.is_defined ())
146 int nargout,
bool do_check_access,
147 const std::string& who)
154 if (
get (
"Abstract").bool_value ())
155 error (
"%s: cannot execute abstract method",
156 get (
"Name").string_value ().c_str ());
160 if (
function.is_defined ())
166 new_args(0) =
to_ov (obj);
167 for (
int i = 0; i < args.
length (); i++)
168 new_args(i+1) = args(i);
179 if (
function.is_function())
180 return function.function_value ()->is_classdef_constructor ();
188 return (
function.is_function ()
189 ?
function.function_value ()->dispatch_class () == cname
213 (
const std::string&
type,
const std::list<octave_value_list>& idx,
225 error (
"invalid meta.method indexing");
229 if (
type.length () > 1 && idx.size () > 1 && !
retval.empty ())
std::string get_name(void) const
octave_value_list execute(const octave_value_list &args, int nargout, bool do_check_access=true, const std::string &who="")
bool is_defined_in_class(const std::string &cname) const
bool is_constructor(void) const
bool is_external(void) const
std::string dispatch_type
std::string get_doc_string(void)
bool check_access(void) const
octave_value_list meta_subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout)
bool check_access(void) const
std::string get_name(void) const
octave_value_list execute(const octave_value_list &args, int nargout, bool do_check_access=true, const std::string &who="")
octave_value get(const std::string &pname) const
std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name="")
virtual octave_function * function_value(bool silent=false)
virtual std::string doc_string(const std::string &="") const
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
octave_idx_type length(void) const
bool is_string(void) const
bool is_defined(void) const
std::string string_value(bool force=false) const
void error(const char *fmt,...)
octave_value load_fcn_from_file(const std::string &file_name, const std::string &dir_name, const std::string &dispatch_type, const std::string &package_name, const std::string &fcn_name, bool autoload)
void make_function_of_class(const std::string &class_name, const octave_value &fcn)
bool is_dummy_method(const octave_value &fcn)
octave_value to_ov(const cdef_object &obj)
cdef_object to_cdef(const octave_value &val)
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)
static OCTAVE_NORETURN void err_method_access(const std::string &from, const cdef_method &meth)
octave_value_list feval(const char *name, const octave_value_list &args, int nargout)
Evaluate an Octave function (built-in or interpreted) and return the list of result values.
load_path & __get_load_path__(const std::string &who)
octave_value::octave_value(const Array< char > &chm, char type) return retval