[Rcpp-commits] r3823 - scripts
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Oct 23 17:53:48 CEST 2012
Author: romain
Date: 2012-10-23 17:53:48 +0200 (Tue, 23 Oct 2012)
New Revision: 3823
Modified:
scripts/generator_Module_CppFunction.R
scripts/generator_Module_CppMethod.R
scripts/generator_Module_PointerCppMethod.R
Log:
more flexible module_wrap
Modified: scripts/generator_Module_CppFunction.R
===================================================================
--- scripts/generator_Module_CppFunction.R 2012-10-23 15:12:34 UTC (rev 3822)
+++ scripts/generator_Module_CppFunction.R 2012-10-23 15:53:48 UTC (rev 3823)
@@ -11,7 +11,7 @@
CppFunction%d(OUT (*fun)(%s) , const char* docstring = 0) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- return Rcpp::wrap( ptr_fun( %s ) ) ;
+ return Rcpp::module_wrap<OUT>( ptr_fun( %s ) ) ;
}
inline int nargs(){ return %d; }
@@ -49,7 +49,7 @@
CppFunction(docstring), formals(formals_), ptr_fun(fun){}
SEXP operator()(SEXP* args) {
- return Rcpp::wrap( ptr_fun( %s ) ) ;
+ return Rcpp::module_wrap<OUT>( ptr_fun( %s ) ) ;
}
inline int nargs(){ return %d; }
@@ -132,7 +132,7 @@
//
// Module_generated_CppFunction.h: Rcpp R/C++ interface class library -- Rcpp modules
//
-// Copyright (C) 2010 Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2010-2012 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
@@ -157,7 +157,7 @@
public:
CppFunction0(OUT (*fun)(void), const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP*) {
- return Rcpp::wrap( ptr_fun() ) ;
+ return Rcpp::module_wrap<OUT>( ptr_fun() ) ;
}
inline int nargs(){ return 0; }
@@ -192,7 +192,7 @@
public:
CppFunction_WithFormals0(OUT (*fun)(void), Rcpp::List, const char* docstring = 0 ) : CppFunction(docstring), ptr_fun(fun){}
SEXP operator()(SEXP*) {
- return Rcpp::wrap( ptr_fun() ) ;
+ return Rcpp::module_wrap<OUT>( ptr_fun() ) ;
}
inline int nargs(){ return 0; }
Modified: scripts/generator_Module_CppMethod.R
===================================================================
--- scripts/generator_Module_CppMethod.R 2012-10-23 15:12:34 UTC (rev 3822)
+++ scripts/generator_Module_CppMethod.R 2012-10-23 15:53:48 UTC (rev 3823)
@@ -19,7 +19,7 @@
CppMethod%d(Method m) : method_class(), met(m) {}
SEXP operator()( Class* object, SEXP* args){
- return Rcpp::module_wrap<Class,OUT>( (object->*met)( %s ) ) ;
+ return Rcpp::module_wrap<OUT>( (object->*met)( %s ) ) ;
}
inline int nargs(){ return %d ; }
inline bool is_void(){ return false ; }
@@ -59,7 +59,7 @@
const_CppMethod%d(Method m) : method_class(), met(m){}
SEXP operator()( Class* object, SEXP* args){
- return Rcpp::module_wrap<Class,OUT>( (object->*met)( %s ) ) ;
+ return Rcpp::module_wrap<OUT>( (object->*met)( %s ) ) ;
}
inline int nargs(){ return %d ; }
inline bool is_void(){ return false ; }
@@ -160,7 +160,7 @@
typedef CppMethod<Class> method_class ;
CppMethod0( Method m) : method_class(), met(m){}
SEXP operator()( Class* object, SEXP*){
- return Rcpp::module_wrap<Class,OUT>( (object->*met)( ) ) ;
+ return Rcpp::module_wrap<OUT>( (object->*met)( ) ) ;
}
inline int nargs(){ return 0 ; }
inline bool is_void(){ return false ; }
@@ -195,7 +195,7 @@
typedef CppMethod<Class> method_class ;
const_CppMethod0( Method m) : method_class(), met(m){}
SEXP operator()( Class* object, SEXP* ){
- return Rcpp::module_wrap<Class,OUT>( (object->*met)( ) ) ;
+ return Rcpp::module_wrap<OUT>( (object->*met)( ) ) ;
}
inline int nargs(){ return 0 ; }
inline bool is_void(){ return false ; }
Modified: scripts/generator_Module_PointerCppMethod.R
===================================================================
--- scripts/generator_Module_PointerCppMethod.R 2012-10-23 15:12:34 UTC (rev 3822)
+++ scripts/generator_Module_PointerCppMethod.R 2012-10-23 15:53:48 UTC (rev 3823)
@@ -19,7 +19,7 @@
Pointer_CppMethod%d(Method m) : method_class(), met(m){}
SEXP operator()( Class* object, SEXP* args){
- return Rcpp::module_wrap<Class,OUT>( met( object, %s ) ) ;
+ return Rcpp::module_wrap<OUT>( met( object, %s ) ) ;
}
inline int nargs(){ return %d ; }
inline bool is_void(){ return false ; }
@@ -59,7 +59,7 @@
Const_Pointer_CppMethod%d(Method m) : method_class(), met(m){}
SEXP operator()( Class* object, SEXP* args){
- return Rcpp::module_wrap<Class,OUT>( met( object, %s ) ) ;
+ return Rcpp::module_wrap<OUT>( met( object, %s ) ) ;
}
inline int nargs(){ return %d ; }
inline bool is_void(){ return false ; }
@@ -164,7 +164,7 @@
typedef CppMethod<Class> method_class ;
Pointer_CppMethod0( Method m) : method_class(), met(m){}
SEXP operator()( Class* object, SEXP* ){
- return Rcpp::module_wrap<Class,OUT>( met(object) ) ;
+ return Rcpp::module_wrap<OUT>( met(object) ) ;
}
inline int nargs(){ return 0 ; }
inline bool is_void(){ return false ; }
@@ -203,7 +203,7 @@
typedef CppMethod<Class> method_class ;
Const_Pointer_CppMethod0( Method m) : method_class(), met(m){}
SEXP operator()( Class* object, SEXP* ){
- return Rcpp::module_wrap<Class,OUT>( met(object) ) ;
+ return Rcpp::module_wrap<OUT>( met(object) ) ;
}
inline int nargs(){ return 0 ; }
inline bool is_void(){ return false ; }
More information about the Rcpp-commits
mailing list