Rcpp Version 1.1.2
Loading...
Searching...
No Matches
class_< Class > Class Template Reference

#include <class.h>

Inheritance diagram for class_< Class >:
Collaboration diagram for class_< Class >:

Classes

class  CppProperty_Getter_Setter
class  CppProperty_Getter

Public Types

typedef class_< Class > self
typedef CppMethod< Class > method_class
typedef SignedMethod< Class > signed_method_class
typedef std::vector< signed_method_class * > vec_signed_method
typedef std::map< std::string, vec_signed_method * > map_vec_signed_method
typedef std::pair< std::string, vec_signed_method * > vec_signed_method_pair
typedef std::map< std::string, method_class * > METHOD_MAP
typedef std::pair< const std::string, method_class * > PAIR
typedef Rcpp::XPtr< Class > XP
typedef CppFinalizer< Class > finalizer_class
typedef Constructor_Base< Class > constructor_class
typedef SignedConstructor< Class > signed_constructor_class
typedef std::vector< signed_constructor_class * > vec_signed_constructor
typedef Factory_Base< Class > factory_class
typedef SignedFactory< Class > signed_factory_class
typedef std::vector< signed_factory_class * > vec_signed_factory
typedef CppProperty< Class > prop_class
typedef std::map< std::string, prop_class * > PROPERTY_MAP
typedef std::pair< const std::string, prop_class * > PROP_PAIR

Public Member Functions

 class_ (const char *name_, const char *doc=0)
 ~class_ ()
selfAddConstructor (constructor_class *ctor, ValidConstructor valid, const char *docstring=0)
selfAddFactory (factory_class *fact, ValidConstructor valid, const char *docstring=0)
selfdefault_constructor (const char *docstring=0, ValidConstructor valid=&yes_arity< 0 >)
template<typename... T>
selfconstructor (const char *docstring=0, ValidConstructor valid=&yes_arity< sizeof...(T)>)
template<typename... T>
selffactory (Class *(*fun)(T...), const char *docstring=0, ValidConstructor valid=&yes_arity< sizeof...(T)>)
std::string get_typeinfo_name ()
SEXP newInstance (SEXP *args, int nargs)
bool has_default_constructor ()
SEXP invoke (SEXP method_xp, SEXP object, SEXP *args, int nargs)
SEXP invoke_void (SEXP method_xp, SEXP object, SEXP *args, int nargs)
SEXP invoke_notvoid (SEXP method_xp, SEXP object, SEXP *args, int nargs)
selfAddMethod (const char *name_, method_class *m, ValidMethod valid=&yes, const char *docstring=0)
selfAddProperty (const char *name_, prop_class *p)
template<typename RESULT_TYPE, typename... T>
selfmethod (const char *name_, RESULT_TYPE(Class::*fun)(T...), const char *docstring=0, ValidMethod valid=&yes_arity< sizeof...(T)>)
template<typename RESULT_TYPE, typename... T>
selfmethod (const char *name_, RESULT_TYPE(Class::*fun)(T...) const, const char *docstring=0, ValidMethod valid=&yes_arity< sizeof...(T)>)
template<typename RESULT_TYPE, typename... T>
selfnonconst_method (const char *name_, RESULT_TYPE(Class::*fun)(T...), const char *docstring=0, ValidMethod valid=&yes_arity< sizeof...(T)>)
template<typename RESULT_TYPE, typename... T>
selfconst_method (const char *name_, RESULT_TYPE(Class::*fun)(T...) const, const char *docstring=0, ValidMethod valid=&yes_arity< sizeof...(T)>)
template<typename RESULT_TYPE, typename... T>
selfmethod (const char *name_, RESULT_TYPE(*fun)(Class *, T...), const char *docstring=0, ValidMethod valid=&yes_arity< sizeof...(T)>)
template<typename RESULT_TYPE, typename... T>
selfconst_method (const char *name_, RESULT_TYPE(*fun)(const Class *, T...), const char *docstring=0, ValidMethod valid=&yes_arity< sizeof...(T)>)
bool has_method (const std::string &m)
bool has_property (const std::string &m)
bool property_is_readonly (const std::string &p)
std::string property_class (const std::string &p)
Rcpp::CharacterVector method_names ()
Rcpp::IntegerVector methods_arity ()
Rcpp::LogicalVector methods_voidness ()
Rcpp::CharacterVector property_names ()
Rcpp::List property_classes ()
Rcpp::CharacterVector complete ()
SEXP getProperty (SEXP field_xp, SEXP object)
void setProperty (SEXP field_xp, SEXP object, SEXP value)
Rcpp::List fields (const XP_Class &class_xp)
Rcpp::List getMethods (const XP_Class &class_xp, std::string &buffer)
Rcpp::List getConstructors (const XP_Class &class_xp, std::string &buffer)
template<typename T>
selffield (const char *name_, T Class::*ptr, const char *docstring=0)
template<typename T>
selffield_readonly (const char *name_, T Class::*ptr, const char *docstring=0)
template<typename PROP>
selfproperty (const char *name_, PROP(Class::*GetMethod)(void), const char *docstring=0)
template<typename PROP>
selfproperty (const char *name_, PROP(Class::*GetMethod)(void) const, const char *docstring=0)
template<typename PROP>
selfproperty (const char *name_, PROP(*GetMethod)(Class *), const char *docstring)
template<typename PROP>
selfproperty (const char *name_, PROP(Class::*GetMethod)(void), void(Class::*SetMethod)(PROP), const char *docstring=0)
template<typename PROP>
selfproperty (const char *name_, PROP(Class::*GetMethod)(void) const, void(Class::*SetMethod)(PROP), const char *docstring=0)
template<typename PROP>
selfproperty (const char *name_, PROP(Class::*GetMethod)(void), void(*SetMethod)(Class *, PROP), const char *docstring=0)
template<typename PROP>
selfproperty (const char *name_, PROP(Class::*GetMethod)(void) const, void(*SetMethod)(Class *, PROP), const char *docstring=0)
template<typename PROP>
selfproperty (const char *name_, PROP(*GetMethod)(Class *), void(Class::*SetMethod)(PROP), const char *docstring=0)
template<typename PROP>
selfproperty (const char *name_, PROP(*GetMethod)(Class *), void(*SetMethod)(Class *, PROP), const char *docstring=0)
selffinalizer (void(*f)(Class *))
virtual void run_finalizer (SEXP object)
void SetFinalizer (finalizer_class *f)
 class_ ()
