#include "cdef-class.h"
Classes | |
class | cdef_class_rep |
Public Types | |
enum | { property_normal , property_inherited , property_all } |
Public Member Functions | |
cdef_class (const cdef_class &cls) | |
cdef_class (const cdef_object &obj) | |
cdef_class (const std::string &nm, const std::list< cdef_class > &superclasses) | |
cdef_class (void) | |
~cdef_class (void)=default | |
Array< cdef_object > | array_value (void) const |
void | break_closure_cycles (const std::shared_ptr< stack_frame > &frame) |
std::string | class_name (void) const |
cdef_object | clone (void) const |
octave_value | construct (const octave_value_list &args) |
cdef_object | construct_object (const octave_value_list &args) |
cdef_object | copy (void) const |
void | delete_object (const cdef_object &obj) |
dim_vector | dims (void) const |
void | doc_string (const std::string &txt) |
std::string | doc_string (void) const |
cdef_object | empty_clone (void) const |
void | file_name (const std::string &nm) |
std::string | file_name (void) const |
OCTINTERP_API cdef_method | find_method (const std::string &nm, bool local=false) |
OCTINTERP_API cdef_property | find_property (const std::string &nm) |
octave_value | get (const std::string &pname) const |
OCTINTERP_API cdef_class | get_class (void) const |
octave_value | get_constructor_function (void) |
std::string | get_directory (void) const |
octave_value | get_method (const std::string &nm) const |
OCTINTERP_API octave_value | get_method_function (const std::string &nm) |
std::map< std::string, cdef_method > | get_method_map (bool only_inherited=false, bool include_ctor=false) |
Cell | get_methods (bool include_ctor=false) |
std::string | get_name (void) const |
string_vector | get_names (void) |
Cell | get_properties (int mode=property_normal) |
octave_value | get_property (octave_idx_type idx, const std::string &pname) const |
std::map< std::string, cdef_property > | get_property_map (int mode=property_normal) |
void | initialize_object (cdef_object &obj) |
void | install_method (const cdef_method &meth) |
void | install_property (const cdef_property &prop) |
bool | is (const cdef_object &obj) const |
bool | is_abstract (void) const |
bool | is_array (void) const |
bool | is_builtin (void) const |
bool | is_class (void) const |
bool | is_constructed (void) const |
bool | is_constructed_for (const cdef_class &cls) const |
bool | is_handle_class (void) const |
bool | is_handle_object (void) const |
bool | is_meta_class (void) const |
bool | is_meta_object (void) const |
bool | is_method (void) const |
bool | is_package (void) const |
bool | is_partially_constructed_for (const cdef_class &cls) const |
bool | is_property (void) const |
bool | is_sealed (void) const |
bool | is_value_object (void) const |
cdef_object | make_array (void) const |
string_vector | map_keys (void) const |
OCTINTERP_API octave_map | map_value (void) const |
void | mark_as_constructed (const cdef_class &cls) |
void | mark_as_constructed (void) |
void | mark_as_handle_class (void) |
void | mark_as_meta_class (void) |
void | mark_for_construction (const cdef_class &cls) |
bool | meta_accepts_postfix_index (char type) const |
void | meta_release (void) |
octave_value_list | meta_subsref (const std::string &type, const std::list< octave_value_list > &idx, int nargout) |
bool | ok (void) const |
cdef_class & | operator= (const cdef_class &cls) |
void | put (const std::string &pname, const octave_value &val) |
void | run_constructor (cdef_object &obj, const octave_value_list &args) |
void | set_class (const cdef_class &cls) |
void | set_directory (const std::string &dir) |
void | set_property (octave_idx_type idx, const std::string &pname, const octave_value &pval) |
octave_value | subsasgn (const std::string &type, const std::list< octave_value_list > &idx, const octave_value &rhs, int ignore_copies=0) |
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) |
Static Public Member Functions | |
static OCTINTERP_API cdef_class | make_meta_class (interpreter &interp, tree_classdef *t, bool is_at_folder=false) |
Analyze the tree_classdef tree and transform it to a cdef_class. More... | |
Protected Member Functions | |
void | make_unique (int ignore_copies) |
Private Member Functions | |
cdef_class_rep * | get_rep (void) |
const cdef_class_rep * | get_rep (void) const |
Private Attributes | |
cdef_object_rep * | m_rep |
Friends | |
OCTINTERP_API void | install_classdef (interpreter &interp) |
OCTINTERP_API bool | operator!= (const cdef_class &, const cdef_class &) |
OCTINTERP_API bool | operator< (const cdef_class &, const cdef_class &) |
OCTINTERP_API bool | operator== (const cdef_class &, const cdef_class &) |
Definition at line 51 of file cdef-class.h.
anonymous enum |
Enumerator | |
---|---|
property_normal | |
property_inherited | |
property_all |
Definition at line 410 of file cdef-class.h.
|
inline |
Definition at line 240 of file cdef-class.h.
|
inline |
Definition at line 242 of file cdef-class.h.
|
inline |
Definition at line 248 of file cdef-class.h.
|
inline |
Definition at line 250 of file cdef-class.h.
References error().
|
default |
|
inlineinherited |
Definition at line 259 of file cdef-object.h.
Referenced by octave::cdef_object::map_value(), and octave::cdef_object_array::subsasgn().
|
inlineinherited |
Definition at line 283 of file cdef-object.h.
|
inlineinherited |
Definition at line 233 of file cdef-object.h.
Referenced by make_meta_class(), octave::cdef_object_array::subsasgn(), and octave::ctor_analyzer::visit_superclass_ref().
|
inlineinherited |
Definition at line 235 of file cdef-object.h.
References octave::cdef_object.
|
inline |
Definition at line 366 of file cdef-class.h.
Referenced by octave::cdef_class::cdef_class_rep::meta_subsref().
|
inline |
Definition at line 371 of file cdef-class.h.
Referenced by octave::cdef_class::cdef_class_rep::construct(), octave::cdef_object_array::fill_empty_values(), and octave::cdef_object_array::subsasgn().
|
inlineinherited |
Definition at line 249 of file cdef-object.h.
References octave::cdef_object.
Referenced by octave::cdef_object_array::fill_empty_values().
|
inline |
Definition at line 325 of file cdef-class.h.
Referenced by octave::cdef_class::cdef_class_rep::delete_object(), and octave::cdef_object_rep::release().
|
inlineinherited |
Definition at line 242 of file cdef-object.h.
|
inline |
Definition at line 400 of file cdef-class.h.
Referenced by octave_classdef_meta::doc_string(), and make_meta_class().
|
inline |
Definition at line 402 of file cdef-class.h.
|
inlineinherited |
Definition at line 237 of file cdef-object.h.
References octave::cdef_object.
|
inline |
Definition at line 404 of file cdef-class.h.
Referenced by octave_classdef_meta::file_name(), and make_meta_class().
|
inline |
Definition at line 406 of file cdef-class.h.
|
inline |
Definition at line 459 of file cdef-class.h.
References octave::cdef_class::cdef_class_rep::find_method(), and get_rep().
Referenced by octave::check_access(), octave::class_fevalStatic(), octave::cdef_class::cdef_class_rep::delete_object(), octave_classdef_meta::doc_string(), octave_classdef_superclass_ref::execute(), octave::cdef_class::cdef_class_rep::find_method(), octave::cdef_manager::find_method_symbol(), make_meta_class(), octave::cdef_class::cdef_class_rep::meta_subsref(), octave::cdef_class::cdef_class_rep::run_constructor(), octave_classdef::size(), octave_classdef::subsasgn(), octave_classdef::subsref(), octave::cdef_object_scalar::subsref(), and octave_classdef::xnumel().
|
inline |
Definition at line 465 of file cdef-class.h.
References octave::cdef_class::cdef_class_rep::find_property(), and get_rep().
Referenced by octave::check_access(), octave::class_getConstant(), octave::cdef_class::cdef_class_rep::find_property(), octave::cdef_class::cdef_class_rep::meta_subsref(), octave::cdef_object_scalar::subsasgn(), and octave::cdef_object_scalar::subsref().
|
inlineinherited |
Definition at line 266 of file cdef-object.h.
Referenced by octave::check_access(), octave::cdef_method::cdef_method_rep::check_access(), octave::cdef_property::cdef_property_rep::check_get_access(), octave::cdef_property::cdef_property_rep::check_set_access(), octave::class_get_inferiorclasses(), octave::class_get_superclasses(), octave::cdef_class::cdef_class_rep::delete_object(), octave::err_method_access(), octave::cdef_property::cdef_property_rep::err_property_access(), octave::cdef_method::cdef_method_rep::execute(), octave::cdef_class::cdef_class_rep::find_method(), octave::cdef_class::cdef_class_rep::find_methods(), octave::cdef_class::cdef_class_rep::find_names(), octave::cdef_class::cdef_class_rep::find_properties(), octave::cdef_class::cdef_class_rep::find_property(), octave::cdef_object_array::get_property(), octave::cdef_property::cdef_property_rep::get_value(), octave::cdef_class::cdef_class_rep::initialize_object(), octave::is_superclass(), make_meta_class(), octave::cdef_object_scalar::mark_for_construction(), octave_classdef::print_raw(), octave::property_get_defaultvalue(), and octave::cdef_property::cdef_property_rep::set_value().
|
inherited |
Definition at line 183 of file cdef-object.cc.
References octave::cdef_object_rep::get_class(), and octave::cdef_object::m_rep.
Referenced by octave_classdef::is_instance_of(), octave::cdef_object::map_value(), octave_classdef::print_raw(), octave_classdef::size(), octave::cdef_object_array::subsasgn(), octave_classdef::subsasgn(), octave_classdef::subsref(), and octave_classdef::xnumel().
|
inline |
Definition at line 361 of file cdef-class.h.
Referenced by octave::cdef_manager::cdef_manager(), and octave::tree_classdef::make_meta_class().
|
inline |
Definition at line 316 of file cdef-class.h.
|
inline |
Definition at line 354 of file cdef-class.h.
Referenced by octave::cdef_manager::find_method().
octave_value octave::cdef_class::get_method_function | ( | const std::string & | nm | ) |
Definition at line 1170 of file cdef-class.cc.
References octave_value().
|
inline |
Definition at line 282 of file cdef-class.h.
Definition at line 276 of file cdef-class.h.
Referenced by octave::class_get_methods(), and make_meta_class().
|
inline |
Definition at line 321 of file cdef-class.h.
Referenced by octave::handle_cdef_object::~handle_cdef_object(), octave::value_cdef_object::~value_cdef_object(), octave::check_access(), octave::cdef_object_rep::class_name(), octave::cdef_class::cdef_class_rep::construct_object(), octave::cdef_class::cdef_class_rep::delete_object(), octave_classdef_superclass_ref::execute(), octave::cdef_property::cdef_property_rep::get_value(), octave_classdef_meta::is_classdef_constructor(), octave::make_function_of_class(), octave::cdef_manager::make_method(), octave::cdef_manager::make_property(), octave::cdef_object_scalar::mark_for_construction(), octave::cdef_manager::register_class(), octave::cdef_class::cdef_class_rep::run_constructor(), octave::cdef_property::cdef_property_rep::set_value(), octave::cdef_manager::unregister_class(), and octave_classdef::xnumel().
|
inline |
Definition at line 305 of file cdef-class.h.
Referenced by octave::cdef_object_rep::map_keys().
|
inline |
Definition at line 294 of file cdef-class.h.
Referenced by octave::class_get_properties().
|
inlineinherited |
Definition at line 278 of file cdef-object.h.
|
inline |
Definition at line 300 of file cdef-class.h.
Referenced by octave::cdef_class::cdef_class_rep::get_properties(), octave::cdef_object::map_value(), and octave_classdef::print_raw().
|
inlineprivate |
Definition at line 419 of file cdef-class.h.
References octave::cdef_object::get_rep().
Referenced by find_method(), octave::cdef_class::cdef_class_rep::find_methods(), octave::cdef_class::cdef_class_rep::find_names(), octave::cdef_class::cdef_class_rep::find_properties(), and find_property().
|
inlineprivate |
Definition at line 424 of file cdef-class.h.
References octave::cdef_object::get_rep().
|
inline |
Definition at line 376 of file cdef-class.h.
Referenced by octave::cdef_class::cdef_class_rep::construct_object().
|
inline |
Definition at line 271 of file cdef-class.h.
Referenced by octave::cdef_manager::cdef_manager(), and make_meta_class().
|
inline |
Definition at line 289 of file cdef-class.h.
Referenced by octave::cdef_manager::cdef_manager(), and make_meta_class().
|
inlineinherited |
Definition at line 334 of file cdef-object.h.
References octave::cdef_object::m_rep.
Referenced by octave::is_method_executing(), and octave::cdef_object_array::subsasgn().
|
inline |
Definition at line 307 of file cdef-class.h.
Referenced by octave::cdef_class::cdef_class_rep::construct_object().
|
inlineinherited |
Definition at line 251 of file cdef-object.h.
Referenced by octave::cdef_object::map_value(), octave_classdef::print_raw(), and octave::cdef_object_array::subsasgn().
|
inline |
Definition at line 323 of file cdef-class.h.
Referenced by octave::cdef_manager::find_class().
|
inlineinherited |
Definition at line 678 of file cdef-object.h.
Referenced by octave_classdef_meta::doc_string(), octave_classdef_meta::file_name(), and octave_classdef_meta::is_classdef_constructor().
|
inlineinherited |
Definition at line 317 of file cdef-object.h.
Referenced by octave::cdef_property::cdef_property_rep::get_value(), and octave::cdef_property::cdef_property_rep::set_value().
|
inlineinherited |
Definition at line 319 of file cdef-object.h.
|
inline |
Definition at line 391 of file cdef-class.h.
Referenced by octave::cdef_class::cdef_class_rep::construct_object().
|
inlineinherited |
Definition at line 255 of file cdef-object.h.
Referenced by octave::cdef_property::cdef_property_rep::set_value().
|
inline |
Definition at line 398 of file cdef-class.h.
Referenced by octave::cdef_class::cdef_class_rep::construct_object().
|
inlineinherited |
Definition at line 257 of file cdef-object.h.
|
inlineinherited |
Definition at line 682 of file cdef-object.h.
Referenced by octave_classdef_meta::is_classdef_method().
|
inlineinherited |
Definition at line 684 of file cdef-object.h.
Referenced by octave_classdef_meta::is_package().
|
inlineinherited |
Definition at line 324 of file cdef-object.h.
Referenced by octave::cdef_property::cdef_property_rep::get_value(), and octave::cdef_property::cdef_property_rep::set_value().
|
inlineinherited |
Definition at line 680 of file cdef-object.h.
|
inline |
Definition at line 309 of file cdef-class.h.
|
inlineinherited |
Definition at line 253 of file cdef-object.h.
|
inlineinherited |
Definition at line 244 of file cdef-object.h.
References octave::cdef_object.
Referenced by octave_classdef::undef_subsasgn().
|
static |
Analyze the tree_classdef tree and transform it to a cdef_class.
All attribute validation should occur here.
Classdef attribute values can be given in the form of expressions. These expressions must be evaluated before assigning them as attribute values. Evaluating them as they are parsed causes trouble with possible recursion in the parser so we do it here. For example
will fail because each attempt to compute the metaclass of recursion_class will cause recursion_class to be parsed again.
Definition at line 846 of file cdef-class.cc.
References octave::__get_cdef_manager__(), octave::tree_classdef::attribute_list(), octave::attribute_value_to_string(), octave::tree_classdef::body(), octave_value::bool_value(), octave::cdef_object::class_name(), octave::compute_attribute_value(), doc_string(), octave::tree_classdef::doc_string(), error(), octave::tree_expression::evaluate(), file_name(), octave::tree_classdef::file_name(), Array< T, Alloc >::find(), find_method(), octave::cdef_manager::find_package(), octave_value::function_value(), octave::cdef_object::get(), interpreter::get_evaluator(), interpreter::get_load_path(), get_methods(), octave::tree_classdef::ident(), install_method(), install_property(), octave::lookup_class(), octave::cdef_manager::make_class(), octave::make_fcn_handle(), octave::make_function_of_class(), octave::cdef_manager::make_method(), octave::cdef_manager::make_property(), load_path::methods(), octave::tree_classdef_body::methods_list(), octave_function::name(), octave::tree_identifier::name(), octave::cdef_object::ok(), octave::tree_classdef::package_name(), tree_evaluator::pop_scope(), octave::tree_classdef_body::properties_list(), tree_evaluator::push_dummy_scope(), octave::cdef_object::put(), octave_user_function::stash_function_name(), octave::tree_classdef::superclass_list(), and octave::to_ov().
Referenced by octave::tree_classdef::make_meta_class().
|
inlineprotectedinherited |
Definition at line 340 of file cdef-object.h.
|
inlineinherited |
Definition at line 304 of file cdef-object.h.
|
inherited |
Definition at line 137 of file cdef-object.cc.
References octave::cdef_object::array_value(), Array< T, Alloc >::dims(), octave::cdef_object::get_class(), get_property_map(), octave::cdef_object::is_array(), Array< T, Alloc >::numel(), octave::cdef_object::ok(), property_all, octave_map::setfield(), and warning_with_id().
|
inlineinherited |
Definition at line 331 of file cdef-object.h.
|
inlineinherited |
Definition at line 329 of file cdef-object.h.
Referenced by octave::cdef_class::cdef_class_rep::run_constructor().
|
inline |
Definition at line 386 of file cdef-class.h.
Referenced by octave::cdef_manager::make_class().
|
inline |
Definition at line 396 of file cdef-class.h.
Referenced by octave::cdef_manager::make_meta_class().
|
inlineinherited |
Definition at line 312 of file cdef-object.h.
Referenced by octave::cdef_class::cdef_class_rep::initialize_object().
|
inlineinherited |
Definition at line 695 of file cdef-object.h.
Referenced by octave_classdef_meta::accepts_postfix_index().
|
inlineinherited |
Definition at line 693 of file cdef-object.h.
Referenced by octave_classdef_meta::~octave_classdef_meta().
|
inlineinherited |
Definition at line 687 of file cdef-object.h.
Referenced by octave_classdef_meta::subsref().
|
inlineinherited |
Definition at line 310 of file cdef-object.h.
Referenced by octave::check_access(), octave::class_fevalStatic(), octave::class_getConstant(), octave::cdef_class::cdef_class_rep::construct(), octave::cdef_class::cdef_class_rep::construct_object(), octave::cdef_class::cdef_class_rep::delete_object(), octave_classdef_meta::doc_string(), octave_classdef_superclass_ref::execute(), octave::cdef_object_array::fill_empty_values(), octave::cdef_manager::find_class(), octave::cdef_class::cdef_class_rep::find_method(), octave::cdef_manager::find_method_symbol(), octave::cdef_manager::find_package(), octave::cdef_manager::find_package_symbol(), octave::cdef_class::cdef_class_rep::find_property(), in_class_method(), octave_classdef::is_instance_of(), octave::tree_classdef::make_meta_class(), make_meta_class(), octave::cdef_object_rep::map_keys(), octave::cdef_object::map_value(), octave::cdef_class::cdef_class_rep::meta_subsref(), octave_classdef::print_raw(), read_mat5_binary_element(), octave::cdef_class::cdef_class_rep::run_constructor(), octave::cdef_object_base::set_class(), octave_classdef::size(), octave::cdef_object_array::subsasgn(), octave::cdef_object_scalar::subsasgn(), octave_classdef::subsasgn(), octave_classdef::subsref(), octave::cdef_object_scalar::subsref(), octave::to_ov(), octave::ctor_analyzer::visit_superclass_ref(), and octave_classdef::xnumel().
|
inline |
Definition at line 259 of file cdef-class.h.
References octave::cdef_object::operator=().
|
inlineinherited |
Definition at line 261 of file cdef-object.h.
Referenced by octave::cdef_class::cdef_class_rep::initialize_object(), octave::cdef_manager::make_class(), octave::cdef_manager::make_meta_class(), make_meta_class(), octave::cdef_manager::make_method(), octave::cdef_manager::make_package(), octave::cdef_manager::make_property(), octave::cdef_object_array::set_property(), and octave::cdef_property::cdef_property_rep::set_value().
|
inline |
Definition at line 381 of file cdef-class.h.
Referenced by octave::cdef_class::cdef_class_rep::construct_object(), octave_classdef_superclass_ref::execute(), and octave::cdef_class::cdef_class_rep::run_constructor().
|
inlineinherited |
Definition at line 231 of file cdef-object.h.
Referenced by octave::cdef_manager::cdef_manager(), octave::cdef_class::cdef_class_rep::construct_object(), octave::cdef_manager::make_class(), octave::cdef_manager::make_method(), octave::cdef_manager::make_package(), octave::cdef_manager::make_property(), octave::cdef_object_scalar::subsasgn(), octave::cdef_object_array::subsref(), and octave::cdef_object_scalar::subsref().
|
inline |
Definition at line 311 of file cdef-class.h.
|
inlineinherited |
Definition at line 271 of file cdef-object.h.
|
inlineinherited |
Definition at line 297 of file cdef-object.h.
Referenced by octave::cdef_object_array::subsasgn(), octave::cdef_object_scalar::subsasgn(), and octave_classdef::subsasgn().
|
inlineinherited |
Definition at line 289 of file cdef-object.h.
Referenced by octave_classdef::subsref(), and octave::cdef_object_scalar::subsref().
|
friend |
|
friend |
Definition at line 445 of file cdef-class.h.
|
friend |
Definition at line 452 of file cdef-class.h.
|
friend |
Definition at line 437 of file cdef-class.h.
|
privateinherited |
Definition at line 348 of file cdef-object.h.
Referenced by octave::cdef_object::get_class(), octave::cdef_object::is(), and octave::cdef_object::operator=().