GNU Octave 10.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 
Loading...
Searching...
No Matches
cdef_class Class Reference

#include "cdef-class.h"

Inheritance diagram for cdef_class:
cdef_meta_object cdef_object

Public Types

enum  { property_normal , property_inherited , property_all }
 

Public Member Functions

 cdef_class ()
 
 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 ()=default
 
octave_value construct (const octave_value_list &args)
 
cdef_object construct_object (const octave_value_list &args)
 
void delete_object (const cdef_object &obj)
 
std::string file_name () const
 
void file_name (const std::string &nm)
 
cdef_method find_method (const std::string &nm, bool local=false)
 
cdef_property find_property (const std::string &nm)
 
octave_value get_constructor_function ()
 
std::string get_directory () const
 
octave_value get_method (const std::string &nm) const
 
octave_value get_method (int ln) const
 
octave_value get_method_function (const std::string &nm)
 
std::map< std::string, cdef_methodget_method_map (bool only_inherited=false, bool include_ctor=false)
 
Cell get_methods (bool include_ctor=false)
 
std::string get_name () const
 
string_vector get_names ()
 
Cell get_properties (int mode=property_normal)
 
std::map< property_key, cdef_propertyget_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_abstract () const
 
bool is_builtin () const
 
bool is_handle_class () const
 
bool is_meta_class () const
 
bool is_sealed () const
 
void mark_as_handle_class ()
 
void mark_as_meta_class ()
 
cdef_classoperator= (const cdef_class &cls)
 
void run_constructor (cdef_object &obj, const octave_value_list &args)
 
void set_directory (const std::string &dir)
 
- Public Member Functions inherited from cdef_meta_object
 cdef_meta_object ()
 
 cdef_meta_object (cdef_meta_object_rep *r)
 
 cdef_meta_object (const cdef_meta_object &obj)
 
 cdef_meta_object (const cdef_object &obj)
 
 ~cdef_meta_object ()=default
 
std::string doc_string () const
 
void doc_string (const std::string &txt)
 
bool is_class () const
 
bool is_method () const
 
bool is_package () const
 
bool is_property () const
 
bool meta_accepts_postfix_index (char type) const
 
void meta_release ()
 
octave_value_list meta_subsref (const std::string &type, const std::list< octave_value_list > &idx, int nargout)
 
cdef_meta_objectoperator= (const cdef_object &)=delete
 
- Public Member Functions inherited from cdef_object
 cdef_object ()
 
 cdef_object (cdef_object_rep *r)
 
 cdef_object (const cdef_object &obj)
 
virtual ~cdef_object ()
 
Array< cdef_objectarray_value () const
 
void break_closure_cycles (const std::shared_ptr< stack_frame > &frame)
 
std::string class_name () const
 
cdef_object clone () const
 
cdef_object copy () const
 
dim_vector dims () const
 
cdef_object empty_clone () const
 
octave_value get (const std::string &pname) const
 
cdef_class get_class () const
 
octave_value get_property (octave_idx_type idx, const std::string &pname) const
 
const cdef_object_repget_rep () const
 
bool is (const cdef_object &obj) const
 
bool is_array () const
 
bool is_constructed () const
 
bool is_constructed_for (const cdef_class &cls) const
 
bool is_handle_object () const
 
bool is_meta_object () const
 
bool is_partially_constructed_for (const cdef_class &cls) const
 
bool is_value_object () const
 
cdef_object make_array () const
 
string_vector map_keys () const
 
octave_map map_value () const
 
void mark_as_constructed ()
 
void mark_as_constructed (const cdef_class &cls)
 
void mark_for_construction (const cdef_class &cls)
 
bool ok () const
 
cdef_objectoperator= (const cdef_object &obj)
 
void put (const std::string &pname, const octave_value &val)
 
void set_class (const cdef_class &cls)
 
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 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.
 

Friends

void install_classdef (octave::interpreter &interp)
 
bool operator!= (const cdef_class &, const cdef_class &)
 
bool operator< (const cdef_class &, const cdef_class &)
 
bool operator== (const cdef_class &, const cdef_class &)
 