template<typename PARENT>
selfderives (const char *parent)

Public Attributes

map_vec_signed_method vec_methods
PROPERTY_MAP properties
finalizer_classfinalizer_pointer
int specials
vec_signed_constructor constructors
vec_signed_factory factories
selfclass_pointer
std::string typeinfo_name

Private Member Functions

selfget_instance ()

Detailed Description

template<typename Class>
class class_< Class >

Definition at line 25 of file class.h.

Member Typedef Documentation

◆ constructor_class

template<typename Class>
typedef Constructor_Base<Class> class_< Class >::constructor_class

Definition at line 41 of file class.h.

◆ factory_class

template<typename Class>
typedef Factory_Base<Class> class_< Class >::factory_class

Definition at line 45 of file class.h.

◆ finalizer_class

template<typename Class>
typedef CppFinalizer<Class> class_< Class >::finalizer_class

Definition at line 39 of file class.h.

◆ map_vec_signed_method

template<typename Class>
typedef std::map<std::string,vec_signed_method*> class_< Class >::map_vec_signed_method

Definition at line 32 of file class.h.

◆ method_class

template<typename Class>
typedef CppMethod<Class> class_< Class >::method_class

Definition at line 28 of file class.h.

◆ METHOD_MAP

template<typename Class>
typedef std::map<std::string,method_class*> class_< Class >::METHOD_MAP

Definition at line 35 of file class.h.

◆ PAIR

template<typename Class>
typedef std::pair<const std::string,method_class*> class_< Class >::PAIR

Definition at line 36 of file class.h.

◆ prop_class

template<typename Class>
typedef CppProperty<Class> class_< Class >::prop_class

Definition at line 49 of file class.h.

