Rcpp Version 1.0.7
Module.h
Go to the documentation of this file.
1 // -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 //
3 // Module.h: Rcpp R/C++ interface class library -- Rcpp modules
4 //
5 // Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois
6 //
7 // This file is part of Rcpp.
8 //
9 // Rcpp is free software: you can redistribute it and/or modify it
10 // under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 2 of the License, or
12 // (at your option) any later version.
13 //
14 // Rcpp is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
21 
22 #ifndef Rcpp_Module_h
23 #define Rcpp_Module_h
24 
25 #include <Rcpp/config.h>
26 
27 namespace Rcpp{
28 
29  namespace internal{
30 
31  template <typename FROM, typename TO>
32  std::string get_converter_name(const char* from, const char* to){
33  std::string method_name( ".___converter___" ) ;
36  method_name += "Rcpp_" ;
37  }
38  method_name += from ;
39  method_name += "___" ;
42  method_name += "Rcpp_" ;
43  }
44  method_name += to ;
45 
46  return method_name ;
47  }
48 
49 
50  }
51 
52  class CppClass ;
53  class CppObject ;
54 
55  template <typename T>
56  class result {
57  public:
58  result( T* ptr_ ) : ptr(ptr_){}
59  operator T*(){ return ptr ; }
60  private:
61  T* ptr;
62  } ;
63 
64  template <typename T>
65  class object {
66  public:
67  typedef T object_type ;
68  object( T* ptr_ ) : ptr(ptr_){}
69  operator T*(){ return ptr ; }
70  T* operator->(){ return ptr ; }
71  T& operator&(){ return *ptr ; }
72  T* ptr ;
73  } ;
74 
75  namespace internal {
76  template <typename Class>
77  SEXP make_new_object( Class* ptr ){
78  Rcpp::XPtr<Class> xp( ptr, true ) ;
79  Function maker = Environment::Rcpp_namespace()[ "cpp_object_maker"] ;
80  return maker( typeid(Class).name() , xp ) ;
81  }
82  }
83 
84 }
85 
88 #include <Rcpp/module/Module_generated_get_signature.h>
89 
90  // templates CppFunction0, ..., CppFunction65
91 #include <Rcpp/module/Module_generated_CppFunction.h>
92 #include <Rcpp/module/class_Base.h>
93 #include <Rcpp/module/Module.h>
94 
95 namespace Rcpp{
96 
97  template <typename Class>
98  class CppMethod {
99  public:
101 
103  virtual SEXP operator()(Class* /*object*/, SEXP* /*args*/) { return R_NilValue ; }
104  virtual ~CppMethod(){}
105  virtual int nargs(){ return 0 ; }
106  virtual bool is_void(){ return false ; }
107  virtual bool is_const(){ return false ; }
108  virtual void signature(std::string& s, const char* name ){ s = name ; }
109  } ;
110 
111  template <typename Class, typename Parent>
112  class CppInheritedMethod : public CppMethod<Class> {
113  public:
116 
117  CppInheritedMethod( ParentMethod* parent_method_pointer_ ) :
118  parent_method_pointer(parent_method_pointer_)
119  {}
120 
121  SEXP operator()( Class* object, SEXP* args){
122  return (*parent_method_pointer)( (Parent*)object, args ) ;
123  }
124  inline int nargs(){ return parent_method_pointer->nargs() ; }
125  inline bool is_void(){ return parent_method_pointer->is_void() ; }
126  inline bool is_const(){ return parent_method_pointer->is_const() ; }
127  inline void signature(std::string& s, const char* name){ return parent_method_pointer->signature(s, name) ; }
128 
129  private:
131  } ;
132 
133 #include <Rcpp/module/Module_generated_ctor_signature.h>
134 #include <Rcpp/module/Module_generated_Constructor.h>
135 #include <Rcpp/module/Module_generated_Factory.h>
136 
137 #include <Rcpp/module/Module_generated_class_signature.h>
138 
139  typedef bool (*ValidConstructor)(SEXP*,int) ;
140  typedef bool (*ValidMethod)(SEXP*,int) ;
141 
142  template <typename Class>
144  public:
145 
147  Constructor_Base<Class>* ctor_,
148  ValidConstructor valid_,
149  const char* doc
150  ) : ctor(ctor_), valid(valid_), docstring(doc == 0 ? "" : doc){}
151 
152  Constructor_Base<Class>* ctor ;
154  std::string docstring ;
155 
156  inline int nargs(){ return ctor->nargs() ; }
157  inline void signature(std::string& buffer, const std::string& class_name){
158  ctor->signature(buffer, class_name) ;
159  }
160  } ;
161 
162  template <typename Class>
164  public:
165 
167  Factory_Base<Class>* fact_,
168  ValidConstructor valid_,
169  const char* doc
170  ) : fact(fact_), valid(valid_), docstring(doc == 0 ? "" : doc){}
171 
172  Factory_Base<Class>* fact ;
174  std::string docstring ;
175 
176  inline int nargs(){ return fact->nargs() ; }
177  inline void signature(std::string& buffer, const std::string& class_name){
178  fact->signature(buffer, class_name) ;
179  }
180  } ;
181 
182 
183  template <typename Class>
184  class SignedMethod {
185  public:
187  SignedMethod( METHOD* m, ValidMethod valid_, const char* doc ) : method(m), valid(valid_), docstring(doc == 0 ? "" : doc) {}
188 
191  std::string docstring ;
192 
193  inline int nargs(){ return method->nargs() ; }
194  inline bool is_void(){ return method->is_void() ; }
195  inline bool is_const(){ return method->is_const() ; }
196  inline void signature(std::string& s, const char* name){
197  method->signature(s, name);
198  }
199 
200  } ;
201 
202  template <typename Class>
203  class S4_CppConstructor : public Reference {
204  typedef Reference Base;
205  public:
207  typedef Reference::Storage Storage ;
208 
209  S4_CppConstructor( SignedConstructor<Class>* m, const XP_Class& class_xp, const std::string& class_name, std::string& buffer ) : Reference( "C++Constructor" ){
210  RCPP_DEBUG( "S4_CppConstructor( SignedConstructor<Class>* m, SEXP class_xp, const std::string& class_name, std::string& buffer" ) ;
211  field( "pointer" ) = Rcpp::XPtr< SignedConstructor<Class> >( m, false ) ;
212  field( "class_pointer" ) = class_xp ;
213  field( "nargs" ) = m->nargs() ;
214  m->signature( buffer, class_name ) ;
215  field( "signature" ) = buffer ;
216  field( "docstring" ) = m->docstring ;
217  }
218 
220 
221  } ;
222 
223  template <typename Class>
226  public:
229  typedef std::vector<signed_method_class*> vec_signed_method ;
230 
231  S4_CppOverloadedMethods( vec_signed_method* m, const XP_Class& class_xp, const char* name, std::string& buffer ) : Reference( "C++OverloadedMethods" ){
232  int n = m->size() ;
233  Rcpp::LogicalVector voidness(n), constness(n) ;
234  Rcpp::CharacterVector docstrings(n), signatures(n) ;
235  Rcpp::IntegerVector nargs(n) ;
236  signed_method_class* met ;
237  for( int i=0; i<n; i++){
238  met = m->at(i) ;
239  nargs[i] = met->nargs() ;
240  voidness[i] = met->is_void() ;
241  constness[i] = met->is_const() ;
242  docstrings[i] = met->docstring ;
243  met->signature(buffer, name) ;
244  signatures[i] = buffer ;
245  }
246 
247  field( "pointer" ) = Rcpp::XPtr< vec_signed_method >( m, false ) ;
248  field( "class_pointer" ) = class_xp ;
249  field( "size" ) = n ;
250  field( "void" ) = voidness ;
251  field( "const" ) = constness ;
252  field( "docstrings" ) = docstrings ;
253  field( "signatures" ) = signatures ;
254  field( "nargs" ) = nargs ;
255 
256  }
257 
259 
260  } ;
261 
262 #include <Rcpp/module/Module_generated_CppMethod.h>
263 #include <Rcpp/module/Module_generated_Pointer_CppMethod.h>
264 
265  template <typename Class>
266  class CppProperty {
267  public:
269 
270  CppProperty(const char* doc = 0) : docstring( doc == 0 ? "" : doc ) {} ;
271  virtual ~CppProperty(){} ;
272  virtual SEXP get(Class* ) { throw std::range_error("cannot retrieve property"); }
273  virtual void set(Class*, SEXP) { throw std::range_error("cannot set property"); }
274  virtual bool is_readonly(){ return false; }
275  virtual std::string get_class(){ return ""; }
276 
277  std::string docstring ;
278  } ;
279 
280  template <typename Class, typename Parent>
281  class CppInheritedProperty : public CppProperty<Class> {
282  public:
284 
286  Base( parent_property_->docstring.c_str() ),
287  parent_property(parent_property_)
288  {}
289 
290  SEXP get( Class* obj ){ return parent_property->get( (Parent*)obj ) ; }
291  void set( Class* obj, SEXP s) { parent_property->set( (Parent*)obj, s ) ; }
293  std::string get_class(){ return parent_property->get_class() ; }
294 
295  private:
297  } ;
298 
299  template <typename Class>
301  public:
303  virtual void run(Class* ){} ;
304  } ;
305 
306  template <typename Class>
307  class FunctionFinalizer : public CppFinalizer<Class> {
308  public:
309  typedef void (*Pointer)(Class*) ;
311 
312  virtual void run(Class* object){
313  finalizer( object ) ;
314  }
315 
316  private:
318  } ;
319 
320  template <typename Class>
321  class S4_field : public Rcpp::Reference {
323  public:
325  S4_field( CppProperty<Class>* p, const XP_Class& class_xp ) : Reference( "C++Field" ){
326  RCPP_DEBUG( "S4_field( CppProperty<Class>* p, const XP_Class& class_xp )" )
327  field( "read_only" ) = p->is_readonly() ;
328  field( "cpp_class" ) = p->get_class();
329  field( "pointer" ) = Rcpp::XPtr< CppProperty<Class> >( p, false ) ;
330  field( "class_pointer" ) = class_xp ;
331  field( "docstring" ) = p->docstring ;
332  }
333 
335 
336  } ;
337 
339 
340 #include <Rcpp/module/class.h>
341 
342  template <typename Enum, typename Parent>
343  class enum_ {
344  public:
346 
347  enum_( const char* name_ ) :
348  name(name_), values(), parent_typeinfo_name( typeid(Parent).name() ){
349  }
351  Rcpp::Module* module = getCurrentScope() ;
353  }
354 
355  self& value( const char* name_, Enum value_ ){
356  values.insert( PAIR( name_, static_cast<int>( value_ ) ) ) ;
357  return *this ;
358  }
359 
360  private:
361 
362  std::string name ;
363  typedef std::map< std::string, int > MAP ;
364  typedef MAP::value_type PAIR ;
366  std::string parent_typeinfo_name ;
367 
368  } ;
369 }
370 
371 // function factories
372 #include <Rcpp/module/Module_generated_function.h>
373 
374 namespace Rcpp {
375 
376  template <typename FROM, typename TO>
377  void converter( const char* from, const char* to, TO (*fun)(FROM), const char* docstring = 0 ){
378  std::string fun_name = internal::get_converter_name<FROM,TO>( from, to ) ;
379  function( fun_name.c_str(), fun, docstring ) ;
380  }
381 
382  class CppClass : public S4{
383  typedef S4 Base;
384  public:
387  CppClass( SEXP x) : S4(x){};
388 
389  CppClass( Module* p, class_Base* cl, std::string& buffer ) : S4("C++Class") {
390  XP_Class clxp( cl, false, R_NilValue, R_NilValue ) ;
391  slot( "module" ) = XP( p, false ) ;
392  slot( "pointer" ) = clxp ;
393 
394  buffer = "Rcpp_" ;
395  buffer += cl->name ;
396  slot( ".Data" ) = buffer ;
397 
398  slot( "fields" ) = cl->fields( clxp ) ;
399 
400  slot( "methods" ) = cl->getMethods( clxp, buffer ) ;
401  slot( "constructors") = cl->getConstructors( clxp, buffer ) ;
402  slot( "docstring" ) = cl->docstring ;
403  slot( "typeid" ) = cl->get_typeinfo_name() ;
404  slot( "enums" ) = cl->enums ;
405  slot( "parents" ) = cl->parents ;
406  }
407 
409 
410  } ;
411 
412  class CppObject : public S4{
413  typedef S4 Base;
414  public:
416  CppObject( Module* p, class_Base* clazz, SEXP xp ) : S4("C++Object") {
417  slot( "module" ) = XP( p, false ) ;
418  slot( "cppclass" ) = Rcpp::XPtr<class_Base>( clazz, false ) ;
419  slot( "pointer" ) = xp ;
420  }
422  } ;
423 
424 }
425 
426 #define RCPP_MODULE_BOOT(name) _rcpp_module_boot_##name
427 
428 #define RCPP_MODULE(name) \
429  void _rcpp_module_##name##_init() ; \
430  static Rcpp::Module _rcpp_module_##name( # name ) ; \
431  extern "C" SEXP _rcpp_module_boot_##name(){ \
432  ::setCurrentScope( & _rcpp_module_##name ) ; \
433  _rcpp_module_##name##_init( ) ; \
434  Rcpp::XPtr<Rcpp::Module> mod_xp(& _rcpp_module_##name , false); \
435  ::setCurrentScope( 0 ) ; \
436  return mod_xp ; \
437  } \
438  void _rcpp_module_##name##_init()
439 
440 // silly little dance to suppress a 'defined but not used variable' warning
441 #ifdef __GNUC__
442 #define VARIABLE_IS_NOT_USED __attribute__ ((unused))
443 #else
444 #define VARIABLE_IS_NOT_USED
445 #endif
446 
447 // static variable to hold Rf_install symbol to prevent it from being gc'ed
448 static VARIABLE_IS_NOT_USED SEXP moduleSym = NULL;
449 
450 // helper macro to cache the result of Rf_install("Module"): once
451 // it is allocated and in the symbol table it is safe from gc
452 #define GET_MODULE_SYM ( moduleSym == NULL ? moduleSym = Rf_install("Module") : moduleSym )
453 
454 // this macro is called by code wanting to load a module -- see RInside's rinside_module_sample0.cpp
455 #define LOAD_RCPP_MODULE(NAME) \
456  Shield<SEXP> __load_module_call__( Rf_lang2( GET_MODULE_SYM, _rcpp_module_boot_##NAME() ) ); \
457  Rcpp_fast_eval( __load_module_call__, R_GlobalEnv );
458 
459 #endif
460 
VARIABLE_IS_NOT_USED
#define VARIABLE_IS_NOT_USED
Definition: Module.h:444
Rcpp::CppInheritedProperty::get_class
std::string get_class()
Definition: Module.h:293
Rcpp::SignedMethod::method
METHOD * method
Definition: Module.h:189
Rcpp::CppProperty::CppProperty
CppProperty(const char *doc=0)
Definition: Module.h:270
Rcpp::CppInheritedProperty::parent_property
CppProperty< Parent > * parent_property
Definition: Module.h:296
Rcpp::S4
S4_Impl< PreserveStorage > S4
Definition: S4.h:75
Rcpp::class_Base
Definition: class_Base.h:26
Rcpp::CppInheritedMethod::parent_method_pointer
ParentMethod * parent_method_pointer
Definition: Module.h:130
RCPP_CTOR_ASSIGN_WITH_BASE
#define RCPP_CTOR_ASSIGN_WITH_BASE(__CLASS__)
Definition: interface.h:38
Rcpp::SignedMethod::SignedMethod
SignedMethod(METHOD *m, ValidMethod valid_, const char *doc)
Definition: Module.h:187
Rcpp::CppProperty::is_readonly
virtual bool is_readonly()
Definition: Module.h:274
getCurrentScope
attribute_hidden Rcpp::Module * getCurrentScope()
Definition: routines.h:270
Rcpp::CppInheritedProperty::Base
CppProperty< Class > Base
Definition: Module.h:283
Rcpp::SignedMethod::is_const
bool is_const()
Definition: Module.h:195
Rcpp::CppInheritedProperty::get
SEXP get(Class *obj)
Definition: Module.h:290
Rcpp::S4_field::Base
Rcpp::Reference Base
Definition: Module.h:322
Rcpp::CppObject::XP
Rcpp::XPtr< Rcpp::Module > XP
Definition: Module.h:415
Rcpp::SignedConstructor::nargs
int nargs()
Definition: Module.h:156
class.h
Rcpp::result::result
result(T *ptr_)
Definition: Module.h:58
Rcpp::FunctionFinalizer
Definition: Module.h:307
Rcpp::Reference
Reference_Impl< PreserveStorage > Reference
Definition: Reference.h:71
Rcpp::S4_CppOverloadedMethods
Definition: Module.h:224
class_Base.h
Rcpp::CppObject::CppObject
CppObject(Module *p, class_Base *clazz, SEXP xp)
Definition: Module.h:416
Module_Property.h
Rcpp::enum_::self
enum_< Enum, Parent > self
Definition: Module.h:345
Rcpp::S4_CppOverloadedMethods::signed_method_class
SignedMethod< Class > signed_method_class
Definition: Module.h:228
Rcpp::enum_::values
MAP values
Definition: Module.h:365
Rcpp::CppMethod::signature
virtual void signature(std::string &s, const char *name)
Definition: Module.h:108
Rcpp::CppInheritedProperty::CppInheritedProperty
CppInheritedProperty(CppProperty< Parent > *parent_property_)
Definition: Module.h:285
Rcpp::FunctionFinalizer::Pointer
void(* Pointer)(Class *)
Definition: Module.h:309
Rcpp::enum_
Definition: Module.h:343
Rcpp::CppClass
Definition: Module.h:382
Rcpp::class_Base::name
std::string name
Definition: class_Base.h:85
Rcpp::CppFinalizer::CppFinalizer
CppFinalizer()
Definition: Module.h:302
Rcpp::CppInheritedMethod::ParentMethod
CppMethod< Parent > ParentMethod
Definition: Module.h:115
Rcpp::CppInheritedProperty::is_readonly
bool is_readonly()
Definition: Module.h:292
Rcpp::SignedConstructor::docstring
std::string docstring
Definition: Module.h:154
Rcpp::result
Definition: Module.h:56
Rcpp::S4_CppOverloadedMethods::XP_Class
Rcpp::XPtr< class_Base > XP_Class
Definition: Module.h:227
Rcpp::S4_field
Definition: Module.h:321
Rcpp::Function
Function_Impl< PreserveStorage > Function
Definition: Function.h:122
Rcpp::CppClass::XP
Rcpp::XPtr< Rcpp::Module > XP
Definition: Module.h:386
Rcpp::CppProperty::get_class
virtual std::string get_class()
Definition: Module.h:275
Rcpp::enum_::PAIR
MAP::value_type PAIR
Definition: Module.h:364
Rcpp::CppClass::XP_Class
XPtr< class_Base > XP_Class
Definition: Module.h:385
Rcpp::SignedMethod::is_void
bool is_void()
Definition: Module.h:194
Rcpp::CppInheritedMethod::CppInheritedMethod
CppInheritedMethod(ParentMethod *parent_method_pointer_)
Definition: Module.h:117
Rcpp::SignedConstructor
Definition: Module.h:143
Rcpp::CppClass::CppClass
CppClass(SEXP x)
Definition: Module.h:387
Rcpp::S4_CppConstructor::Base
Reference Base
Definition: Module.h:204
Rcpp::CppFinalizer::run
virtual void run(Class *)
Definition: Module.h:303
Rcpp::CppInheritedMethod::operator()
SEXP operator()(Class *object, SEXP *args)
Definition: Module.h:121
Rcpp::CppInheritedMethod
Definition: Module.h:112
Rcpp::CppProperty::docstring
std::string docstring
Definition: Module.h:277
Rcpp::SignedFactory::valid
ValidConstructor valid
Definition: Module.h:173
Rcpp::traits::same_type
Definition: same_type.h:29
Rcpp::enum_::value
self & value(const char *name_, Enum value_)
Definition: Module.h:355
Rcpp::ValidMethod
bool(* ValidMethod)(SEXP *, int)
Definition: Module.h:140
Rcpp::FunctionFinalizer::run
virtual void run(Class *object)
Definition: Module.h:312
RCPP_DEBUG
#define RCPP_DEBUG(MSG)
Definition: debug.h:43
get_return_type.h
Rcpp::SignedConstructor::valid
ValidConstructor valid
Definition: Module.h:153
Rcpp::Module
Definition: Module.h:29
Rcpp::internal::get_converter_name
std::string get_converter_name(const char *from, const char *to)
Definition: Module.h:32
Rcpp::enum_::parent_typeinfo_name
std::string parent_typeinfo_name
Definition: Module.h:366
Rcpp::CppProperty::~CppProperty
virtual ~CppProperty()
Definition: Module.h:271
Rcpp::S4_field::S4_field
S4_field(CppProperty< Class > *p, const XP_Class &class_xp)
Definition: Module.h:325
Rcpp::SignedConstructor::SignedConstructor
SignedConstructor(Constructor_Base< Class > *ctor_, ValidConstructor valid_, const char *doc)
Definition: Module.h:146
Rcpp::CppInheritedProperty::set
void set(Class *obj, SEXP s)
Definition: Module.h:291
Module.h
Rcpp::CppInheritedMethod::is_void
bool is_void()
Definition: Module.h:125
Rcpp::S4_field::XP_Class
XPtr< class_Base > XP_Class
Definition: Module.h:324
Rcpp
Rcpp API.
Definition: algo.h:28
Rcpp::object::ptr
T * ptr
Definition: Module.h:72
Rcpp::CppClass::Base
S4 Base
Definition: Module.h:383
Rcpp::object
Definition: Module.h:65
Rcpp::CppMethod::is_void
virtual bool is_void()
Definition: Module.h:106
field
self & field(const char *name_, T Class::*ptr, const char *docstring=0)
Definition: Module_Field.h:68
Rcpp::CppInheritedMethod::signature
void signature(std::string &s, const char *name)
Definition: Module.h:127
Rcpp::Vector
Definition: 00_forward_Vector.h:26
Rcpp::object::operator->
T * operator->()
Definition: Module.h:70
Rcpp::SignedMethod::signature
void signature(std::string &s, const char *name)
Definition: Module.h:196
Rcpp::CppProperty::XP
Rcpp::XPtr< Class > XP
Definition: Module.h:268
Rcpp::SignedFactory
Definition: Module.h:163
Rcpp::CppMethod::~CppMethod
virtual ~CppMethod()
Definition: Module.h:104
Rcpp::XPtr
Definition: XPtr.h:63
Rcpp::traits::r_type_traits
Definition: r_type_traits.h:104
Rcpp::SignedFactory::docstring
std::string docstring
Definition: Module.h:174
Rcpp::enum_::name
std::string name
Definition: Module.h:362
Rcpp::CppObject
Definition: Module.h:412
Rcpp::SignedFactory::fact
Factory_Base< Class > * fact
Definition: Module.h:172
Rcpp::CppMethod
Definition: Module.h:98
Rcpp::Module::add_enum
void add_enum(const std::string &parent_class_typeinfo_name, const std::string &enum_name, const std::map< std::string, int > &value)
Definition: Module.h:219
Rcpp::CppMethod::CppMethod
CppMethod()
Definition: Module.h:102
Rcpp::SignedMethod
Definition: Module.h:184
Rcpp::S4_CppConstructor::Storage
Reference::Storage Storage
Definition: Module.h:207
Rcpp::class_Base::fields
virtual Rcpp::List fields(const XP_Class &)
Definition: class_Base.h:34
Rcpp::S4_CppConstructor::S4_CppConstructor
S4_CppConstructor(SignedConstructor< Class > *m, const XP_Class &class_xp, const std::string &class_name, std::string &buffer)
Definition: Module.h:209
Rcpp::SignedFactory::SignedFactory
SignedFactory(Factory_Base< Class > *fact_, ValidConstructor valid_, const char *doc)
Definition: Module.h:166
Rcpp::CppInheritedMethod::XP
Rcpp::XPtr< Class > XP
Definition: Module.h:114
Rcpp::SignedMethod::docstring
std::string docstring
Definition: Module.h:191
Rcpp::CppProperty::get
virtual SEXP get(Class *)
Definition: Module.h:272
Rcpp::converter
void converter(const char *from, const char *to, TO(*fun)(FROM), const char *docstring=0)
Definition: Module.h:377
Rcpp::Rcpp_namespace
static Environment_Impl Rcpp_namespace()
Definition: Environment.h:360
Rcpp::class_Base::docstring
std::string docstring
Definition: class_Base.h:86
Rcpp::CppClass::CppClass
CppClass(Module *p, class_Base *cl, std::string &buffer)
Definition: Module.h:389
Rcpp::enum_::~enum_
~enum_()
Definition: Module.h:350
Rcpp::enum_::enum_
enum_(const char *name_)
Definition: Module.h:347
Rcpp::object::object_type
T object_type
Definition: Module.h:67
Rcpp::class_Base::getMethods
virtual Rcpp::List getMethods(const XP_Class &, std::string &)
Definition: class_Base.h:35
Rcpp::CppFinalizer
Definition: Module.h:300
Rcpp::CppObject::Base
S4 Base
Definition: Module.h:413
Rcpp::SignedMethod::nargs
int nargs()
Definition: Module.h:193
Rcpp::result::ptr
T * ptr
Definition: Module.h:61
Rcpp::SignedConstructor::signature
void signature(std::string &buffer, const std::string &class_name)
Definition: Module.h:157
Rcpp::SignedMethod::METHOD
CppMethod< Class > METHOD
Definition: Module.h:186
Rcpp::class_Base::enums
ENUM_MAP enums
Definition: class_Base.h:91
Rcpp::class_Base::parents
std::vector< std::string > parents
Definition: class_Base.h:92
Rcpp::CppMethod::nargs
virtual int nargs()
Definition: Module.h:105
Rcpp::S4_CppConstructor
Definition: Module.h:203
Rcpp::SignedFactory::signature
void signature(std::string &buffer, const std::string &class_name)
Definition: Module.h:177
Rcpp::object::operator&
T & operator&()
Definition: Module.h:71
Rcpp::class_Base::getConstructors
virtual Rcpp::List getConstructors(const XP_Class &, std::string &)
Definition: class_Base.h:36
Rcpp::internal::make_new_object
SEXP make_new_object(Class *ptr)
Definition: Module.h:77
Rcpp::S4_CppConstructor::XP_Class
XPtr< class_Base > XP_Class
Definition: Module.h:206
Rcpp::class_Base::get_typeinfo_name
virtual std::string get_typeinfo_name()
Definition: class_Base.h:77
config.h
Rcpp::S4_CppOverloadedMethods::vec_signed_method
std::vector< signed_method_class * > vec_signed_method
Definition: Module.h:229
Rcpp::CppMethod::XP
Rcpp::XPtr< Class > XP
Definition: Module.h:100
Rcpp::CppMethod::is_const
virtual bool is_const()
Definition: Module.h:107
Rcpp::CppInheritedMethod::is_const
bool is_const()
Definition: Module.h:126
Rcpp::enum_::MAP
std::map< std::string, int > MAP
Definition: Module.h:363
Rcpp::S4_CppOverloadedMethods::Base
Rcpp::Reference Base
Definition: Module.h:225
Rcpp::CppMethod::operator()
virtual SEXP operator()(Class *, SEXP *)
Definition: Module.h:103
Rcpp::FunctionFinalizer::FunctionFinalizer
FunctionFinalizer(Pointer p)
Definition: Module.h:310
Rcpp::SignedConstructor::ctor
Constructor_Base< Class > * ctor
Definition: Module.h:152
Rcpp::ValidConstructor
bool(* ValidConstructor)(SEXP *, int)
Definition: Module.h:139
Rcpp::object::object
object(T *ptr_)
Definition: Module.h:68
moduleSym
static VARIABLE_IS_NOT_USED SEXP moduleSym
Definition: Module.h:448
Rcpp::CppInheritedProperty
Definition: Module.h:281
Rcpp::SignedFactory::nargs
int nargs()
Definition: Module.h:176
Rcpp::S4_CppOverloadedMethods::S4_CppOverloadedMethods
S4_CppOverloadedMethods(vec_signed_method *m, const XP_Class &class_xp, const char *name, std::string &buffer)
Definition: Module.h:231
Rcpp::CppProperty
Definition: Module.h:266
Rcpp::SignedMethod::valid
ValidMethod valid
Definition: Module.h:190
Rcpp::FunctionFinalizer::finalizer
Pointer finalizer
Definition: Module.h:317
CppFunction.h
Rcpp::CppInheritedMethod::nargs
int nargs()
Definition: Module.h:124
Rcpp::CppProperty::set
virtual void set(Class *, SEXP)
Definition: Module.h:273