[Rcpp-commits] r2772 - scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 12 09:52:22 CET 2010


Author: romain
Date: 2010-12-12 09:52:20 +0100 (Sun, 12 Dec 2010)
New Revision: 2772

Modified:
   scripts/generator_Module_CppFunction.R
   scripts/generator_Module_CppMethod.R
   scripts/generator_Module_PointerCppMethod.R
   scripts/generator_Module_signature.R
   scripts/stats.R
Log:
update the generators

Modified: scripts/generator_Module_CppFunction.R
===================================================================
--- scripts/generator_Module_CppFunction.R	2010-12-12 00:37:51 UTC (rev 2771)
+++ scripts/generator_Module_CppFunction.R	2010-12-12 08:52:20 UTC (rev 2772)
@@ -16,7 +16,7 @@
 		}
 		
 		inline int nargs(){ return %d; }
-		const char* signature(const char* name){ return Rcpp::signature<OUT,%s>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,%s>(s, name) ; }
 		
 	private:
 		OUT (*ptr_fun)(%s) ;	
@@ -34,7 +34,7 @@
 		
 		inline int nargs(){ return %d; }
 		inline bool is_void(){ return true; }
-		const char* signature(const char* name){ return Rcpp::signature<void_type,%s>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,%s>(s, name) ; }
 		
 	private:
 		void (*ptr_fun)(%s) ;	
@@ -54,7 +54,7 @@
 		}
 		
 		inline int nargs(){ return %d; }
-		const char* signature(const char* name){ return Rcpp::signature<OUT,%s>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,%s>(s, name) ; }
 		SEXP get_formals(){ return formals; }
 		
 	private:
@@ -75,7 +75,7 @@
 		
 		inline int nargs(){ return %d; }
 		inline bool is_void(){ return true; }
-		const char* signature(const char* name){ return Rcpp::signature<void_type,%s>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,%s>(s, name) ; }
 		SEXP get_formals(){ return formals; }
 		
 	private:
@@ -162,7 +162,7 @@
 		}
 		
 		inline int nargs(){ return 0; }
-		const char* signature(const char* name){ return Rcpp::signature<OUT>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT>(s, name) ; }
 		
 	private:
 		OUT (*ptr_fun)(void) ;	                    
@@ -181,7 +181,7 @@
 		
 		inline int nargs(){ return 0; }
 		inline bool is_void(){ return true; }
-		const char* signature(const char* name){ return Rcpp::signature<void_type>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type>(s, name) ; }
 		
 	private:
 		void (*ptr_fun)(void) ;	
@@ -197,7 +197,7 @@
 		}
 		
 		inline int nargs(){ return 0; }
-		const char* signature(const char* name){ return Rcpp::signature<OUT>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT>(s, name) ; }
 		
 	private:
 		OUT (*ptr_fun)(void) ;	                    
@@ -216,7 +216,7 @@
 		
 		inline int nargs(){ return 0; }
 		inline bool is_void(){ return true; }
-		const char* signature(const char* name){ return Rcpp::signature<void_type>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type>(s, name) ; }
 		
 	private:
 		void (*ptr_fun)(void) ;	

Modified: scripts/generator_Module_CppMethod.R
===================================================================
--- scripts/generator_Module_CppMethod.R	2010-12-12 00:37:51 UTC (rev 2771)
+++ scripts/generator_Module_CppMethod.R	2010-12-12 08:52:20 UTC (rev 2772)
@@ -24,8 +24,8 @@
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return false ; }
 		inline bool is_const(){ return false ; }
+		inline void signature(std::string& s, const char* name ){ Rcpp::signature<OUT,%s>(s, name) ; }
 		
-		const char* signature(const char* name ){ return Rcpp::signature<OUT,%s>(name) ; }
 	private:
 		Method met ;
 	} ;
@@ -43,7 +43,7 @@
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return true ; }
 		inline bool is_const(){ return false ; }
-		const char* signature(const char* name ){ return Rcpp::signature<void_type,%s>(name) ; }
+		inline void signature(std::string& s, const char* name ){ Rcpp::signature<void_type,%s>(s, name) ; }
 	private:
 		Method met ;
 	} ;
@@ -62,7 +62,7 @@
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return false ; }
 		inline bool is_const(){ return true ; }
-		const char* signature(const char* name ){ return Rcpp::signature<OUT,%s>(name) ; }
+		inline void signature(std::string& s, const char* name ){ Rcpp::signature<OUT,%s>(s, name) ; }
 		
 	private:
 		Method met ;
@@ -81,7 +81,7 @@
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return true ; }
 		inline bool is_const(){ return true ; }
-		const char* signature(const char* name ){ return Rcpp::signature<void_type,%s>(name) ; }
+		inline void signature(std::string& s, const char* name ){ Rcpp::signature<void_type,%s>(s, name) ; }
 		
 	private:
 		Method met ;
@@ -164,7 +164,7 @@
 		inline int nargs(){ return 0 ; }
 		inline bool is_void(){ return false ; }
 		inline bool is_const(){ return false ; }
-		const char* signature(const char* name){ return Rcpp::signature<OUT>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT>(s, name) ; }
 		
 	private:
 		Method met ;