◆ PROP_PAIR

template<typename Class>
typedef std::pair<const std::string,prop_class*> class_< Class >::PROP_PAIR

Definition at line 51 of file class.h.

◆ PROPERTY_MAP

template<typename Class>
typedef std::map<std::string,prop_class*> class_< Class >::PROPERTY_MAP

Definition at line 50 of file class.h.

◆ self

template<typename Class>
typedef class_<Class> class_< Class >::self

Definition at line 27 of file class.h.

◆ signed_constructor_class

template<typename Class>
typedef SignedConstructor<Class> class_< Class >::signed_constructor_class

Definition at line 42 of file class.h.

◆ signed_factory_class

template<typename Class>
typedef SignedFactory<Class> class_< Class >::signed_factory_class

Definition at line 46 of file class.h.

◆ signed_method_class

template<typename Class>
typedef SignedMethod<Class> class_< Class >::signed_method_class

Definition at line 30 of file class.h.

◆ vec_signed_constructor

template<typename Class>
typedef std::vector<signed_constructor_class*> class_< Class >::vec_signed_constructor

Definition at line 43 of file class.h.

◆ vec_signed_factory

template<typename Class>
typedef std::vector<signed_factory_class*> class_< Class >::vec_signed_factory

Definition at line 47 of file class.h.

◆ vec_signed_method

template<typename Class>
typedef std::vector<signed_method_class*> class_< Class >::vec_signed_method

Definition at line 31 of file class.h.

◆ vec_signed_method_pair

template<typename Class>
typedef std::pair<std::string,vec_signed_method*> class_< Class >::vec_signed_method_pair

Definition at line 33 of file class.h.

◆ XP

template<typename Class>
typedef Rcpp::XPtr<Class> class_< Class >::XP

Definition at line 38 of file class.h.

Constructor & Destructor Documentation

◆ class_() [1/2]

template<typename Class>
class_< Class >::class_ ( const char * name_,
const char * doc = 0 )
inline

Definition at line 53 of file class.h.

Referenced by derives(), and property().

◆ ~class_()

template<typename Class>
class_< Class >::~class_ ( )
inline

Definition at line 97 of file class.h.

◆ class_() [2/2]

template<typename Class>
class_< Class >::class_ ( )
inline

Definition at line 522 of file class.h.

References constructors, factories, properties, specials, and vec_methods.

Member Function Documentation

◆ AddConstructor()

template<typename Class>
self & class_< Class >::AddConstructor ( constructor_class * ctor,
ValidConstructor valid,
const char * docstring = 0 )
inline

Definition at line 99 of file class.h.

References class_pointer.

Referenced by constructor().

◆ AddFactory()

template<typename Class>
self & class_< Class >::AddFactory ( factory_class * fact,
ValidConstructor valid,
const char * docstring = 0 )
inline

Definition at line 104 of file class.h.

References class_pointer.

Referenced by factory().

◆ AddMethod()

template<typename Class>
self & class_< Class >::AddMethod ( const char * name_,
method_class * m,
ValidMethod valid = &yes,
const char * docstring = 0 )
inline

Definition at line 246 of file class.h.

References get_instance(), RCPP_DEBUG_MODULE_1, specials, and vec_methods.

Referenced by const_method(), const_method(), derives(), method(), method(), method(), and nonconst_method().

Here is the call graph for this function:

◆ AddProperty()

template<typename Class>
self & class_< Class >::AddProperty ( const char * name_,
prop_class * p )
inline

Definition at line 258 of file class.h.

References get_instance(), and properties.

Referenced by derives().

Here is the call graph for this function:

◆ complete()

template<typename Class>
Rcpp::CharacterVector class_< Class >::complete ( )
inline

Definition at line 409 of file class.h.

References properties, specials, and vec_methods.

◆ const_method() [1/2]

template<typename Class>
template<typename RESULT_TYPE, typename... T>
self & class_< Class >::const_method ( const char * name_,
RESULT_TYPE(* fun )(const Class *, T...),
const char * docstring = 0,
ValidMethod valid = &yes_arity<sizeof...(T)> )
inline

Definition at line 294 of file class.h.

