[Rcpp-commits] r4535 - in pkg/Rcpp: . inst/include/Rcpp/module inst/unitTests inst/unitTests/cpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Sep 27 16:07:07 CEST 2013


Author: romain
Date: 2013-09-27 16:07:06 +0200 (Fri, 27 Sep 2013)
New Revision: 4535

Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h
   pkg/Rcpp/inst/unitTests/cpp/Module.cpp
   pkg/Rcpp/inst/unitTests/runit.Module.R
Log:
use input_parameter and test it, should fix cfa / planar / RcppCNPy issues

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2013-09-24 03:48:46 UTC (rev 4534)
+++ pkg/Rcpp/ChangeLog	2013-09-27 14:07:06 UTC (rev 4535)
@@ -1,3 +1,10 @@
+2013-09-27 Romain Francois <romain at r-enthusiasts.com>
+
+        * include/Rcpp/module/Module_generated_CppFunction.h : regenerated to 
+        use input_parameter traits for more flexible parameter passing strategy
+        * unitTests/cpp/Module.cpp : more testing
+        * unitTests/runit.Module.R : more testing 
+        
 2013-09-22  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/include/Rcpp/sugar/functions/diff.h: Declare set_previous

Modified: pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h	2013-09-24 03:48:46 UTC (rev 4534)
+++ pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h	2013-09-27 14:07:06 UTC (rev 4535)
@@ -2,7 +2,7 @@
 //
 // Module_generated_CppFunction.h: Rcpp R/C++ interface class library -- Rcpp modules
 //
-// Copyright (C) 2010-2012  Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2010-2013  Dirk Eddelbuettel and Romain Francois
 //
 // This file is part of Rcpp.
 //
@@ -27,7 +27,9 @@
     public:
         CppFunction0(OUT (*fun)(void), const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){}
         SEXP operator()(SEXP*) {
+            BEGIN_RCPP
             return Rcpp::module_wrap<OUT>( ptr_fun() ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 0; }
@@ -45,8 +47,9 @@
         CppFunction0(void (*fun)(void), const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){} ;
 
         SEXP operator()(SEXP*) {
+            BEGIN_RCPP
             ptr_fun() ;
-            return R_NilValue ;
+            END_RCPP
         }
 
         inline int nargs(){ return 0; }
@@ -64,7 +67,9 @@
     public:
         CppFunction_WithFormals0(OUT (*fun)(void), Rcpp::List,  const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){}
         SEXP operator()(SEXP*) {
+            BEGIN_RCPP
             return Rcpp::module_wrap<OUT>( ptr_fun() ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 0; }
@@ -82,8 +87,9 @@
         CppFunction_WithFormals0(void (*fun)(void), Rcpp::List, const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){} ;
 
         SEXP operator()(SEXP*) {
+            BEGIN_RCPP
             ptr_fun() ;
-            return R_NilValue ;
+            END_RCPP
         }
 
         inline int nargs(){ return 0; }
@@ -102,7 +108,12 @@
         CppFunction1(OUT (*fun)(U0) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ) ) ) ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 1; }
@@ -119,8 +130,11 @@
         CppFunction1(void (*fun)(U0) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            ptr_fun( x0 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 1; }
@@ -142,7 +156,10 @@
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ) ) ) ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 1; }
@@ -162,8 +179,10 @@
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            ptr_fun( x0 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 1; }
@@ -179,5314 +198,14466 @@
 
 
 
-template <typename OUT, typename U0, typename U1> class CppFunction2 : public CppFunction {
+template <typename OUT, typename U0,typename U1> class CppFunction2 : public CppFunction {
     public:
 
-        CppFunction2(OUT (*fun)(U0, U1) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction2(OUT (*fun)(U0,U1) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ) ) ) ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0,x1 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 2; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0, U1>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0,U1>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        OUT (*ptr_fun)(U0, U1) ;
+        OUT (*ptr_fun)(U0,U1) ;
 } ;
 
 template <typename U0, typename U1>