@@ -182,7 +182,7 @@
 		inline int nargs(){ return 0 ; }
 		inline bool is_void(){ return true ; }
 		inline bool is_const(){ return false ; }
-		const char* signature(const char* name){ return Rcpp::signature<void_type>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type>(s, name) ; }
 		
 	private:
 		Method met ;
@@ -199,7 +199,7 @@
 		inline int nargs(){ return 0 ; }
 		inline bool is_void(){ return false ; }
 		inline bool is_const(){ return true ; }
-		const char* signature(const char* name){ return Rcpp::signature<OUT>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT>(s, name) ; }
 		
 	private:
 		Method met ;
@@ -217,7 +217,7 @@
 		inline int nargs(){ return 0 ; }
 		inline bool is_void(){ return true ; }
 		inline bool is_const(){ return true ; }
-		const char* signature(const char* name){ return Rcpp::signature<void_type>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type>(s, name) ; }
 		
 	private:
 		Method met ;

Modified: scripts/generator_Module_PointerCppMethod.R
===================================================================
--- scripts/generator_Module_PointerCppMethod.R	2010-12-12 00:37:51 UTC (rev 2771)
+++ scripts/generator_Module_PointerCppMethod.R	2010-12-12 08:52:20 UTC (rev 2772)
@@ -24,7 +24,7 @@
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return false ; }
 		inline bool is_const(){ return false ; }
-		const char* signature(const char* name){ return Rcpp::signature<OUT,%s>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT,%s>(s, name) ; }
 		
 	private:
 		Method met ;
@@ -43,7 +43,7 @@
 		inline int nargs(){ return %d ; }
 		inline bool is_void(){ return true ; }
 		inline bool is_const(){ return false ; }
-		const char* signature(const char* name){ return Rcpp::signature<void_type,%s>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type,%s>(s, name) ; }
 		
 	private:
 		Method met ;
@@ -77,7 +77,7 @@
 //
 // Module_generated_CppMethod.h: Rcpp R/C++ interface class library -- Rcpp modules
 //
-// Copyright (C) 2010	Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2010	Doug Bates, Dirk Eddelbuettel and Romain Francois
 //
 // This file is part of Rcpp.
 //
@@ -109,7 +109,7 @@
 		inline int nargs(){ return 0 ; }
 		inline bool is_void(){ return false ; }
 		inline bool is_const(){ return false ; }
-		const char* signature(const char* name){ return Rcpp::signature<OUT>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<OUT>(s, name) ; }
 		
 	private:
 		Method met ;
@@ -128,7 +128,7 @@
 		inline bool is_void(){ return true ; }
 		inline bool is_const(){ return false ; }
     
-		const char* signature(const char* name){ return Rcpp::signature<void_type>(name) ; }
+		inline void signature(std::string& s, const char* name){ Rcpp::signature<void_type>(s, name) ; }
 		
 	private:
 		Method met ;

Modified: scripts/generator_Module_signature.R
===================================================================
--- scripts/generator_Module_signature.R	2010-12-12 00:37:51 UTC (rev 2771)
+++ scripts/generator_Module_signature.R	2010-12-12 08:52:20 UTC (rev 2772)
@@ -13,8 +13,8 @@
 txt <- sprintf( '
 
 template <typename OUT,%s>
-inline const char* signature(const char* name){
-    std::string s ;
+inline void signature(std::string& s, const char* name){
+    s.clear() ;
     s += get_return_type<OUT>() ;
     s += " " ;
     s += name ;
@@ -22,7 +22,6 @@
     s += get_return_type<U0>() ;
 %s
     s += ")" ; 
-    return s.c_str() ;
 }
 
 
@@ -38,7 +37,7 @@
 //
 // Module_generated_get_signature.h: Rcpp R/C++ interface class library --
 //
-// Copyright (C) 2010	Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2010	Doug Bates, Dirk Eddelbuettel and Romain Francois
 //
 // This file is part of Rcpp.
 //
@@ -59,26 +58,24 @@
 #define Rcpp_Module_generated_get_signature_h
 
 template <typename OUT>
-inline const char* signature(const std::string& name){
-    std::string s ;
+inline void signature(std::string& s, const char* name){
+    s.clear() ;
     s += get_return_type<OUT>() ;
     s += " " ;
     s += name ;
     s += "()" ;
-    return s.c_str() ;
 }
 
 
 template <typename OUT,typename U0>
-inline const char* signature(const std::string& name){
-    std::string s ;
+inline void signature(std::string& s, const char* name){
+    s.clear() ;
     s += get_return_type<OUT>() ;
     s += " " ;
     s += name ;
     s += "(" ;
     s += get_return_type<U0>() ;
     s += ")" ; 
-    return s.c_str() ;
 }
 
 %s

Modified: scripts/stats.R
===================================================================
--- scripts/stats.R	2010-12-12 00:37:51 UTC (rev 2771)
+++ scripts/stats.R	2010-12-12 08:52:20 UTC (rev 2772)
@@ -225,7 +225,7 @@
 
 # cook( "nchisq", params = list(
 # 	"df" = list( type = "double" ), 
-# 	"ncp" = list( type = "double" )
+# 	"ncp" = list( type = "double" )                  
 # ) )
  
 # cook( "nbeta", params = list( 



More information about the Rcpp-commits mailing list