References AddMethod().

Here is the call graph for this function:

◆ const_method() [2/2]

template<typename Class>
template<typename RESULT_TYPE, typename... T>
self & class_< Class >::const_method ( const char * name_,
RESULT_TYPE(Class::* fun )(T...) const,
const char * docstring = 0,
ValidMethod valid = &yes_arity<sizeof...(T)> )
inline

Definition at line 282 of file class.h.

References AddMethod().

Here is the call graph for this function:

◆ constructor()

template<typename Class>
template<typename... T>
self & class_< Class >::constructor ( const char * docstring = 0,
ValidConstructor valid = &yes_arity<sizeof...(T)> )
inline

Definition at line 114 of file class.h.

References AddConstructor().

Referenced by default_constructor().

Here is the call graph for this function:

◆ default_constructor()

template<typename Class>
self & class_< Class >::default_constructor ( const char * docstring = 0,
ValidConstructor valid = &yes_arity<0> )
inline

Definition at line 109 of file class.h.

References constructor().

Here is the call graph for this function:

◆ derives()

template<typename Class>
template<typename PARENT>
self & class_< Class >::derives ( const char * parent)
inline

Definition at line 528 of file class.h.

References AddMethod(), AddProperty(), class_(), get_instance(), getCurrentScope(), and method().

Here is the call graph for this function:

◆ factory()

template<typename Class>
template<typename... T>
self & class_< Class >::factory ( Class *(* fun )(T...),
const char * docstring = 0,
ValidConstructor valid = &yes_arity<sizeof...(T)> )
inline

Definition at line 119 of file class.h.

References AddFactory().

Here is the call graph for this function:

◆ field()

template<typename Class>
template<typename T>
self & class_< Class >::field ( const char * name_,
T Class::* ptr,
const char * docstring = 0 )
inline

Definition at line 69 of file class.h.

◆ field_readonly()

template<typename Class>
template<typename T>
self & class_< Class >::field_readonly ( const char * name_,
T Class::* ptr,
const char * docstring = 0 )
inline

Definition at line 77 of file class.h.

References class_pointer.

◆ fields()

template<typename Class>
Rcpp::List class_< Class >::fields ( const XP_Class & class_xp)
inline

Definition at line 450 of file class.h.

References Rcpp::NamesProxyPolicy< CLASS >::names(), and properties.

Here is the call graph for this function:

◆ finalizer()

template<typename Class>
self & class_< Class >::finalizer ( void(* )(Class *))
inline

Definition at line 496 of file class.h.

References SetFinalizer().

Here is the call graph for this function:

◆ get_instance()

template<typename Class>
self * class_< Class >::get_instance ( )
inlineprivate

Definition at line 69 of file class.h.

Referenced by AddMethod(), AddProperty(), derives(), and SetFinalizer().

◆ get_typeinfo_name()

template<typename Class>
std::string class_< Class >::get_typeinfo_name ( )
inline

Definition at line 126 of file class.h.

References typeinfo_name.

◆ getConstructors()

template<typename Class>
Rcpp::List class_< Class >::getConstructors ( const XP_Class & class_xp,
std::string & buffer )
inline

Definition at line 482 of file class.h.

References constructors.

◆ getMethods()

template<typename Class>
Rcpp::List class_< Class >::getMethods ( const XP_Class & class_xp,
std::string & buffer )
inline

Definition at line 463 of file class.h.

References Rcpp::NamesProxyPolicy< CLASS >::names(), RCPP_DEBUG_MODULE, and vec_methods.

Here is the call graph for this function:

◆ getProperty()

template<typename Class>
SEXP class_< Class >::getProperty ( SEXP field_xp,
SEXP object )
inline

Definition at line 435 of file class.h.

References BEGIN_RCPP, and END_RCPP.

◆ has_default_constructor()

template<typename Class>
bool class_< Class >::has_default_constructor ( )
inline

Definition at line 158 of file class.h.

References constructors, and factories.

◆ has_method()

template<typename Class>
bool class_< Class >::has_method ( const std::string & m)
inline

Definition at line 300 of file class.h.

References vec_methods.

