[Rcpp-commits] r2517 - in pkg/Rcpp: . R inst/include/Rcpp inst/include/Rcpp/module src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Nov 25 12:06:04 CET 2010
Author: romain
Date: 2010-11-25 12:06:04 +0100 (Thu, 25 Nov 2010)
New Revision: 2517
Modified:
pkg/Rcpp/ChangeLog
pkg/Rcpp/R/00_classes.R
pkg/Rcpp/R/Module.R
pkg/Rcpp/inst/include/Rcpp/Module.h
pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h
pkg/Rcpp/inst/include/Rcpp/module/Module_generated_function.h
pkg/Rcpp/src/Module.cpp
Log:
.function with formal argument specification
Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog 2010-11-25 10:31:01 UTC (rev 2516)
+++ pkg/Rcpp/ChangeLog 2010-11-25 11:06:04 UTC (rev 2517)
@@ -1,3 +1,13 @@
+2010-11-25 Romain Francois <romain at r-enthusiasts.com>
+
+ * inst/include/Rcpp/module/Module_generated_function.h: new .function with
+ formal argument specification
+
+ * inst/include/Rcpp/module/Module_generated_CppFunction.h: helper classes
+ for the above
+
+ * R/Module.R: using the formal argument specification if available
+
2010-11-24 Romain Francois <romain at r-enthusiasts.com>
* R/00_classes.R: formals<- method for C++Function that allows to set default
Modified: pkg/Rcpp/R/00_classes.R
===================================================================
--- pkg/Rcpp/R/00_classes.R 2010-11-25 10:31:01 UTC (rev 2516)
+++ pkg/Rcpp/R/00_classes.R 2010-11-25 11:06:04 UTC (rev 2517)
@@ -87,7 +87,7 @@
setClass( "C++Function",
representation(
- pointer = "externalptr",
+ pointer = "externalptr",
docstring = "character",
signature = "character"
),
Modified: pkg/Rcpp/R/Module.R
===================================================================
--- pkg/Rcpp/R/Module.R 2010-11-25 10:31:01 UTC (rev 2516)
+++ pkg/Rcpp/R/Module.R 2010-11-25 11:06:04 UTC (rev 2517)
@@ -75,6 +75,7 @@
fun_ptr <- info[[1L]]
doc <- info[[3L]]
sign <- info[[4L]]
+ formal_args <- info[[5L]]
f <- function(...) NULL
stuff <- list( fun_pointer = fun_ptr, InternalFunction_invoke = InternalFunction_invoke )
body(f) <- if( info[[2]] ) {
@@ -87,7 +88,11 @@
.External( InternalFunction_invoke, fun_pointer, ... )
}, stuff )
}
- new( "C++Function", f, pointer = fun_ptr, docstring = doc, signature = sign )
+ out <- new( "C++Function", f, pointer = fun_ptr, docstring = doc, signature = sign )
+ if( ! is.null( formal_args ) ){
+ formals( out ) <- formal_args
+ }
+ out
} else if( .Call( Module__has_class, pointer, name ) ){
value <- .Call( Module__get_class, pointer, name )
value at generator <- get("refClassGenerators",envir=x)[[as.character(value)]]
Modified: pkg/Rcpp/inst/include/Rcpp/Module.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Module.h 2010-11-25 10:31:01 UTC (rev 2516)
+++ pkg/Rcpp/inst/include/Rcpp/Module.h 2010-11-25 11:06:04 UTC (rev 2517)
@@ -40,7 +40,8 @@
virtual int nargs(){ return 0 ; }
virtual bool is_void(){ return false ; }
virtual const char* signature(const char* name ){ return "" ; }
-
+ virtual SEXP get_formals(){ return R_NilValue; }
+
std::string docstring ;
};
Modified: pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h 2010-11-25 10:31:01 UTC (rev 2516)
+++ pkg/Rcpp/inst/include/Rcpp/module/Module_generated_CppFunction.h 2010-11-25 11:06:04 UTC (rev 2517)
@@ -57,6 +57,41 @@
} ;
+template <typename OUT>
+class CppFunction_WithFormals0 : public CppFunction {
+ public:
+ CppFunction_WithFormals0(OUT (*fun)(void), Rcpp::List, const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){}
+ SEXP operator()(SEXP*) throw(std::range_error) {
+ return Rcpp::wrap( ptr_fun() ) ;
+ }
+
+ inline int nargs(){ return 0; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT>(name) ; }
+
+ private:
+ OUT (*ptr_fun)(void) ;
+} ;
+
+
+template <>
+class CppFunction_WithFormals0<void> : public CppFunction {
+ public:
+ CppFunction_WithFormals0(void (*fun)(void), Rcpp::List, const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){} ;
+
+ SEXP operator()(SEXP*) throw(std::exception) {
+ ptr_fun() ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 0; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type>(name) ; }
+
+ private:
+ void (*ptr_fun)(void) ;
+} ;
+
+
template <typename OUT, typename U0>
class CppFunction1 : public CppFunction {
public:
@@ -94,6 +129,49 @@
+template <typename OUT, typename U0>
+class CppFunction_WithFormals1 : public CppFunction {
+ public:
+
+ CppFunction_WithFormals1(OUT (*fun)(U0) , Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ) ) ) ;
+ }
+
+ inline int nargs(){ return 1; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ OUT (*ptr_fun)(U0) ;
+} ;
+
+template <typename U0>
+class CppFunction_WithFormals1<void,U0> : public CppFunction {
+ public:
+ CppFunction_WithFormals1(void (*fun)(U0), Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 1; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ void (*ptr_fun)(U0) ;
+} ;
+
+
+
template <typename OUT, typename U0, typename U1>
class CppFunction2 : public CppFunction {
public:
@@ -131,6 +209,49 @@
+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(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ) ) ) ;
+ }
+
+ inline int nargs(){ return 2; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ OUT (*ptr_fun)(U0, U1) ;
+} ;
+
+template <typename U0, typename U1>
+class CppFunction_WithFormals2<void,U0, U1> : public CppFunction {
+ public:
+ CppFunction_WithFormals2(void (*fun)(U0, U1), Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 2; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0, U1>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ void (*ptr_fun)(U0, U1) ;
+} ;
+
+
+
template <typename OUT, typename U0, typename U1, typename U2>
class CppFunction3 : public CppFunction {
public:
@@ -168,6 +289,49 @@
+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(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ) ) ) ;
+ }
+
+ inline int nargs(){ return 3; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1, U2>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ OUT (*ptr_fun)(U0, U1, U2) ;
+} ;
+
+template <typename U0, typename U1, typename U2>
+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(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 3; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0, U1, U2>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ void (*ptr_fun)(U0, U1, U2) ;
+} ;
+
+
+
template <typename OUT, typename U0, typename U1, typename U2, typename U3>
class CppFunction4 : public CppFunction {
public:
@@ -205,6 +369,49 @@
+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(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ) ) ) ;
+ }
+
+ inline int nargs(){ return 4; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1, U2, U3>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ 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 {
+ public:
+ 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) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 4; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0, U1, U2, U3>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ void (*ptr_fun)(U0, U1, U2, U3) ;
+} ;
+
+
+
template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4>
class CppFunction5 : public CppFunction {
public:
@@ -242,6 +449,49 @@
+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(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ) ) ) ;
+ }
+
+ inline int nargs(){ return 5; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1, U2, U3, U4>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ 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 {
+ public:
+ 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) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 5; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0, U1, U2, U3, U4>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ 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 {
public:
@@ -279,6 +529,49 @@
+template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5>
+class CppFunction_WithFormals6 : public CppFunction {
+ public:
+
+ CppFunction_WithFormals6(OUT (*fun)(U0, U1, U2, U3, U4, U5) , Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ) ) ) ;
+ }
+
+ inline int nargs(){ return 6; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1, U2, U3, U4, U5>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ OUT (*ptr_fun)(U0, U1, U2, U3, U4, U5) ;
+} ;
+
+template <typename U0, typename U1, typename U2, typename U3, typename U4, typename U5>
+class CppFunction_WithFormals6<void,U0, U1, U2, U3, U4, U5> : public CppFunction {
+ public:
+ CppFunction_WithFormals6(void (*fun)(U0, U1, U2, U3, U4, U5), Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 6; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0, U1, U2, U3, U4, U5>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ void (*ptr_fun)(U0, U1, U2, U3, U4, U5) ;
+} ;
+
+
+
template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6>
class CppFunction7 : public CppFunction {
public:
@@ -316,6 +609,49 @@
+template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6>
+class CppFunction_WithFormals7 : public CppFunction {
+ public:
+
+ CppFunction_WithFormals7(OUT (*fun)(U0, U1, U2, U3, U4, U5, U6) , Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6 >::type >( args[6] ) ) ) ;
+ }
+
+ inline int nargs(){ return 7; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1, U2, U3, U4, U5, U6>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ OUT (*ptr_fun)(U0, U1, U2, U3, U4, U5, U6) ;
+} ;
+
+template <typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6>
+class CppFunction_WithFormals7<void,U0, U1, U2, U3, U4, U5, U6> : public CppFunction {
+ public:
+ CppFunction_WithFormals7(void (*fun)(U0, U1, U2, U3, U4, U5, U6), Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6>::type >( args[6] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 7; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0, U1, U2, U3, U4, U5, U6>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ void (*ptr_fun)(U0, U1, U2, U3, U4, U5, U6) ;
+} ;
+
+
+
template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7>
class CppFunction8 : public CppFunction {
public:
@@ -353,6 +689,49 @@
+template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7>
+class CppFunction_WithFormals8 : public CppFunction {
+ public:
+
+ CppFunction_WithFormals8(OUT (*fun)(U0, U1, U2, U3, U4, U5, U6, U7) , Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6 >::type >( args[6] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U7 >::type >( args[7] ) ) ) ;
+ }
+
+ inline int nargs(){ return 8; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1, U2, U3, U4, U5, U6, U7>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ OUT (*ptr_fun)(U0, U1, U2, U3, U4, U5, U6, U7) ;
+} ;
+
+template <typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7>
+class CppFunction_WithFormals8<void,U0, U1, U2, U3, U4, U5, U6, U7> : public CppFunction {
+ public:
+ CppFunction_WithFormals8(void (*fun)(U0, U1, U2, U3, U4, U5, U6, U7), Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6>::type >( args[6] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U7>::type >( args[7] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 8; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0, U1, U2, U3, U4, U5, U6, U7>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ void (*ptr_fun)(U0, U1, U2, U3, U4, U5, U6, U7) ;
+} ;
+
+
+
template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8>
class CppFunction9 : public CppFunction {
public:
@@ -390,6 +769,49 @@
+template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8>
+class CppFunction_WithFormals9 : public CppFunction {
+ public:
+
+ CppFunction_WithFormals9(OUT (*fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8) , Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6 >::type >( args[6] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U7 >::type >( args[7] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U8 >::type >( args[8] ) ) ) ;
+ }
+
+ inline int nargs(){ return 9; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ OUT (*ptr_fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8) ;
+} ;
+
+template <typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8>
+class CppFunction_WithFormals9<void,U0, U1, U2, U3, U4, U5, U6, U7, U8> : public CppFunction {
+ public:
+ CppFunction_WithFormals9(void (*fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8), Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6>::type >( args[6] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U7>::type >( args[7] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U8>::type >( args[8] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 9; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0, U1, U2, U3, U4, U5, U6, U7, U8>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ void (*ptr_fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8) ;
+} ;
+
+
+
template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9>
class CppFunction10 : public CppFunction {
public:
@@ -427,6 +849,49 @@
+template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9>
+class CppFunction_WithFormals10 : public CppFunction {
+ public:
+
+ CppFunction_WithFormals10(OUT (*fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8, U9) , Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6 >::type >( args[6] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U7 >::type >( args[7] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U8 >::type >( args[8] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U9 >::type >( args[9] ) ) ) ;
+ }
+
+ inline int nargs(){ return 10; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ OUT (*ptr_fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8, U9) ;
+} ;
+
+template <typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9>
+class CppFunction_WithFormals10<void,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9> : public CppFunction {
+ public:
+ CppFunction_WithFormals10(void (*fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8, U9), Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception) {
+ ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0>::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1>::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2>::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3>::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4>::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5>::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6>::type >( args[6] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U7>::type >( args[7] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U8>::type >( args[8] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U9>::type >( args[9] ) ) ;
+ return R_NilValue ;
+ }
+
+ inline int nargs(){ return 10; }
+ inline bool is_void(){ return true; }
+ const char* signature(const char* name){ return Rcpp::signature<void_type,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ void (*ptr_fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8, U9) ;
+} ;
+
+
+
template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9, typename U10>
class CppFunction11 : public CppFunction {
public:
@@ -464,6 +929,49 @@
+template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9, typename U10>
+class CppFunction_WithFormals11 : public CppFunction {
+ public:
+
+ CppFunction_WithFormals11(OUT (*fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10) , Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception){
+ return Rcpp::wrap( ptr_fun( Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U0 >::type >( args[0] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U1 >::type >( args[1] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U2 >::type >( args[2] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U3 >::type >( args[3] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U4 >::type >( args[4] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U5 >::type >( args[5] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U6 >::type >( args[6] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U7 >::type >( args[7] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U8 >::type >( args[8] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U9 >::type >( args[9] ), Rcpp::as< typename Rcpp::traits::remove_const_and_reference< U10 >::type >( args[10] ) ) ) ;
+ }
+
+ inline int nargs(){ return 11; }
+ const char* signature(const char* name){ return Rcpp::signature<OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10>(name) ; }
+ SEXP get_formals(){ return formals; }
+
+ private:
+ Rcpp::List formals ;
+ OUT (*ptr_fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10) ;
+} ;
+
+template <typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9, typename U10>
+class CppFunction_WithFormals11<void,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10> : public CppFunction {
+ public:
+ CppFunction_WithFormals11(void (*fun)(U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10), Rcpp::List formals_, const char* docstring = 0) :
+ CppFunction(docstring), formals(formals_), ptr_fun(fun){}
+
+ SEXP operator()(SEXP* args) throw(std::exception) {
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/rcpp -r 2517
More information about the Rcpp-commits
mailing list