-class CppFunction2<void,U0, U1> : public CppFunction {
+class CppFunction2<void,U0,U1> : public CppFunction {
     public:
-        CppFunction2(void (*fun)(U0, U1) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction2(void (*fun)(U0,U1) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            ptr_fun( x0,x1 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 2; }
         inline bool is_void(){ return true; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0, U1>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0,U1>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        void (*ptr_fun)(U0, U1) ;
+        void (*ptr_fun)(U0,U1) ;
 } ;
 
 
 
-template <typename OUT, typename U0, typename U1>
+template <typename OUT, typename U0,typename U1>
 class CppFunction_WithFormals2 : public CppFunction {
     public:
 
-        CppFunction_WithFormals2(OUT (*fun)(U0, U1) , Rcpp::List formals_, const char* docstring = 0) :
+        CppFunction_WithFormals2(OUT (*fun)(U0,U1) , Rcpp::List formals_, const char* docstring = 0) :
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ) ) ) ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0,x1 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 2; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0, U1>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0,U1>(s, name) ; }
         SEXP get_formals(){ return formals; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
         Rcpp::List formals ;
-        OUT (*ptr_fun)(U0, U1) ;
+        OUT (*ptr_fun)(U0,U1) ;
 } ;
 
 template <typename U0, typename U1>
-class CppFunction_WithFormals2<void,U0, U1> : public CppFunction {
+class CppFunction_WithFormals2<void,U0,U1> : public CppFunction {
     public:
-        CppFunction_WithFormals2(void (*fun)(U0, U1), Rcpp::List formals_, const char* docstring = 0) :
+        CppFunction_WithFormals2(void (*fun)(U0,U1), Rcpp::List formals_, const char* docstring = 0) :
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            ptr_fun( x0,x1 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 2; }
         inline bool is_void(){ return true; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0, U1>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0,U1>(s, name) ; }
         SEXP get_formals(){ return formals; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
         Rcpp::List formals ;
-        void (*ptr_fun)(U0, U1) ;
+        void (*ptr_fun)(U0,U1) ;
 } ;
 
 
 
-template <typename OUT, typename U0, typename U1, typename U2> class CppFunction3 : public CppFunction {
+template <typename OUT, typename U0,typename U1,typename U2> class CppFunction3 : public CppFunction {
     public:
 
-        CppFunction3(OUT (*fun)(U0, U1, U2) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction3(OUT (*fun)(U0,U1,U2) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ) ) ) ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0,x1,x2 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 3; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0, U1, U2>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0,U1,U2>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        OUT (*ptr_fun)(U0, U1, U2) ;
+        OUT (*ptr_fun)(U0,U1,U2) ;
 } ;
 
 template <typename U0, typename U1, typename U2>
-class CppFunction3<void,U0, U1, U2> : public CppFunction {
+class CppFunction3<void,U0,U1,U2> : public CppFunction {
     public:
-        CppFunction3(void (*fun)(U0, U1, U2) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction3(void (*fun)(U0,U1,U2) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            ptr_fun( x0,x1,x2 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 3; }
         inline bool is_void(){ return true; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0, U1, U2>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0,U1,U2>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        void (*ptr_fun)(U0, U1, U2) ;
+        void (*ptr_fun)(U0,U1,U2) ;
 } ;
 
 
 
-template <typename OUT, typename U0, typename U1, typename U2>
+template <typename OUT, typename U0,typename U1,typename U2>
 class CppFunction_WithFormals3 : public CppFunction {
     public:
 
-        CppFunction_WithFormals3(OUT (*fun)(U0, U1, U2) , Rcpp::List formals_, const char* docstring = 0) :
+        CppFunction_WithFormals3(OUT (*fun)(U0,U1,U2) , Rcpp::List formals_, const char* docstring = 0) :
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ) ) ) ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0,x1,x2 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 3; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0, U1, U2>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0,U1,U2>(s, name) ; }
         SEXP get_formals(){ return formals; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
         Rcpp::List formals ;
-        OUT (*ptr_fun)(U0, U1, U2) ;
+        OUT (*ptr_fun)(U0,U1,U2) ;
 } ;
 
 template <typename U0, typename U1, typename U2>
-class CppFunction_WithFormals3<void,U0, U1, U2> : public CppFunction {
+class CppFunction_WithFormals3<void,U0,U1,U2> : public CppFunction {
     public:
-        CppFunction_WithFormals3(void (*fun)(U0, U1, U2), Rcpp::List formals_, const char* docstring = 0) :
+        CppFunction_WithFormals3(void (*fun)(U0,U1,U2), Rcpp::List formals_, const char* docstring = 0) :
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            ptr_fun( x0,x1,x2 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 3; }
         inline bool is_void(){ return true; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0, U1, U2>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0,U1,U2>(s, name) ; }
         SEXP get_formals(){ return formals; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
         Rcpp::List formals ;
-        void (*ptr_fun)(U0, U1, U2) ;
+        void (*ptr_fun)(U0,U1,U2) ;
 } ;
 
 
 
-template <typename OUT, typename U0, typename U1, typename U2, typename U3> class CppFunction4 : public CppFunction {
+template <typename OUT, typename U0,typename U1,typename U2,typename U3> class CppFunction4 : public CppFunction {
     public:
 
-        CppFunction4(OUT (*fun)(U0, U1, U2, U3) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction4(OUT (*fun)(U0,U1,U2,U3) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ) ) ) ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0,x1,x2,x3 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 4; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0, U1, U2, U3>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0,U1,U2,U3>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        OUT (*ptr_fun)(U0, U1, U2, U3) ;
+        OUT (*ptr_fun)(U0,U1,U2,U3) ;
 } ;
 
 template <typename U0, typename U1, typename U2, typename U3>
-class CppFunction4<void,U0, U1, U2, U3> : public CppFunction {
+class CppFunction4<void,U0,U1,U2,U3> : public CppFunction {
     public:
-        CppFunction4(void (*fun)(U0, U1, U2, U3) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction4(void (*fun)(U0,U1,U2,U3) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            ptr_fun( x0,x1,x2,x3 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 4; }
         inline bool is_void(){ return true; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0, U1, U2, U3>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0,U1,U2,U3>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        void (*ptr_fun)(U0, U1, U2, U3) ;
+        void (*ptr_fun)(U0,U1,U2,U3) ;
 } ;
 
 
 
-template <typename OUT, typename U0, typename U1, typename U2, typename U3>
+template <typename OUT, typename U0,typename U1,typename U2,typename U3>
 class CppFunction_WithFormals4 : public CppFunction {
     public:
 
-        CppFunction_WithFormals4(OUT (*fun)(U0, U1, U2, U3) , Rcpp::List formals_, const char* docstring = 0) :
+        CppFunction_WithFormals4(OUT (*fun)(U0,U1,U2,U3) , Rcpp::List formals_, const char* docstring = 0) :
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ) ) ) ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0,x1,x2,x3 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 4; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0, U1, U2, U3>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0,U1,U2,U3>(s, name) ; }
         SEXP get_formals(){ return formals; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
         Rcpp::List formals ;
-        OUT (*ptr_fun)(U0, U1, U2, U3) ;
+        OUT (*ptr_fun)(U0,U1,U2,U3) ;
 } ;
 
 template <typename U0, typename U1, typename U2, typename U3>
-class CppFunction_WithFormals4<void,U0, U1, U2, U3> : public CppFunction {
+class CppFunction_WithFormals4<void,U0,U1,U2,U3> : public CppFunction {
     public:
-        CppFunction_WithFormals4(void (*fun)(U0, U1, U2, U3), Rcpp::List formals_, const char* docstring = 0) :
+        CppFunction_WithFormals4(void (*fun)(U0,U1,U2,U3), Rcpp::List formals_, const char* docstring = 0) :
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            ptr_fun( x0,x1,x2,x3 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 4; }
         inline bool is_void(){ return true; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0, U1, U2, U3>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0,U1,U2,U3>(s, name) ; }
         SEXP get_formals(){ return formals; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
         Rcpp::List formals ;
-        void (*ptr_fun)(U0, U1, U2, U3) ;
+        void (*ptr_fun)(U0,U1,U2,U3) ;
 } ;
 
 
 
-template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4> class CppFunction5 : public CppFunction {
+template <typename OUT, typename U0,typename U1,typename U2,typename U3,typename U4> class CppFunction5 : public CppFunction {
     public:
 
-        CppFunction5(OUT (*fun)(U0, U1, U2, U3, U4) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction5(OUT (*fun)(U0,U1,U2,U3,U4) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ) ) ) ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            typename traits::input_parameter< U4 >::type x4( args[4] ) ;
+            
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0,x1,x2,x3,x4 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 5; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0, U1, U2, U3, U4>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0,U1,U2,U3,U4>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        OUT (*ptr_fun)(U0, U1, U2, U3, U4) ;
+        OUT (*ptr_fun)(U0,U1,U2,U3,U4) ;
 } ;
 
 template <typename U0, typename U1, typename U2, typename U3, typename U4>
-class CppFunction5<void,U0, U1, U2, U3, U4> : public CppFunction {
+class CppFunction5<void,U0,U1,U2,U3,U4> : public CppFunction {
     public:
-        CppFunction5(void (*fun)(U0, U1, U2, U3, U4) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction5(void (*fun)(U0,U1,U2,U3,U4) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            typename traits::input_parameter< U4 >::type x4( args[4] ) ;
+            ptr_fun( x0,x1,x2,x3,x4 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 5; }
         inline bool is_void(){ return true; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0, U1, U2, U3, U4>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0,U1,U2,U3,U4>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        void (*ptr_fun)(U0, U1, U2, U3, U4) ;
+        void (*ptr_fun)(U0,U1,U2,U3,U4) ;
 } ;
 
 
 
-template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4>
+template <typename OUT, typename U0,typename U1,typename U2,typename U3,typename U4>
 class CppFunction_WithFormals5 : public CppFunction {
     public:
 
-        CppFunction_WithFormals5(OUT (*fun)(U0, U1, U2, U3, U4) , Rcpp::List formals_, const char* docstring = 0) :
+        CppFunction_WithFormals5(OUT (*fun)(U0,U1,U2,U3,U4) , Rcpp::List formals_, const char* docstring = 0) :
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ) ) ) ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            typename traits::input_parameter< U4 >::type x4( args[4] ) ;
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0,x1,x2,x3,x4 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 5; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0, U1, U2, U3, U4>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0,U1,U2,U3,U4>(s, name) ; }
         SEXP get_formals(){ return formals; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
         Rcpp::List formals ;
-        OUT (*ptr_fun)(U0, U1, U2, U3, U4) ;
+        OUT (*ptr_fun)(U0,U1,U2,U3,U4) ;
 } ;
 
 template <typename U0, typename U1, typename U2, typename U3, typename U4>
-class CppFunction_WithFormals5<void,U0, U1, U2, U3, U4> : public CppFunction {
+class CppFunction_WithFormals5<void,U0,U1,U2,U3,U4> : public CppFunction {
     public:
-        CppFunction_WithFormals5(void (*fun)(U0, U1, U2, U3, U4), Rcpp::List formals_, const char* docstring = 0) :
+        CppFunction_WithFormals5(void (*fun)(U0,U1,U2,U3,U4), Rcpp::List formals_, const char* docstring = 0) :
             CppFunction(docstring), formals(formals_), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            typename traits::input_parameter< U4 >::type x4( args[4] ) ;
+            ptr_fun( x0,x1,x2,x3,x4 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 5; }
         inline bool is_void(){ return true; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0, U1, U2, U3, U4>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0,U1,U2,U3,U4>(s, name) ; }
         SEXP get_formals(){ return formals; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
         Rcpp::List formals ;
-        void (*ptr_fun)(U0, U1, U2, U3, U4) ;
+        void (*ptr_fun)(U0,U1,U2,U3,U4) ;
 } ;
 
 
 
-template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5> class CppFunction6 : public CppFunction {
+template <typename OUT, typename U0,typename U1,typename U2,typename U3,typename U4,typename U5> class CppFunction6 : public CppFunction {
     public:
 
-        CppFunction6(OUT (*fun)(U0, U1, U2, U3, U4, U5) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction6(OUT (*fun)(U0,U1,U2,U3,U4,U5) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            return Rcpp::module_wrap<OUT>( ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ) ) ) ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            typename traits::input_parameter< U4 >::type x4( args[4] ) ;
+            typename traits::input_parameter< U5 >::type x5( args[5] ) ;
+            
+            return Rcpp::module_wrap<OUT>( ptr_fun( x0,x1,x2,x3,x4,x5 ) ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 6; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0, U1, U2, U3, U4, U5>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,U0,U1,U2,U3,U4,U5>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        OUT (*ptr_fun)(U0, U1, U2, U3, U4, U5) ;
+        OUT (*ptr_fun)(U0,U1,U2,U3,U4,U5) ;
 } ;
 
 template <typename U0, typename U1, typename U2, typename U3, typename U4, typename U5>
-class CppFunction6<void,U0, U1, U2, U3, U4, U5> : public CppFunction {
+class CppFunction6<void,U0,U1,U2,U3,U4,U5> : public CppFunction {
     public:
-        CppFunction6(void (*fun)(U0, U1, U2, U3, U4, U5) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
+        CppFunction6(void (*fun)(U0,U1,U2,U3,U4,U5) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
 
         SEXP operator()(SEXP* args) {
-            ptr_fun( Rcpp::as< U0 >( args[0] ), Rcpp::as< U1 >( args[1] ), Rcpp::as< U2 >( args[2] ), Rcpp::as< U3 >( args[3] ), Rcpp::as< U4 >( args[4] ), Rcpp::as< U5 >( args[5] ) ) ;
-            return R_NilValue ;
+            BEGIN_RCPP
+            
+            typename traits::input_parameter< U0 >::type x0( args[0] ) ;
+            typename traits::input_parameter< U1 >::type x1( args[1] ) ;
+            typename traits::input_parameter< U2 >::type x2( args[2] ) ;
+            typename traits::input_parameter< U3 >::type x3( args[3] ) ;
+            typename traits::input_parameter< U4 >::type x4( args[4] ) ;
+            typename traits::input_parameter< U5 >::type x5( args[5] ) ;
+            ptr_fun( x0,x1,x2,x3,x4,x5 ) ;
+            END_RCPP
         }
 
         inline int nargs(){ return 6; }
         inline bool is_void(){ return true; }
-        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0, U1, U2, U3, U4, U5>(s, name) ; }
+        inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,U0,U1,U2,U3,U4,U5>(s, name) ; }
         inline DL_FUNC get_function_ptr(){ return (DL_FUNC)ptr_fun ; }
         
     private:
-        void (*ptr_fun)(U0, U1, U2, U3, U4, U5) ;
+        void (*ptr_fun)(U0,U1,U2,U3,U4,U5) ;
 } ;
 
 
 
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/rcpp -r 4535


More information about the Rcpp-commits mailing list