◆ has_property()

template<typename Class>
bool class_< Class >::has_property ( const std::string & m)
inline

Definition at line 303 of file class.h.

References properties.

◆ invoke()

template<typename Class>
SEXP class_< Class >::invoke ( SEXP method_xp,
SEXP object,
SEXP * args,
int nargs )
inline

Definition at line 174 of file class.h.

References BEGIN_RCPP, Rcpp::Vector< VECSXP >::create(), and END_RCPP.

Here is the call graph for this function:

◆ invoke_notvoid()

template<typename Class>
SEXP class_< Class >::invoke_notvoid ( SEXP method_xp,
SEXP object,
SEXP * args,
int nargs )
inline

Definition at line 223 of file class.h.

References BEGIN_RCPP, and END_RCPP.

◆ invoke_void()

template<typename Class>
SEXP class_< Class >::invoke_void ( SEXP method_xp,
SEXP object,
SEXP * args,
int nargs )
inline

Definition at line 201 of file class.h.

References BEGIN_RCPP, and END_RCPP.

◆ method() [1/3]

template<typename Class>
template<typename RESULT_TYPE, typename... T>
self & class_< Class >::method ( const char * name_,
RESULT_TYPE(* fun )(Class *, T...),
const char * docstring = 0,
ValidMethod valid = &yes_arity<sizeof...(T)> )
inline

Definition at line 288 of file class.h.

References AddMethod().

Here is the call graph for this function:

◆ method() [2/3]

template<typename Class>
template<typename RESULT_TYPE, typename... T>
self & class_< Class >::method ( const char * name_,
RESULT_TYPE(Class::* fun )(T...) const,
const char * docstring = 0,
ValidMethod valid = &yes_arity<sizeof...(T)> )
inline

Definition at line 270 of file class.h.

References AddMethod().

Here is the call graph for this function:

◆ method() [3/3]

template<typename Class>
template<typename RESULT_TYPE, typename... T>
self & class_< Class >::method ( const char * name_,
RESULT_TYPE(Class::* fun )(T...),
const char * docstring = 0,
ValidMethod valid = &yes_arity<sizeof...(T)> )
inline

Definition at line 264 of file class.h.

References AddMethod().

Referenced by derives().

Here is the call graph for this function:

◆ method_names()

template<typename Class>
Rcpp::CharacterVector class_< Class >::method_names ( )
inline

Definition at line 317 of file class.h.

References vec_methods.

◆ methods_arity()

template<typename Class>
Rcpp::IntegerVector class_< Class >::methods_arity ( )
inline

Definition at line 337 of file class.h.

References Rcpp::NamesProxyPolicy< CLASS >::names(), and vec_methods.

Here is the call graph for this function:

◆ methods_voidness()

template<typename Class>
Rcpp::LogicalVector class_< Class >::methods_voidness ( )
inline

Definition at line 361 of file class.h.

References Rcpp::NamesProxyPolicy< CLASS >::names(), and vec_methods.

Here is the call graph for this function:

◆ newInstance()

template<typename Class>
SEXP class_< Class >::newInstance ( SEXP * args,
int nargs )
inline

Definition at line 130 of file class.h.

References BEGIN_RCPP, constructors, END_RCPP, and factories.

◆ nonconst_method()

template<typename Class>
template<typename RESULT_TYPE, typename... T>
self & class_< Class >::nonconst_method ( const char * name_,
RESULT_TYPE(Class::* fun )(T...),
const char * docstring = 0,
ValidMethod valid = &yes_arity<sizeof...(T)> )
inline

Definition at line 276 of file class.h.

References AddMethod().

Here is the call graph for this function:

◆ property() [1/9]

template<typename Class>
template<typename PROP>
self & class_< Class >::property ( const char * name_,
PROP(* GetMethod )(Class *),
const char * docstring )
inline

Definition at line 39 of file class.h.

◆ property() [2/9]

template<typename Class>
template<typename PROP>
self & class_< Class >::property ( const char * name_,
PROP(* GetMethod )(Class *),
void(* SetMethod )(Class *, PROP),
const char * docstring = 0 )
inline

