26 #if ! defined (octave_cdef_method_h)
27 #define octave_cdef_method_h 1
29 #include "octave-config.h"
66 std::string
get_name (
void)
const {
return get(
"Name").string_value (); }
68 void set_name (
const std::string& nm) { put (
"Name", nm); }
70 bool is_static (
void)
const {
return get(
"Static").bool_value (); }
76 std::string get_doc_string (
void);
80 bool is_external (
void)
const {
return ! dispatch_type.empty (); }
84 dispatch_type = dtype;
88 bool do_check_access =
true,
89 const std::string& who =
"");
93 bool do_check_access =
true,
94 const std::string& who =
"");
96 bool is_constructor (
void)
const;
98 bool is_defined_in_class (
const std::string& cname)
const;
101 meta_subsref (
const std::string&
type,
102 const std::list<octave_value_list>& idx,
int nargout);
106 return (
type ==
'(' ||
type ==
'.');
113 dispatch_type (
m.dispatch_type)
116 void check_method (
void);
139 get_rep ()->set_name (nm);
149 error (
"internal error: invalid assignment from %s to meta.method object",
150 class_name ().c_str ());
164 bool do_check_access =
true,
165 const std::string& who =
"")
167 return get_rep ()->execute (args, nargout, do_check_access, who);
173 bool do_check_access =
true,
174 const std::string& who =
"")
176 return get_rep ()->execute (obj, args, nargout, do_check_access, who);
181 std::string
get_name (
void)
const {
return get_rep ()->get_name (); }
183 bool is_static (
void)
const {
return get_rep ()->is_static (); }
187 get_rep ()->set_function (fcn);
192 return get_rep ()->get_function ();
197 return get_rep ()->get_doc_string ();
202 return get_rep ()->is_constructor ();
207 return get_rep ()->is_defined_in_class (cname);
210 bool is_external (
void)
const {
return get_rep ()->is_external (); }
214 get_rep ()->mark_as_external (dtype);
std::string get_name(void) const
bool is_method(void) const
bool meta_accepts_postfix_index(char type) const
cdef_object_rep * copy(void) const
octave_value get_function(void) const
bool is_external(void) const
void mark_as_external(const std::string &dtype)
std::string dispatch_type
cdef_method_rep(const cdef_method_rep &m)
bool is_static(void) const
void set_function(const octave_value &fcn)
~cdef_method_rep(void)=default
void set_name(const std::string &nm)
bool check_access(void) const
cdef_method(const std::string &nm)
bool is_defined_in_class(const std::string &cname) 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="")
cdef_method(const cdef_object &obj)
bool is_constructor(void) const
bool is_external(void) const
octave_value_list execute(const cdef_object &obj, const octave_value_list &args, int nargout, bool do_check_access=true, const std::string &who="")
cdef_method(const cdef_method &meth)
bool is_static(void) const
void mark_as_external(const std::string &dtype)
std::string get_doc_string(void)
~cdef_method(void)=default
const cdef_method_rep * get_rep(void) const
cdef_method_rep * get_rep(void)
octave_value get_function(void) const
void set_function(const octave_value &fcn)
cdef_object & operator=(const cdef_object &obj)
const cdef_object_rep * get_rep(void) const
void error(const char *fmt,...)
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)