Additional Inherited Members

- Protected Member Functions inherited from cdef_object
cdef_object_repget_rep ()
 
void make_unique (int ignore_copies)
 

Detailed Description

Definition at line 58 of file cdef-class.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
property_normal 
property_inherited 
property_all 

Definition at line 419 of file cdef-class.h.

Constructor & Destructor Documentation

◆ cdef_class() [1/4]

cdef_class::cdef_class ( )
inline

Definition at line 247 of file cdef-class.h.

◆ cdef_class() [2/4]

cdef_class::cdef_class ( const std::string &  nm,
const std::list< cdef_class > &  superclasses 
)
inline

Definition at line 249 of file cdef-class.h.

◆ cdef_class() [3/4]

cdef_class::cdef_class ( const cdef_class cls)
inline

Definition at line 256 of file cdef-class.h.

◆ cdef_class() [4/4]

cdef_class::cdef_class ( const cdef_object obj)
inline

Definition at line 258 of file cdef-class.h.

References error().

◆ ~cdef_class()

cdef_class::~cdef_class ( )
default

Member Function Documentation

◆ construct()

octave_value cdef_class::construct ( const octave_value_list args)
inline

Definition at line 379 of file cdef-class.h.

◆ construct_object()

cdef_object cdef_class::construct_object ( const octave_value_list args)
inline

Definition at line 384 of file cdef-class.h.

Referenced by cdef_object_array::subsasgn().

◆ delete_object()

void cdef_class::delete_object ( const cdef_object obj)
inline

Definition at line 333 of file cdef-class.h.

Referenced by cdef_object_rep::release().

◆ file_name() [1/2]

std::string cdef_class::file_name ( ) const
inline

Definition at line 415 of file cdef-class.h.

◆ file_name() [2/2]

void cdef_class::file_name ( const std::string &  nm)
inline

Definition at line 413 of file cdef-class.h.

Referenced by make_meta_class().

◆ find_method()

cdef_method cdef_class::find_method ( const std::string &  nm,
bool  local = false 
)
inline

◆ find_property()

cdef_property cdef_class::find_property ( const std::string &  nm)
inline

◆ get_constructor_function()

octave_value cdef_class::get_constructor_function ( )
inline

Definition at line 374 of file cdef-class.h.

Referenced by cdef_manager::cdef_manager(), and tree_classdef::make_meta_class().

◆ get_directory()

std::string cdef_class::get_directory ( ) const
inline

Definition at line 324 of file cdef-class.h.

◆ get_method() [1/2]

octave_value cdef_class::get_method ( const std::string &  nm) const
inline

Definition at line 362 of file cdef-class.h.

Referenced by cdef_manager::find_method().

◆ get_method() [2/2]

octave_value cdef_class::get_method ( int  ln) const
inline

Definition at line 367 of file cdef-class.h.

◆ get_method_function()

octave_value cdef_class::get_method_function ( const std::string &  nm)

Definition at line 1297 of file cdef-class.cc.

◆ get_method_map()

std::map< std::string, cdef_method > cdef_class::get_method_map ( bool  only_inherited = false,
bool  include_ctor = false 
)
inline

Definition at line 290 of file cdef-class.h.

Referenced by F__methods__().

◆ get_methods()

Cell cdef_class::get_methods ( bool  include_ctor = false)
inline

Definition at line 284 of file cdef-class.h.

Referenced by make_meta_class().

◆ get_name()

◆ get_names()

string_vector cdef_class::get_names ( )
inline

Definition at line 313 of file cdef-class.h.

Referenced by cdef_object_rep::map_keys().

◆ get_properties()

Cell cdef_class::get_properties ( int  mode = property_normal)
inline

Definition at line 302 of file cdef-class.h.

◆ get_property_map()

std::map< property_key, cdef_property > cdef_class::get_property_map ( int  mode = property_normal)
inline

Definition at line 308 of file cdef-class.h.

Referenced by Fproperties(), and cdef_object::map_value().

◆ initialize_object()

void cdef_class::initialize_object ( cdef_object obj)
inline

Definition at line 389 of file cdef-class.h.

