File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,17 +58,6 @@ namespace Rcpp{
5858 T* ptr;
5959 } ;
6060
61- template <typename T>
62- class object {
63- public:
64- typedef T object_type ;
65- object ( T* ptr_ ) : ptr(ptr_){}
66- operator T*(){ return ptr ; }
67- T* operator ->(){ return ptr ; }
68- T& operator &(){ return *ptr ; }
69- T* ptr ;
70- } ;
71-
7261 namespace internal {
7362 template <typename Class>
7463 SEXP make_new_object ( Class* ptr ){
Original file line number Diff line number Diff line change 2929#include <Rcpp/api/meat/Matrix.h>
3030#include <Rcpp/api/meat/Reference.h>
3131#include <Rcpp/api/meat/is.h>
32+ #include <Rcpp/api/meat/as.h>
3233#include <Rcpp/api/meat/export.h>
3334#include <Rcpp/api/meat/wrap.h>
3435
Original file line number Diff line number Diff line change @@ -76,15 +76,10 @@ namespace Rcpp{
7676 return exporter.get () ;
7777 }
7878
79- void * as_module_object_internal (SEXP) ;
80- template <typename T> object<T> as_module_object (SEXP x){
81- return (T*) as_module_object_internal (x) ;
82- }
79+ template <typename T> T* as_module_object (SEXP x) ;
8380
84- /* * handling object<T> */
8581 template <typename T> T as (SEXP x, ::Rcpp::traits::r_type_module_object_const_pointer_tag ) {
86- typedef typename std::remove_const<T>::type T_NON_CONST ;
87- return const_cast <T>( (T_NON_CONST)as_module_object_internal (x) ) ;
82+ return const_cast <T>( as_module_object< typename std::remove_const<T>::type >( x ) ) ;
8883 }
8984
9085 template <typename T> T as (SEXP x, ::Rcpp::traits::r_type_module_object_pointer_tag ) {
Original file line number Diff line number Diff line change @@ -32,11 +32,6 @@ struct wrap_type_primitive_tag{};
3232 * unknown. Implicit conversion to SEXP will be tried.
3333 */
3434struct wrap_type_unknown_tag {};
35-
36- /* *
37- * module objects pointers (object<T>). conversion done using make_new_object<>()
38- */
39- struct wrap_type_module_object_pointer_tag {} ;
4035
4136/* *
4237 * declared module object type (by the RCPP_EXPOSED_CLASS macro)
@@ -88,9 +83,6 @@ template <> struct wrap_type_traits<long double> { typedef wrap_type_primitive_t
8883template <> struct wrap_type_traits <short > { typedef wrap_type_primitive_tag wrap_category; } ;
8984template <> struct wrap_type_traits <unsigned short > { typedef wrap_type_primitive_tag wrap_category; } ;
9085
91- template <typename T> struct wrap_type_traits < Rcpp::object<T> > { typedef wrap_type_module_object_pointer_tag wrap_category; } ;
92-
93-
9486} // namespace traits
9587} // namespace Rcpp
9688#endif
Original file line number Diff line number Diff line change @@ -495,13 +495,5 @@ namespace Rcpp{
495495 return it->second ;
496496 }
497497
498- namespace internal {
499- void * as_module_object_internal (SEXP obj){
500- Environment env (obj) ;
501- SEXP xp = env.get (" .pointer" ) ;
502- return R_ExternalPtrAddr (xp );
503- }
504- }
505-
506498}
507499
You can’t perform that action at this time.
0 commit comments