[Rcpp-commits] r2417 - in pkg/Rcpp/inst/unitTests: . testRcppModule/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Nov 7 13:28:50 CET 2010


Author: romain
Date: 2010-11-07 13:28:49 +0100 (Sun, 07 Nov 2010)
New Revision: 2417

Modified:
   pkg/Rcpp/inst/unitTests/runit.Module.R
   pkg/Rcpp/inst/unitTests/runit.modref.R
   pkg/Rcpp/inst/unitTests/testRcppModule/src/Num.cpp
   pkg/Rcpp/inst/unitTests/testRcppModule/src/rcpp_module.cpp
   pkg/Rcpp/inst/unitTests/testRcppModule/src/stdVector.cpp
Log:
exosing the default constructors manually

Modified: pkg/Rcpp/inst/unitTests/runit.Module.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.Module.R	2010-11-07 11:46:52 UTC (rev 2416)
+++ pkg/Rcpp/inst/unitTests/runit.Module.R	2010-11-07 12:28:49 UTC (rev 2417)
@@ -77,6 +77,9 @@
 		function( "bla2"  , &bla2   ) ;
 
 		class_<World>( "World" )
+		
+		    .default_constructor()
+		    
 			.method( "greet", &World::greet )
 			.method( "set", &World::set )
 			.method( "clear", &clearWorld )
@@ -132,6 +135,9 @@
 	using namespace Rcpp ;
 
 	class_<vec>( "vec")
+	
+	    .default_constructor() 
+	    
 	 	.method( "size", &vec::size)
  		.method( "max_size", &vec::max_size)
  		.method( "resize", &vec::resize)
@@ -191,7 +197,9 @@
 		using namespace Rcpp ;
 
 		class_<Num>( "Num" )
-
+		    
+		    .default_constructor() 
+	    
 			// read and write property
 			.property( "x", &Num::getX, &Num::setX )
 
@@ -231,6 +239,8 @@
 
 		class_<Number>( "Number" )
 
+		    .default_constructor() 
+	    
 			// read and write data member
 			.field( "x", &Number::x )
 

Modified: pkg/Rcpp/inst/unitTests/runit.modref.R
===================================================================
--- pkg/Rcpp/inst/unitTests/runit.modref.R	2010-11-07 11:46:52 UTC (rev 2416)
+++ pkg/Rcpp/inst/unitTests/runit.modref.R	2010-11-07 12:28:49 UTC (rev 2417)
@@ -42,6 +42,9 @@
 		using namespace Rcpp ;
 
 		class_<World>( "World" )
+		
+		    .default_constructor()
+		    
 			.method( "greet", &World::greet )
 			.method( "set", &World::set )
 			.method( "clear", &clearWorld )

Modified: pkg/Rcpp/inst/unitTests/testRcppModule/src/Num.cpp
===================================================================
--- pkg/Rcpp/inst/unitTests/testRcppModule/src/Num.cpp	2010-11-07 11:46:52 UTC (rev 2416)
+++ pkg/Rcpp/inst/unitTests/testRcppModule/src/Num.cpp	2010-11-07 12:28:49 UTC (rev 2417)
@@ -18,6 +18,8 @@
 	using namespace Rcpp ;
 
 	class_<Num>( "Num" )
+	
+	    .default_constructor()
 
 		// read and write property
 		.property( "x", &Num::getX, &Num::setX )

Modified: pkg/Rcpp/inst/unitTests/testRcppModule/src/rcpp_module.cpp
===================================================================
--- pkg/Rcpp/inst/unitTests/testRcppModule/src/rcpp_module.cpp	2010-11-07 11:46:52 UTC (rev 2416)
+++ pkg/Rcpp/inst/unitTests/testRcppModule/src/rcpp_module.cpp	2010-11-07 12:28:49 UTC (rev 2417)
@@ -48,6 +48,9 @@
 	function( "bla2"  , &bla2   ) ;
 	
 	class_<World>( "World" )
+	
+	    .default_constructor()
+	    
 		.method( "greet", &World::greet )
 		.method( "set", &World::set )
 	;

Modified: pkg/Rcpp/inst/unitTests/testRcppModule/src/stdVector.cpp
===================================================================
--- pkg/Rcpp/inst/unitTests/testRcppModule/src/stdVector.cpp	2010-11-07 11:46:52 UTC (rev 2416)
+++ pkg/Rcpp/inst/unitTests/testRcppModule/src/stdVector.cpp	2010-11-07 12:28:49 UTC (rev 2417)
@@ -26,7 +26,10 @@
 
     // we expose the class std::vector<double> as "vec" on the R side
     class_<vec>( "vec")
-
+    
+    // exposing the default constructor
+    .default_constructor() 
+	
     // exposing member functions
     .method( "size", &vec::size)
     .method( "max_size", &vec::max_size)



More information about the Rcpp-commits mailing list