26 #if ! defined (octave_cdef_object_h)
27 #define octave_cdef_object_h 1
29 #include "octave-config.h"
66 err_invalid_object (
"set_class");
71 err_invalid_object (
"clone");
76 err_invalid_object (
"empty_clone");
81 err_invalid_object (
"copy");
86 err_invalid_object (
"make_array");
89 virtual bool is_array (
void)
const {
return false; }
99 err_invalid_object (
"array_value");
103 { err_invalid_object (
"put"); }
107 err_invalid_object (
"get");
113 err_invalid_object (
"set_property");
118 err_invalid_object (
"get_property");
123 err_invalid_object (
"break_closure_cycles");
127 subsref (
const std::string&,
const std::list<octave_value_list>&,
130 err_invalid_object (
"subsref");
134 subsasgn (
const std::string&,
const std::list<octave_value_list>&,
137 err_invalid_object (
"subsasgn");
142 virtual bool is_valid (
void)
const {
return false; }
144 OCTINTERP_API std::string
class_name (
void)
const;
148 err_invalid_object (
"mark_for_construction");
153 err_invalid_object (
"is_constructed_for");
158 err_invalid_object (
"is_partially_constructed_for");
163 err_invalid_object (
"mark_as_constructed");
168 err_invalid_object (
"mark_as_constructed");
173 err_invalid_object (
"is_constructed");
197 error (
"%s: invalid object", who);
291 subsref (
const std::string& type,
const std::list<octave_value_list>& idx,
292 int nargout, std::size_t& skip,
const cdef_class& context,
293 bool auto_add =
false)
295 return m_rep->
subsref (type, idx, nargout, skip, context, auto_add);
299 subsasgn (
const std::string& type,
const std::list<octave_value_list>& idx,
421 subsref (
const std::string& type,
const std::list<octave_value_list>& idx,
422 int nargout, std::size_t& skip,
const cdef_class& context,
426 subsasgn (
const std::string& type,
const std::list<octave_value_list>& idx,
434 return tmp.
put (pname, pval);
442 return tmp.
get (pname);
477 m_map.assign (pname, val);
482 Cell val = m_map.contents (pname);
484 if (val.
numel () < 1)
485 error (
"get: unknown slot: %s", pname.c_str ());
494 error (
"invalid index");
503 error (
"invalid index");
509 subsref (
const std::string& type,
const std::list<octave_value_list>& idx,
510 int nargout, std::size_t& skip,
const cdef_class& context,
514 subsasgn (
const std::string& type,
const std::list<octave_value_list>& idx,
630 virtual bool is_class (
void)
const {
return false; }
640 const std::list<octave_value_list>& ,
643 error (
"subsref: invalid meta object");
690 const std::list<octave_value_list>& idx,
int nargout)
692 return get_rep ()->meta_subsref (type, idx, nargout);
699 return get_rep ()->meta_accepts_postfix_index (type);
class OCTINTERP_API cdef_object
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
bool is_array(void) const
void fill_empty_values(void)
Array< cdef_object > m_array
void set_property(octave_idx_type idx, const std::string &pname, const octave_value &pval)
cdef_object_array(const cdef_object_array &obj)
cdef_object_rep * clone(void) const
~cdef_object_array(void)=default
Array< cdef_object > array_value(void) const
octave_value get_property(octave_idx_type idx, const std::string &pname) const
bool is_valid(void) const
dim_vector dims(void) const
cdef_object_array(const Array< cdef_object > &a)
cdef_object_rep * empty_clone(void) const
cdef_object_base(const cdef_object_base &obj)
virtual bool is_valid(void) const
OCTINTERP_API void release(const cdef_object &obj)
virtual void break_closure_cycles(const std::shared_ptr< stack_frame > &)
virtual octave_value_list subsref(const std::string &, const std::list< octave_value_list > &, int, std::size_t &, const cdef_class &, bool)
virtual bool is_array(void) const
virtual void mark_as_constructed(const cdef_class &)
virtual void destroy(void)
virtual bool is_constructed_for(const cdef_class &) const
virtual void set_class(const cdef_class &)
virtual octave_idx_type static_count(void) const
virtual void set_property(octave_idx_type, const std::string &, const octave_value &)
virtual bool is_constructed(void) const
virtual octave_value get(const std::string &) const
virtual cdef_object_rep * empty_clone(void) const
virtual string_vector map_keys(void) const
virtual Array< cdef_object > array_value(void) const
virtual cdef_object_rep * clone(void) const
OCTINTERP_API std::string class_name(void) const
virtual octave_value get_property(octave_idx_type, const std::string &) const
virtual bool is_partially_constructed_for(const cdef_class &) const
virtual dim_vector dims(void) const
cdef_object_rep(const cdef_object_rep &)
virtual cdef_object_rep * copy(void) const
virtual bool is_handle_object(void) const
virtual void put(const std::string &, const octave_value &)
virtual cdef_object_rep * make_array(void) const
OCTAVE_NORETURN void err_invalid_object(const char *who) const
virtual bool is_value_object(void) const
virtual bool is_meta_object(void) const
virtual ~cdef_object_rep(void)=default
virtual void mark_for_construction(const cdef_class &)
virtual octave_value subsasgn(const std::string &, const std::list< octave_value_list > &, const octave_value &)
refcount< octave_idx_type > m_count
virtual void mark_as_constructed(void)
dim_vector dims(void) const
std::map< cdef_class, std::list< cdef_class > > m_ctor_list
void mark_as_constructed(void)
bool is_constructed(void) const
octave_value get_property(octave_idx_type idx, const std::string &pname) const
void put(const std::string &pname, const octave_value &val)
octave_value get(const std::string &pname) const
void set_property(octave_idx_type idx, const std::string &pname, const octave_value &pval)
cdef_object_scalar(const cdef_object_scalar &obj)
~cdef_object_scalar(void)=default
void break_closure_cycles(const std::shared_ptr< stack_frame > &frame)
void mark_as_constructed(const cdef_class &cls)
void mark_for_construction(const cdef_class &cls)
void mark_as_constructed(void)
OCTINTERP_API octave_map map_value(void) const
bool is_meta_object(void) const
cdef_object & operator=(const cdef_object &obj)
bool is_partially_constructed_for(const cdef_class &cls) const
cdef_object_rep * get_rep(void)
bool is_array(void) const
virtual ~cdef_object(void)
cdef_object empty_clone(void) const
void put(const std::string &pname, const octave_value &val)
void set_property(octave_idx_type idx, const std::string &pname, const octave_value &pval)
dim_vector dims(void) const
bool is_handle_object(void) const
cdef_object(const cdef_object &obj)
void set_class(const cdef_class &cls)
string_vector map_keys(void) const
const cdef_object_rep * get_rep(void) const
cdef_object copy(void) const
cdef_object make_array(void) const
std::string class_name(void) const
octave_value subsasgn(const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs, int ignore_copies=0)
OCTINTERP_API cdef_class get_class(void) const
cdef_object(cdef_object_rep *r)
bool is(const cdef_object &obj) const
void make_unique(int ignore_copies)
octave_value get(const std::string &pname) const
octave_value_list subsref(const std::string &type, const std::list< octave_value_list > &idx, int nargout, std::size_t &skip, const cdef_class &context, bool auto_add=false)
bool is_constructed_for(const cdef_class &cls) const
octave_value get_property(octave_idx_type idx, const std::string &pname) const
bool is_constructed(void) const
Array< cdef_object > array_value(void) const
cdef_object clone(void) const
bool is_value_object(void) const
Vector representing the dimensions (size) of an Array.
cdef_object_rep * copy(void) const
handle_cdef_object(const handle_cdef_object &obj)
cdef_object_rep * clone(void) const
bool is_valid(void) const
bool is_handle_object(void) const
cdef_object_rep * copy(void) const
value_cdef_object(const value_cdef_object &obj)
cdef_object_rep * clone(void) const
bool is_valid(void) const
bool is_value_object(void) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::string release(void)
void error(const char *fmt,...)