26#if ! defined (octave_cdef_property_h)
27#define octave_cdef_property_h 1
29#include "octave-config.h"
69 std::string
get_name (
void)
const {
return get(
"Name").string_value (); }
71 void set_name (
const std::string& nm) { put (
"Name", nm); }
73 bool is_constant (
void)
const {
return get(
"Constant").bool_value (); }
76 const std::string& who =
"")
const;
79 bool do_check_access =
true,
80 const std::string& who =
"")
const;
83 bool do_check_access =
true,
84 const std::string& who =
"");
86 OCTINTERP_API
bool check_get_access (
void)
const;
88 OCTINTERP_API
bool check_set_access (
void)
const;
95 OCTINTERP_API
bool is_recursive_set (
const cdef_object& obj)
const;
103 OCTINTERP_API OCTAVE_NORETURN
104 void err_property_access (
const std::string& from,
105 bool is_set =
false)
const;
115 get_rep ()->set_name (nm);
124 if (! is_property ())
125 error (
"internal error: invalid assignment from %s to meta.property object",
126 class_name ().c_str ());
139 const std::string& who =
"")
const
141 return get_rep ()->get_value (obj, do_check_access, who);
145 const std::string& who =
"")
const
147 return get_rep ()->get_value (do_check_access, who);
151 bool do_check_access =
true,
152 const std::string& who =
"")
154 get_rep ()->set_value (obj, val, do_check_access, who);
159 return get_rep ()->check_get_access ();
164 return get_rep ()->check_set_access ();
167 std::string
get_name (
void)
const {
return get_rep ()->get_name (); }
169 bool is_constant (
void)
const {
return get_rep ()->is_constant (); }
cdef_object & operator=(const cdef_object &obj)
const cdef_object_rep * get_rep(void) const
std::string get_name(void) const
cdef_property_rep(const cdef_property_rep &p)
cdef_object_rep * copy(void) const
bool is_property(void) const
~cdef_property_rep(void)=default
void set_name(const std::string &nm)
bool is_constant(void) const
bool check_get_access(void) const
void set_value(cdef_object &obj, const octave_value &val, bool do_check_access=true, const std::string &who="")
cdef_property(const std::string &nm)
cdef_property_rep * get_rep(void)
octave_value get_value(const cdef_object &obj, bool do_check_access=true, const std::string &who="") const
octave_value get_value(bool do_check_access=true, const std::string &who="") const
bool is_constant(void) const
cdef_property(const cdef_property &prop)
bool check_set_access(void) const
~cdef_property(void)=default
cdef_property(const cdef_object &obj)
const cdef_property_rep * get_rep(void) const
std::string get_name(void) const
void error(const char *fmt,...)