File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,7 +145,11 @@ namespace internal{
145145 return TYPEOF (x) == REALSXP && Rf_inherits ( x, " POSIXt" ) ;
146146 }
147147
148- bool is_module_object_internal (SEXP , const char *) ;
148+ inline bool is_module_object_internal (SEXP obj, const char * clazz){
149+ Environment env (obj) ;
150+ XPtr<class_Base> xp ( env.get (" .cppclass" ) );
151+ return xp->has_typeinfo_name ( clazz ) ;
152+ }
149153 template <typename T> bool is__module__object ( SEXP x){
150154 typedef typename Rcpp::traits::un_pointer<T>::type CLASS ;
151155 return is_module_object_internal (x, typeid (CLASS ).name () ) ;
Original file line number Diff line number Diff line change @@ -83,7 +83,11 @@ namespace Rcpp{
8383 return exporter.get () ;
8484 }
8585
86- void * as_module_object_internal (SEXP ) ;
86+ inline void * as_module_object_internal (SEXP obj) {
87+ Environment env (obj) ;
88+ SEXP xp = env.get (" .pointer" ) ;
89+ return R_ExternalPtrAddr (xp );
90+ }
8791 template <typename T> object<T> as_module_object (SEXP x){
8892 return (T*) as_module_object_internal (x) ;
8993 }
Original file line number Diff line number Diff line change @@ -239,20 +239,3 @@ extern "C" void R_init_Rcpp( DllInfo* info){
239239 init_Rcpp_routines (info) ;
240240}
241241
242- namespace Rcpp {
243-
244- namespace internal {
245- void * as_module_object_internal (SEXP obj){
246- Environment env (obj) ;
247- SEXP xp = env.get (" .pointer" ) ;
248- return R_ExternalPtrAddr (xp );
249- }
250- bool is_module_object_internal (SEXP obj, const char * clazz){
251- Environment env (obj) ;
252- XPtr<class_Base> xp ( env.get (" .cppclass" ) );
253- return xp->has_typeinfo_name ( clazz ) ;
254- }
255- }
256-
257- }
258-
You can’t perform that action at this time.
0 commit comments