[Rcpp-commits] r734 - in pkg: Rcpp/inst Rcpp/src RcppExamples/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Feb 18 13:19:14 CET 2010
Author: romain
Date: 2010-02-18 13:19:14 +0100 (Thu, 18 Feb 2010)
New Revision: 734
Modified:
pkg/Rcpp/inst/ChangeLog
pkg/Rcpp/src/RcppCommon.cpp
pkg/Rcpp/src/RcppCommon.h
pkg/RcppExamples/src/RcppExample.cpp
Log:
move the XPtr example to Rcpp, since it is used in the unit tests
Modified: pkg/Rcpp/inst/ChangeLog
===================================================================
--- pkg/Rcpp/inst/ChangeLog 2010-02-18 07:57:34 UTC (rev 733)
+++ pkg/Rcpp/inst/ChangeLog 2010-02-18 12:19:14 UTC (rev 734)
@@ -1,3 +1,10 @@
+2010-02-18 Romain Francois <romain at r-enthusiasts.com>
+
+ * src/Rcpp/Environment.h: Environment gains a find method
+ which searches for a binding in the associated environment
+ but also in all its parents, as opposed to get which just
+ looks in the environment.
+
2010-02-17 Dirk Eddelbuettel <edd at debian.org>
* src/Makevars: Simplified as RcppExample.cpp is shipped off
Modified: pkg/Rcpp/src/RcppCommon.cpp
===================================================================
--- pkg/Rcpp/src/RcppCommon.cpp 2010-02-18 07:57:34 UTC (rev 733)
+++ pkg/Rcpp/src/RcppCommon.cpp 2010-02-18 12:19:14 UTC (rev 734)
@@ -146,3 +146,17 @@
} // internal
} // Rcpp
+
+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) ;
+ return p ;
+}
+
+SEXP RcppXPtrExample_get_external_pointer(SEXP x){
+ Rcpp::XPtr< std::vector<int> > p(x) ;
+ return Rf_ScalarInteger( p->back( ) ) ;
+}
+
Modified: pkg/Rcpp/src/RcppCommon.h
===================================================================
--- pkg/Rcpp/src/RcppCommon.h 2010-02-18 07:57:34 UTC (rev 733)
+++ pkg/Rcpp/src/RcppCommon.h 2010-02-18 12:19:14 UTC (rev 734)
@@ -174,4 +174,7 @@
#include <Rcpp/internal/convertible.h>
#include <Rcpp/internal/wrap.h>
+RcppExport SEXP RcppXPtrExample_create_external_pointer() ;
+RcppExport SEXP RcppXPtrExample_get_external_pointer(SEXP );
+
#endif
Modified: pkg/RcppExamples/src/RcppExample.cpp
===================================================================
--- pkg/RcppExamples/src/RcppExample.cpp 2010-02-18 07:57:34 UTC (rev 733)
+++ pkg/RcppExamples/src/RcppExample.cpp 2010-02-18 12:19:14 UTC (rev 734)
@@ -462,17 +462,3 @@
return rl;
}
-RcppExport 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) ;
- return p ;
-}
-
-RcppExport SEXP RcppXPtrExample_get_external_pointer(SEXP x){
- Rcpp::XPtr< std::vector<int> > p(x) ;
- return Rf_ScalarInteger( p->back( ) ) ;
-}
-
-
More information about the Rcpp-commits
mailing list