[Rcpp-commits] r2696 - in pkg/Rcpp: . inst/include/Rcpp/module

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Dec 3 22:06:10 CET 2010


Author: edd
Date: 2010-12-03 22:06:10 +0100 (Fri, 03 Dec 2010)
New Revision: 2696

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/module/Module_generated_Constructor.h
   pkg/Rcpp/inst/include/Rcpp/module/Module_generated_class_constructor.h
Log:
patch by Tama Ma for 7th arg in module ctor -- R CMD check blows up but that could be other module code as well


Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2010-12-03 12:21:33 UTC (rev 2695)
+++ pkg/Rcpp/ChangeLog	2010-12-03 21:06:10 UTC (rev 2696)
@@ -1,10 +1,17 @@
+2010-12-03  Dirk Eddelbuettel  <edd at debian.org>
+
+	* inst/include/Rcpp/module/Module_generated_Constructor.h: Applied
+	patch by Tama Ma <pingnang at phys.ethz.ch> for up to seven args in ctor
+	* inst/include/Rcpp/module/Module_generated_class_constructor.h: Idem
+
 2010-12-03  Romain Francois <romain at r-enthusiasts.com>
 
-    * inst/include/Rcpp/RObject.h : new inline method inherits that checks if 
-    an object inherits from a given class (wrapper around Rf_inherits)
-    
-    * inst/unitTests/runit.RObject.R: unit test for the above
+	* inst/include/Rcpp/RObject.h : new inline method inherits that
+	checks if an object inherits from a given class (wrapper around
+	Rf_inherits)
 
+	* inst/unitTests/runit.RObject.R: unit test for the above
+
 2010-12-02  Douglas Bates  <bates at stat.wisc.edu>
 
 	* inst/include/Rcpp/generated/Function__operator.h,

Modified: pkg/Rcpp/inst/include/Rcpp/module/Module_generated_Constructor.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/module/Module_generated_Constructor.h	2010-12-03 12:21:33 UTC (rev 2695)
+++ pkg/Rcpp/inst/include/Rcpp/module/Module_generated_Constructor.h	2010-12-03 21:06:10 UTC (rev 2696)
@@ -126,5 +126,23 @@
         return ctor_signature<U0,U1,U2,U3,U4,U5>(class_name) ;
     }
 } ;
+template <typename Class, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6>
+class Constructor_7 : public Constructor_Base<Class>{
+    virtual Class* get_new( SEXP* args, int nargs ){
+        return new Class( 
+            as<U0>(args[0]), 
+            as<U1>(args[1]), 
+            as<U2>(args[2]), 
+            as<U3>(args[3]), 
+            as<U4>(args[4]),
+            as<U5>(args[5]),
+						as<U6>(args[6]) 
+            ) ;
+    }
+    virtual int nargs(){ return 7 ; }
+    virtual const char* signature(const std::string& class_name ){
+        return ctor_signature<U0,U1,U2,U3,U4,U5,U6>(class_name) ;
+    }
+} ;
 
 #endif

Modified: pkg/Rcpp/inst/include/Rcpp/module/Module_generated_class_constructor.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/module/Module_generated_class_constructor.h	2010-12-03 12:21:33 UTC (rev 2695)
+++ pkg/Rcpp/inst/include/Rcpp/module/Module_generated_class_constructor.h	2010-12-03 21:06:10 UTC (rev 2696)
@@ -28,6 +28,20 @@
         typename U2, 
         typename U3, 
         typename U4, 
+        typename U5,
+        typename U6
+    > 
+    self& constructor( const char* docstring = 0, ValidConstructor valid = &yes_arity<7> ){
+        AddConstructor( new Constructor_7<Class,U0,U1,U2,U3,U4,U5,U6> , valid, docstring ) ;
+        return *this ;   
+    }
+
+    template <
+        typename U0, 
+        typename U1, 
+        typename U2, 
+        typename U3, 
+        typename U4, 
         typename U5
     > 
     self& constructor( const char* docstring = 0, ValidConstructor valid = &yes_arity<6> ){



More information about the Rcpp-commits mailing list