Definition at line 90 of file class.h.

◆ property() [3/9]

template<typename Class>
template<typename PROP>
self & class_< Class >::property ( const char * name_,
PROP(* GetMethod )(Class *),
void(Class::* SetMethod )(PROP),
const char * docstring = 0 )
inline

Definition at line 82 of file class.h.

◆ property() [4/9]

template<typename Class>
template<typename PROP>
self & class_< Class >::property ( const char * name_,
PROP(Class::* GetMethod )(void) const,
const char * docstring = 0 )
inline

Definition at line 33 of file class.h.

◆ property() [5/9]

template<typename Class>
template<typename PROP>
self & class_< Class >::property ( const char * name_,
PROP(Class::* GetMethod )(void) const,
void(* SetMethod )(Class *, PROP),
const char * docstring = 0 )
inline

Definition at line 72 of file class.h.

References class_pointer, DEMANGLE, and RCPP_DEBUG_MODULE_2.

◆ property() [6/9]

template<typename Class>
template<typename PROP>
self & class_< Class >::property ( const char * name_,
PROP(Class::* GetMethod )(void) const,
void(Class::* SetMethod )(PROP),
const char * docstring = 0 )
inline

Definition at line 54 of file class.h.

◆ property() [7/9]

template<typename Class>
template<typename PROP>
self & class_< Class >::property ( const char * name_,
PROP(Class::* GetMethod )(void),
const char * docstring = 0 )
inline

Definition at line 27 of file class.h.

References class_().

Here is the call graph for this function:

◆ property() [8/9]

template<typename Class>
template<typename PROP>
self & class_< Class >::property ( const char * name_,
PROP(Class::* GetMethod )(void),
void(* SetMethod )(Class *, PROP),
const char * docstring = 0 )
inline

Definition at line 64 of file class.h.

◆ property() [9/9]

template<typename Class>
template<typename PROP>
self & class_< Class >::property ( const char * name_,
PROP(Class::* GetMethod )(void),
void(Class::* SetMethod )(PROP),
const char * docstring = 0 )
inline

Definition at line 46 of file class.h.

◆ property_class()

template<typename Class>
std::string class_< Class >::property_class ( const std::string & p)
inline

Definition at line 311 of file class.h.

References properties.

◆ property_classes()

template<typename Class>
Rcpp::List class_< Class >::property_classes ( )
inline

Definition at line 396 of file class.h.

References Rcpp::NamesProxyPolicy< CLASS >::names(), and properties.

Here is the call graph for this function:

◆ property_is_readonly()

template<typename Class>
bool class_< Class >::property_is_readonly ( const std::string & p)
inline

Definition at line 306 of file class.h.

References properties.

◆ property_names()

template<typename Class>
Rcpp::CharacterVector class_< Class >::property_names ( )
inline

Definition at line 386 of file class.h.

References properties.

◆ run_finalizer()

template<typename Class>
virtual void class_< Class >::run_finalizer ( SEXP object)
inlinevirtual

Definition at line 501 of file class.h.

References finalizer_pointer.

◆ SetFinalizer()

template<typename Class>
void class_< Class >::SetFinalizer ( finalizer_class * f)
inline

Definition at line 505 of file class.h.

References finalizer_pointer, and get_instance().

Referenced by finalizer().

Here is the call graph for this function:

◆ setProperty()

template<typename Class>
void class_< Class >::setProperty ( SEXP field_xp,
SEXP object,
SEXP value )
inline

Definition at line 442 of file class.h.

References BEGIN_RCPP, and VOID_END_RCPP.

Member Data Documentation

◆ class_pointer

template<typename Class>
self* class_< Class >::class_pointer

◆ constructors

template<typename Class>
vec_signed_constructor class_< Class >::constructors

◆ factories

template<typename Class>
vec_signed_factory class_< Class >::factories

◆ finalizer_pointer

template<typename Class>
finalizer_class* class_< Class >::finalizer_pointer

◆ properties

◆ specials

template<typename Class>
int class_< Class >::specials

◆ typeinfo_name

template<typename Class>
std::string class_< Class >::typeinfo_name

◆ vec_methods


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