26#if ! defined (octave_cdef_method_h)
27#define octave_cdef_method_h 1
29#include "octave-config.h"
67 std::string
get_name (
void)
const {
return get(
"Name").string_value (); }
69 void set_name (
const std::string& nm) { put (
"Name", nm); }
71 bool is_static (
void)
const {
return get(
"Static").bool_value (); }
77 OCTINTERP_API std::string get_doc_string (
void);
81 bool is_external (
void)
const {
return ! m_dispatch_type.empty (); }
85 m_dispatch_type = dtype;
90 bool do_check_access =
true,
const std::string& who =
"");
95 bool do_check_access =
true,
const std::string& who =
"");
97 OCTINTERP_API
bool is_constructor (
void)
const;
99 OCTINTERP_API
bool is_defined_in_class (
const std::string& cname)
const;
102 meta_subsref (
const std::string& type,
103 const std::list<octave_value_list>& idx,
int nargout);
107 return (type ==
'(' || type ==
'.');
114 m_dispatch_type (m.m_dispatch_type)
117 OCTINTERP_API
void check_method (
void);
140 get_rep ()->set_name (nm);
150 error (
"internal error: invalid assignment from %s to meta.method object",
151 class_name ().c_str ());
165 bool do_check_access =
true,
166 const std::string& who =
"")
168 return get_rep ()->execute (args, nargout, do_check_access, who);
174 bool do_check_access =
true,
175 const std::string& who =
"")
177 return get_rep ()->execute (obj, args, nargout, do_check_access, who);
182 std::string
get_name (
void)
const {
return get_rep ()->get_name (); }
184 bool is_static (
void)
const {
return get_rep ()->is_static (); }
188 get_rep ()->set_function (fcn);
193 return get_rep ()->get_function ();
198 return get_rep ()->get_doc_string ();
203 return get_rep ()->is_constructor ();
208 return get_rep ()->is_defined_in_class (cname);
211 bool is_external (
void)
const {
return get_rep ()->is_external (); }
215 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
octave_value get_function(void) const
bool is_external(void) const
void mark_as_external(const std::string &dtype)
cdef_object_rep * copy(void) const
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
std::string m_dispatch_type
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="")
const cdef_method_rep * get_rep(void) const
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
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)