◆ install_method()

void cdef_class::install_method ( const cdef_method meth)
inline

Definition at line 279 of file cdef-class.h.

Referenced by cdef_manager::cdef_manager(), and make_meta_class().

◆ install_property()

void cdef_class::install_property ( const cdef_property prop)
inline

Definition at line 297 of file cdef-class.h.

Referenced by cdef_manager::cdef_manager(), and make_meta_class().

◆ is_abstract()

bool cdef_class::is_abstract ( ) const
inline

Definition at line 315 of file cdef-class.h.

◆ is_builtin()

bool cdef_class::is_builtin ( ) const
inline

Definition at line 331 of file cdef-class.h.

Referenced by cdef_manager::find_class().

◆ is_handle_class()

bool cdef_class::is_handle_class ( ) const
inline

Definition at line 404 of file cdef-class.h.

◆ is_meta_class()

bool cdef_class::is_meta_class ( ) const
inline

Definition at line 411 of file cdef-class.h.

◆ is_sealed()

bool cdef_class::is_sealed ( ) const
inline

Definition at line 317 of file cdef-class.h.

◆ make_meta_class()

cdef_class cdef_class::make_meta_class ( interpreter interp,
tree_classdef t,
bool  is_at_folder = false 
)
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

classdef recursion_class
methods (Access = ?recursion_class)
endmethods
endclassdef

will fail because each attempt to compute the metaclass of recursion_class will cause recursion_class to be parsed again.

Definition at line 971 of file cdef-class.cc.

References __get_cdef_manager__(), tree_classdef::attribute_list(), tree_classdef::body(), octave_value::bool_value(), cdef_object::class_name(), tree_classdef::doc_string(), cdef_meta_object::doc_string(), error(), tree_expression::evaluate(), tree_classdef::file_name(), file_name(), Array< T, Alloc >::find(), find_method(), cdef_manager::find_package(), octave_value::function_value(), cdef_object::get(), interpreter::get_evaluator(), interpreter::get_load_path(), get_methods(), tree_classdef::ident(), install_method(), install_property(), lookup_class(), cdef_manager::make_class(), make_function_of_class(), cdef_manager::make_method(), cdef_manager::make_property(), tree_classdef_body::method_list(), load_path::methods(), octave_function::name(), tree_identifier::name(), cdef_object::ok(), tree_classdef::package_name(), tree_evaluator::pop_scope(), tree_classdef_body::property_list(), tree_evaluator::push_dummy_scope(), cdef_object::put(), octave_user_function::stash_function_name(), tree_classdef::superclass_list(), and to_ov().

Referenced by tree_classdef::make_meta_class().

◆ mark_as_handle_class()

void cdef_class::mark_as_handle_class ( )
inline

Definition at line 399 of file cdef-class.h.

Referenced by cdef_manager::make_class().

◆ mark_as_meta_class()

void cdef_class::mark_as_meta_class ( )
inline

Definition at line 409 of file cdef-class.h.

Referenced by cdef_manager::make_meta_class().

◆ operator=()

cdef_class & cdef_class::operator= ( const cdef_class cls)
inline

Definition at line 267 of file cdef-class.h.

References cdef_object::operator=().

◆ run_constructor()

void cdef_class::run_constructor ( cdef_object obj,
const octave_value_list args 
)
inline

Definition at line 394 of file cdef-class.h.

◆ set_directory()

void cdef_class::set_directory ( const std::string &  dir)
inline

Definition at line 319 of file cdef-class.h.

Friends And Related Symbol Documentation

◆ install_classdef

void install_classdef ( octave::interpreter &  interp)
friend

◆ operator!=

bool operator!= ( const cdef_class clsa,
const cdef_class clsb 
)
friend

Definition at line 454 of file cdef-class.h.

◆ operator<

bool operator< ( const cdef_class clsa,
const cdef_class clsb 
)
friend

Definition at line 461 of file cdef-class.h.

◆ operator==

bool operator== ( const cdef_class clsa,
const cdef_class clsb 
)
friend

Definition at line 446 of file cdef-class.h.


The documentation for this class was generated from the following files: