GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
cdef_class Class Reference

#include "ov-classdef.h"

Inheritance diagram for cdef_class:
Collaboration diagram for cdef_class:

Classes

class  cdef_class_rep
 

Public Types

enum  { property_normal, property_inherited, property_all }
 

Public Member Functions

 cdef_class (void)
 
 cdef_class (const std::string &nm, const std::list< cdef_class > &superclasses)
 
 cdef_class (const cdef_class &cls)
 
 cdef_class (const cdef_object &obj)
 
Array< cdef_objectarray_value (void) const
 
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
 
cdef_object empty_clone (void) const
 
cdef_method find_method (const std::string &nm, bool local=false)
 
cdef_property find_property (const std::string &nm)
 
octave_value get (const std::string &pname) const
 
cdef_class get_class (void) const
 
octave_functionget_constructor_function (void)
 
std::string get_directory (void) const
 
octave_functionget_method_function (const std::string &nm)
 
Cell get_methods (void)
 
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_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 (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
 
octave_map map_value (void) const
 
void mark_as_constructed (void)
 
void mark_as_constructed (const cdef_class &cls)
 
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_classoperator= (const cdef_class &cls)
 
void put (const std::string &pname, const octave_value &val)
 
void register_object (void)
 
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, size_t &skip, const cdef_class &context, bool auto_add=false)
 
void unregister_object (void)
 

Static Public Member Functions

static cdef_class make_meta_class (octave::interpreter &interp, octave::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_repget_rep (void)
 
const cdef_class_repget_rep (void) const
 

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 &)
 

Detailed Description

Definition at line 663 of file ov-classdef.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
property_normal 
property_inherited 
property_all 

Definition at line 944 of file ov-classdef.h.

Constructor & Destructor Documentation

◆ cdef_class() [1/4]

cdef_class::cdef_class ( void  )
inline

Definition at line 822 of file ov-classdef.h.

Referenced by cdef_object_base::get_class().

◆ cdef_class() [2/4]

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

Definition at line 825 of file ov-classdef.h.

References cdef_object::get_rep(), and nm.

◆ cdef_class() [3/4]

cdef_class::cdef_class ( const cdef_class cls)
inline

Definition at line 829 of file ov-classdef.h.

◆ cdef_class() [4/4]

cdef_class::cdef_class ( const cdef_object obj)
inline

Definition at line 832 of file ov-classdef.h.

References cdef_object::class_name(), and error().

Member Function Documentation

◆ array_value()

Array<cdef_object> cdef_object::array_value ( void  ) const
inlineinherited

Definition at line 264 of file ov-classdef.h.

References cdef_object_rep::array_value(), and cdef_object::rep.

◆ class_name()

std::string cdef_object::class_name ( void  ) const
inlineinherited

◆ clone()

cdef_object cdef_object::clone ( void  ) const
inlineinherited

◆ construct()

octave_value cdef_class::construct ( const octave_value_list args)
inline

Definition at line 917 of file ov-classdef.h.

References cdef_object::get_rep().

◆ construct_object()

cdef_object cdef_class::construct_object ( const octave_value_list args)
inline

Definition at line 920 of file ov-classdef.h.

References cdef_object::get_rep().

◆ copy()

cdef_object cdef_object::copy ( void  ) const
inlineinherited

◆ delete_object()

void cdef_class::delete_object ( const cdef_object obj)
inline

Definition at line 885 of file ov-classdef.h.

References cdef_object::get_rep().

◆ dims()

dim_vector cdef_object::dims ( void  ) const
inlineinherited

Definition at line 248 of file ov-classdef.h.

References cdef_object_rep::dims(), and cdef_object::rep.

◆ empty_clone()

cdef_object cdef_object::empty_clone ( void  ) const
inlineinherited

◆ 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

Definition at line 1300 of file ov-classdef.h.

References cdef_class::cdef_class_rep::find_property(), get_rep(), and nm.

Referenced by check_access(), and class_getConstant().

◆ get()

◆ get_class()

cdef_class cdef_object::get_class ( void  ) const
inlineinherited

◆ get_constructor_function()

octave_function* cdef_class::get_constructor_function ( void  )
inline

Definition at line 914 of file ov-classdef.h.

Referenced by octave::tree_classdef::make_meta_class().

◆ get_directory()

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

Definition at line 876 of file ov-classdef.h.

References cdef_object::get_rep().

◆ get_method_function()

octave_function * cdef_class::get_method_function ( const std::string nm)

Definition at line 2918 of file ov-classdef.cc.

◆ get_methods()

Cell cdef_class::get_methods ( void  )
inline

Definition at line 853 of file ov-classdef.h.

References cdef_object::get_rep().

Referenced by class_get_methods().

