[Rcpp-commits] r3299 - pkg/Rcpp/inst/include/Rcpp/internal
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Nov 7 10:03:55 CET 2011
Author: romain
Date: 2011-11-07 10:03:54 +0100 (Mon, 07 Nov 2011)
New Revision: 3299
Modified:
pkg/Rcpp/inst/include/Rcpp/internal/wrap.h
Log:
implementing wrap_dispatch_importer__impl for int64 and uint64 (used in RProtoBuf)
Modified: pkg/Rcpp/inst/include/Rcpp/internal/wrap.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/internal/wrap.h 2011-11-06 19:54:57 UTC (rev 3298)
+++ pkg/Rcpp/inst/include/Rcpp/internal/wrap.h 2011-11-07 09:03:54 UTC (rev 3299)
@@ -630,8 +630,27 @@
return x ;
}
+template <typename T, typename elem_type>
+inline SEXP wrap_dispatch_importer_int64( const T& object ){
+ int size = object.size() ;
+ Rcpp::int64::LongVector<elem_type> res(size) ;
+ for( int i=0; i<size; i++){
+ res.set(i, object.get(i) ) ;
+ }
+ return res ;
+}
template <typename T, typename elem_type>
+inline SEXP wrap_dispatch_importer__impl( const T& object, ::Rcpp::traits::r_type_int64_tag ){
+ return wrap_dispatch_importer_int64<T,elem_type>( object ) ;
+}
+template <typename T, typename elem_type>
+inline SEXP wrap_dispatch_importer__impl( const T& object, ::Rcpp::traits::r_type_uint64_tag ){
+ return wrap_dispatch_importer_int64<T,elem_type>( object ) ;
+}
+
+
+template <typename T, typename elem_type>
inline SEXP wrap_dispatch_importer( const T& object ){
return wrap_dispatch_importer__impl<T,elem_type>( object,
typename ::Rcpp::traits::r_type_traits<elem_type>::r_category()
More information about the Rcpp-commits
mailing list