[Rcpp-commits] r2778 - in pkg/Rcpp: inst/unitTests src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 12 12:38:23 CET 2010


Author: romain
Date: 2010-12-12 12:38:23 +0100 (Sun, 12 Dec 2010)
New Revision: 2778

Modified:
   pkg/Rcpp/inst/unitTests/runit.XPTr.R
   pkg/Rcpp/src/RcppCommon.cpp
Log:
not necessary anymore

Modified: pkg/Rcpp/inst/unitTests/runit.XPTr.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.XPTr.R	2010-12-12 09:20:39 UTC (rev 2777)
+++ pkg/Rcpp/inst/unitTests/runit.XPTr.R	2010-12-12 11:38:23 UTC (rev 2778)
@@ -57,15 +57,3 @@
 	checkEquals( front, 1L, msg = "check usage of external pointer" )
 }
 
-# this is similar but without inline, the code is included in 
-# the dyn lib. One reason for this is to effectively instanciate one
-# template class Rcpp::XPtr at compile time, so that we know at that
-# point if something is wrong with the code
-test.XPtr.internal <- function(){
-	xp <- .Call( "RcppXPtrExample_create_external_pointer", PACKAGE = "Rcpp" )
-	checkEquals( typeof(xp), "externalptr", msg = "external pointer creation" )
-	
-	back <- .Call( "RcppXPtrExample_get_external_pointer", xp, PACKAGE = "Rcpp" )
-	checkEquals( back, 2L, msg = "external pointer usage" )
-}
-

Modified: pkg/Rcpp/src/RcppCommon.cpp
===================================================================
--- pkg/Rcpp/src/RcppCommon.cpp	2010-12-12 09:20:39 UTC (rev 2777)
+++ pkg/Rcpp/src/RcppCommon.cpp	2010-12-12 11:38:23 UTC (rev 2778)
@@ -173,20 +173,6 @@
 	return Rf_ScalarInteger( ::Rcpp::internal::rcpp_call_test_(x) ) ;
 }
 
-
-SEXP RcppXPtrExample_create_external_pointer(){
-	std::vector<int> *v = new std::vector<int> ;
-	v->push_back( 1 ) ;
-	v->push_back( 2 ) ;
-	Rcpp::XPtr< std::vector<int> > p(v, true) ;
-	return p ;
-}
-
-SEXP RcppXPtrExample_get_external_pointer(SEXP x){
-	Rcpp::XPtr< std::vector<int> > p(x) ;
-	return Rf_ScalarInteger( p->back( ) ) ;
-}
-
 SEXP as_character_externalptr(SEXP xp){
 	char buffer[20] ;
 	sprintf( buffer, "%p", (void*)EXTPTR_PTR(xp) ) ;



More information about the Rcpp-commits mailing list