22 #ifndef Rcpp_api_meat_export_h
23 #define Rcpp_api_meat_export_h
28 template <
typename InputIterator,
typename value_type>
30 R_xlen_t n = ::Rf_xlength(x) ;
31 for( R_xlen_t i=0; i<n; i++, ++first ){
32 *first = ::Rcpp::as<value_type>( VECTOR_ELT(x, i) ) ;
41 template <
template <
class,
class>
class ContainerTemplate,
typename T >
class ContainerExporter {
43 typedef ContainerTemplate<T, std::allocator<T> >
Container ;
50 if( TYPEOF(
object) ==
RTYPE ){
51 T* start = Rcpp::internal::r_vector_start<RTYPE>(
object) ;
52 return Container( start, start + Rf_xlength(
object) ) ;
55 ::Rcpp::internal::export_range(
object, vec.begin() ) ;
62 template <
template<
class,
class>
class Container >
struct container_exporter< Container, int >{
65 template <
template<
class,
class>
class Container >
struct container_exporter< Container, double >{
ContainerExporter(SEXP x)
ContainerTemplate< T, std::allocator< T > > Container
void export_range__dispatch(SEXP x, InputIterator first, ::Rcpp::traits::r_type_generic_tag)
ContainerExporter< Container, double > type
ContainerExporter< Container, int > type