◆ get_name()

◆ get_names()

string_vector cdef_class::get_names ( void  )
inline

Definition at line 867 of file ov-classdef.h.

References cdef_object::get_rep().

◆ get_properties()

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

Definition at line 860 of file ov-classdef.h.

References cdef_object::get_rep(), and mode.

Referenced by class_get_properties().

◆ get_property()

octave_value cdef_object::get_property ( octave_idx_type  idx,
const std::string pname 
) const
inlineinherited

Definition at line 277 of file ov-classdef.h.

References cdef_object_rep::get_property(), pname, and cdef_object::rep.

◆ get_property_map()

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

Definition at line 864 of file ov-classdef.h.

References cdef_object::get_rep(), and mode.

◆ get_rep() [1/2]

◆ get_rep() [2/2]

const cdef_class_rep* cdef_class::get_rep ( void  ) const
inlineprivate

Definition at line 955 of file ov-classdef.h.

References cdef_object::get_rep().

◆ initialize_object()

void cdef_class::initialize_object ( cdef_object obj)
inline

Definition at line 923 of file ov-classdef.h.

References cdef_object::get_rep().

◆ install_method()

void cdef_class::install_method ( const cdef_method meth)
inline

Definition at line 850 of file ov-classdef.h.

References cdef_object::get_rep().

◆ install_property()

void cdef_class::install_property ( const cdef_property prop)
inline

Definition at line 857 of file ov-classdef.h.

References cdef_object::get_rep().

◆ is()

bool cdef_object::is ( const cdef_object obj) const
inlineinherited

Definition at line 318 of file ov-classdef.h.

References cdef_object::rep.

Referenced by is_method_executing().

◆ is_abstract()

bool cdef_class::is_abstract ( void  ) const
inline

Definition at line 869 of file ov-classdef.h.

References cdef_object::get_rep().

◆ is_array()

bool cdef_object::is_array ( void  ) const
inlineinherited

Definition at line 256 of file ov-classdef.h.

References cdef_object_rep::is_array(), and cdef_object::rep.

◆ is_builtin()

bool cdef_class::is_builtin ( void  ) const
inline

Definition at line 882 of file ov-classdef.h.

◆ is_class()

bool cdef_meta_object::is_class ( void  ) const
inlineinherited

Definition at line 637 of file ov-classdef.h.

References cdef_object::get_rep().

◆ is_constructed()

bool cdef_object::is_constructed ( void  ) const
inlineinherited

Definition at line 305 of file ov-classdef.h.

References cdef_object_rep::is_constructed(), and cdef_object::rep.

◆ is_constructed_for()

bool cdef_object::is_constructed_for ( const cdef_class cls) const
inlineinherited

Definition at line 307 of file ov-classdef.h.

References cdef_object_rep::is_constructed_for(), and cdef_object::rep.

◆ is_handle_class()

bool cdef_class::is_handle_class ( void  ) const
inline

Definition at line 932 of file ov-classdef.h.

References cdef_object::get_rep().

◆ is_handle_object()

bool cdef_object::is_handle_object ( void  ) const
inlineinherited

Definition at line 260 of file ov-classdef.h.

References cdef_object_rep::is_handle_object(), and cdef_object::rep.

◆ is_meta_class()

bool cdef_class::is_meta_class ( void  ) const
inline

Definition at line 937 of file ov-classdef.h.

References cdef_object::get_rep().

◆ is_meta_object()

bool cdef_object::is_meta_object ( void  ) const
inlineinherited

Definition at line 262 of file ov-classdef.h.

References cdef_object_rep::is_meta_object(), and cdef_object::rep.

◆ is_method()

bool cdef_meta_object::is_method ( void  ) const
inlineinherited

Definition at line 641 of file ov-classdef.h.

References cdef_object::get_rep().

Referenced by cdef_method::cdef_method().

◆ is_package()

bool cdef_meta_object::is_package ( void  ) const
inlineinherited

Definition at line 643 of file ov-classdef.h.

References cdef_object::get_rep().

Referenced by cdef_package::cdef_package().

◆ is_partially_constructed_for()

bool cdef_object::is_partially_constructed_for ( const cdef_class cls) const
inlineinherited

◆ is_property()

bool cdef_meta_object::is_property ( void  ) const
inlineinherited

Definition at line 639 of file ov-classdef.h.

References cdef_object::get_rep().

Referenced by cdef_property::cdef_property().

◆ is_sealed()

bool cdef_class::is_sealed ( void  ) const
inline

Definition at line 871 of file ov-classdef.h.

References cdef_object::get_rep().

◆ is_value_object()

bool cdef_object::is_value_object ( void  ) const
inlineinherited

Definition at line 258 of file ov-classdef.h.

References cdef_object_rep::is_value_object(), and cdef_object::rep.

◆ make_array()

cdef_object cdef_object::make_array ( void  ) const
inlineinherited

◆ make_meta_class()

cdef_class cdef_class::make_meta_class ( octave::interpreter interp,
octave::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 recusion 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 2620 of file ov-classdef.cc.

Referenced by octave::tree_classdef::make_meta_class().

◆ make_unique()

void cdef_object::make_unique ( int  ignore_copies)
inlineprotectedinherited

Definition at line 323 of file ov-classdef.h.

References cdef_object::clone(), cdef_object_rep::refcount, and cdef_object::rep.

Referenced by cdef_object::subsasgn().

◆ map_keys()

string_vector cdef_object::map_keys ( void  ) const
inlineinherited

Definition at line 294 of file ov-classdef.h.

References cdef_object_rep::map_keys(), and cdef_object::rep.

◆ map_value()

octave_map cdef_object::map_value ( void  ) const
inherited

Definition at line 1284 of file ov-classdef.cc.

◆ mark_as_constructed() [1/2]

void cdef_object::mark_as_constructed ( void  )
inlineinherited

Definition at line 313 of file ov-classdef.h.

References cdef_object_rep::mark_as_constructed(), and cdef_object::rep.

◆ mark_as_constructed() [2/2]

void cdef_object::mark_as_constructed ( const cdef_class cls)
inlineinherited

Definition at line 315 of file ov-classdef.h.

References cdef_object_rep::mark_as_constructed(), and cdef_object::rep.

◆ mark_as_handle_class()

void cdef_class::mark_as_handle_class ( void  )
inline

Definition at line 929 of file ov-classdef.h.

References cdef_object::get_rep().

Referenced by cdef_manager::make_class().

◆ mark_as_meta_class()

void cdef_class::mark_as_meta_class ( void  )
inline

Definition at line 935 of file ov-classdef.h.

References cdef_object::get_rep().

Referenced by cdef_manager::make_meta_class().

◆ mark_for_construction()

void cdef_object::mark_for_construction ( const cdef_class cls)
inlineinherited

Definition at line 302 of file ov-classdef.h.

References cdef_object_rep::mark_for_construction(), and cdef_object::rep.

◆ meta_accepts_postfix_index()

bool cdef_meta_object::meta_accepts_postfix_index ( char  type) const
inlineinherited

Definition at line 652 of file ov-classdef.h.

References cdef_object::get_rep(), and type.

◆ meta_release()

void cdef_meta_object::meta_release ( void  )
inlineinherited

Definition at line 650 of file ov-classdef.h.

References cdef_object::get_rep().

◆ meta_subsref()

octave_value_list cdef_meta_object::meta_subsref ( const std::string type,
const std::list< octave_value_list > &  idx,
int  nargout 
)
inlineinherited

Definition at line 646 of file ov-classdef.h.

References cdef_object::get_rep(), nargout(), and type.

◆ ok()

◆ operator=()

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

Definition at line 841 of file ov-classdef.h.

References cdef_object::operator=().

◆ put()

◆ register_object()

void cdef_class::register_object ( void  )
inline

Definition at line 939 of file ov-classdef.h.

References cdef_object::get_rep().

Referenced by cdef_object_base::register_object().

◆ run_constructor()

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

Definition at line 926 of file ov-classdef.h.

References cdef_object::get_rep().

◆ set_class()

void cdef_object::set_class ( const cdef_class cls)
inlineinherited

◆ set_directory()

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

Definition at line 873 of file ov-classdef.h.

References cdef_object::get_rep().

◆ set_property()

void cdef_object::set_property ( octave_idx_type  idx,
const std::string pname,
const octave_value pval 
)
inlineinherited

Definition at line 272 of file ov-classdef.h.

References pname, cdef_object::rep, and cdef_object_rep::set_property().

◆ subsasgn()

octave_value cdef_object::subsasgn ( const std::string type,
const std::list< octave_value_list > &  idx,
const octave_value rhs,
int  ignore_copies = 0 
)
inlineinherited

◆ subsref()

octave_value_list cdef_object::subsref ( const std::string type,
const std::list< octave_value_list > &  idx,
int  nargout,
size_t skip,
const cdef_class context,
bool  auto_add = false 
)
inlineinherited

◆ unregister_object()

void cdef_class::unregister_object ( void  )
inline

Definition at line 941 of file ov-classdef.h.

References cdef_object::get_rep().

Referenced by cdef_object_base::unregister_object().

Friends And Related Function 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 971 of file ov-classdef.h.

◆ operator<

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

Definition at line 976 of file ov-classdef.h.

◆ operator==

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

Definition at line 966 of file ov-classdef.h.


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