[Rcpp-commits] r3287 - pkg/Rcpp/inst/doc/Rcpp-modules
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Nov 5 11:43:37 CET 2011
Author: romain
Date: 2011-11-05 11:43:37 +0100 (Sat, 05 Nov 2011)
New Revision: 3287
Modified:
pkg/Rcpp/inst/doc/Rcpp-modules/Rcpp-modules.Rnw
Log:
attempt again
Modified: pkg/Rcpp/inst/doc/Rcpp-modules/Rcpp-modules.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-modules/Rcpp-modules.Rnw 2011-11-05 08:21:49 UTC (rev 3286)
+++ pkg/Rcpp/inst/doc/Rcpp-modules/Rcpp-modules.Rnw 2011-11-05 10:43:37 UTC (rev 3287)
@@ -930,7 +930,7 @@
} )
@
-TODO: mention R inheritance (John ?)
+% TODO: mention R inheritance (John ?)
\subsubsection{Full example}
@@ -961,6 +961,12 @@
obj->at( i ) = value;
}
+int vec_size( vec* obj ){ return obj->size(); }
+int vec_max_size( vec* obj){ return obj->max_size() ; }
+int vec_capacity( vec* obj){ return obj->capacity() ; }
+void vec_reserve( vec* obj, int n){ obj->reserve( n ); }
+void vec_resize(vec* obj, int n){ obj->resize(n); }
+
RCPP_MODULE(mod_vec) {
using namespace Rcpp;
@@ -972,12 +978,12 @@
.constructor<int>()
// exposing member functions
- .method( "size", &vec::size)
- .method( "max_size", &vec::max_size)
- .method( "resize", &vec::resize)
- .method( "capacity", &vec::capacity)
+ .method( "size", &vec_size)
+ .method( "max_size", &vec_max_size)
+ .method( "capacity", &vec_capacity)
+ .method( "resize", &vec_resize)
+ .method( "reserve", &vec_reserve)
.method( "empty", &vec::empty)
- .method( "reserve", &vec::reserve)
.method( "push_back", &vec::push_back )
.method( "pop_back", &vec::pop_back )
.method( "clear", &vec::clear )
@@ -1035,12 +1041,12 @@
.constructor<int>()
// exposing member functions
- .method( "size", &vec::size)
- .method( "max_size", &vec::max_size)
- .method( "resize", &vec::resize)
- .method( "capacity", &vec::capacity)
+ .method( "size", &vec_size)
+ .method( "max_size", &vec_max_size)
+ .method( "capacity", &vec_capacity)
+ .method( "resize", &vec_resize)
+ .method( "reserve", &vec_reserve)
.method( "empty", &vec::empty)
- .method( "reserve", &vec::reserve)
.method( "push_back", &vec::push_back )
.method( "pop_back", &vec::pop_back )
.method( "clear", &vec::clear )
More information about the Rcpp-commits
mailing list