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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Nov 18 21:17:46 CET 2010


Author: romain
Date: 2010-11-18 21:17:45 +0100 (Thu, 18 Nov 2010)
New Revision: 2445

Modified:
   pkg/Rcpp/inst/include/Rcpp/Module.h
   pkg/Rcpp/inst/include/Rcpp/module/Module_generated_method.h
Log:
pass down the validator for dispatch

Modified: pkg/Rcpp/inst/include/Rcpp/Module.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Module.h	2010-11-18 20:17:03 UTC (rev 2444)
+++ pkg/Rcpp/inst/include/Rcpp/Module.h	2010-11-18 20:17:45 UTC (rev 2445)
@@ -199,16 +199,6 @@
     }
 } ;
 
-// template <typename Class>
-// class S4_CppMethod : public Rcpp::Reference {
-// public:             
-//     S4_CppMethod( CppMethod<Class>* m, SEXP class_xp ) : Reference( "C++Method" ){
-//         field( "void" )          = m->is_void() ;
-//         field( "pointer" )       = Rcpp::XPtr< CppMethod<Class> >( m, false ) ;
-//         field( "class_pointer" ) = class_xp ;
-//     }
-// } ;
-
 template <typename Class>
 class S4_CppOverloadedMethods : public Rcpp::Reference {
 public:    
@@ -350,7 +340,6 @@
 		    }
 		}
 		
-		// maybe this is not needed as the R side handles it
 		if( m == 0 ){
 		    throw std::range_error( "could not find valid method" ) ; 	
 		}
@@ -363,12 +352,12 @@
 		END_RCPP	
 	}
 	
-	self& AddMethod( const char* name_, method_class* m){
+	self& AddMethod( const char* name_, method_class* m, ValidMethod valid = &yes ){
 		typename map_vec_signed_method::iterator it = singleton->vec_methods.find( name_ ) ; 
 	    if( it == singleton->vec_methods.end() ){
 	        it = singleton->vec_methods.insert( vec_signed_method_pair( name_, new vec_signed_method() ) ).first ;
 	    } 
-		(it->second)->push_back( new signed_method_class(m, &yes ) ) ;
+		(it->second)->push_back( new signed_method_class(m, valid ) ) ;
 		if( *name_ == '[' ) singleton->specials++ ;
 		return *this ;
 	}

Modified: pkg/Rcpp/inst/include/Rcpp/module/Module_generated_method.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/module/Module_generated_method.h	2010-11-18 20:17:03 UTC (rev 2444)
+++ pkg/Rcpp/inst/include/Rcpp/module/Module_generated_method.h	2010-11-18 20:17:45 UTC (rev 2445)
@@ -23,25 +23,25 @@
 #define Rcpp_Module_generated_method_h
 
 	template <typename OUT>
-	self& method( const char* name_, OUT (Class::*fun)(void) ){
+	self& method( const char* name_, OUT (Class::*fun)(void), ValidMethod valid = &yes ){
 		AddMethod( name_, new CppMethod0<Class,OUT>( fun ) ) ;
   		return *this ;
 	}
 	
 	template <typename OUT>
-	self& method( const char* name_, OUT (Class::*fun)(void) const ){
+	self& method( const char* name_, OUT (Class::*fun)(void) const, ValidMethod valid = &yes ){
 		AddMethod( name_, new const_CppMethod0<Class,OUT>( fun ) ) ;
   		return *this ;
 	}
 
 	
 	template <typename OUT>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(void) ){
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(void), ValidMethod valid = &yes ){
 		AddMethod( name_, new CppMethod0<Class,OUT>( fun ) ) ;
   		return *this ;
 	}
 	template <typename OUT>
-	self& const_method( const char* name_, OUT (Class::*fun)(void) const ){
+	self& const_method( const char* name_, OUT (Class::*fun)(void) const, ValidMethod valid = &yes ){
 		AddMethod( name_, new const_CppMethod0<Class,OUT>( fun ) ) ;
   		return *this ;
 	}
@@ -50,26 +50,26 @@
 
 
 	template <typename OUT, typename U0>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0) ){
-		AddMethod( name_, new CppMethod1<Class,OUT,U0>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0), ValidMethod valid = &yes_arity<1> ){
+		AddMethod( name_, new CppMethod1<Class,OUT,U0>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0) const ){
-		AddMethod( name_, new const_CppMethod1<Class,OUT,U0>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0) const, ValidMethod valid = &yes_arity<1> ){
+		AddMethod( name_, new const_CppMethod1<Class,OUT,U0>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0) ){
-		AddMethod( name_, new CppMethod1<Class,OUT,U0>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0), ValidMethod valid = &yes_arity<1> ){
+		AddMethod( name_, new CppMethod1<Class,OUT,U0>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0) const ){
-		AddMethod( name_, new const_CppMethod1<Class,OUT,U0>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0) const , ValidMethod valid = &yes_arity<1>){
+		AddMethod( name_, new const_CppMethod1<Class,OUT,U0>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -77,26 +77,26 @@
 
 
 	template <typename OUT, typename U0, typename U1>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1) ){
-		AddMethod( name_, new CppMethod2<Class,OUT,U0, U1>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1), ValidMethod valid = &yes_arity<2> ){
+		AddMethod( name_, new CppMethod2<Class,OUT,U0, U1>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1) const ){
-		AddMethod( name_, new const_CppMethod2<Class,OUT,U0, U1>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1) const, ValidMethod valid = &yes_arity<2> ){
+		AddMethod( name_, new const_CppMethod2<Class,OUT,U0, U1>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0, typename U1>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1) ){
-		AddMethod( name_, new CppMethod2<Class,OUT,U0, U1>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1), ValidMethod valid = &yes_arity<2> ){
+		AddMethod( name_, new CppMethod2<Class,OUT,U0, U1>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1) const ){
-		AddMethod( name_, new const_CppMethod2<Class,OUT,U0, U1>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1) const , ValidMethod valid = &yes_arity<2>){
+		AddMethod( name_, new const_CppMethod2<Class,OUT,U0, U1>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -104,26 +104,26 @@
 
 
 	template <typename OUT, typename U0, typename U1, typename U2>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2) ){
-		AddMethod( name_, new CppMethod3<Class,OUT,U0, U1, U2>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2), ValidMethod valid = &yes_arity<3> ){
+		AddMethod( name_, new CppMethod3<Class,OUT,U0, U1, U2>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2) const ){
-		AddMethod( name_, new const_CppMethod3<Class,OUT,U0, U1, U2>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2) const, ValidMethod valid = &yes_arity<3> ){
+		AddMethod( name_, new const_CppMethod3<Class,OUT,U0, U1, U2>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0, typename U1, typename U2>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2) ){
-		AddMethod( name_, new CppMethod3<Class,OUT,U0, U1, U2>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2), ValidMethod valid = &yes_arity<3> ){
+		AddMethod( name_, new CppMethod3<Class,OUT,U0, U1, U2>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2) const ){
-		AddMethod( name_, new const_CppMethod3<Class,OUT,U0, U1, U2>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2) const , ValidMethod valid = &yes_arity<3>){
+		AddMethod( name_, new const_CppMethod3<Class,OUT,U0, U1, U2>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -131,26 +131,26 @@
 
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3) ){
-		AddMethod( name_, new CppMethod4<Class,OUT,U0, U1, U2, U3>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3), ValidMethod valid = &yes_arity<4> ){
+		AddMethod( name_, new CppMethod4<Class,OUT,U0, U1, U2, U3>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3) const ){
-		AddMethod( name_, new const_CppMethod4<Class,OUT,U0, U1, U2, U3>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3) const, ValidMethod valid = &yes_arity<4> ){
+		AddMethod( name_, new const_CppMethod4<Class,OUT,U0, U1, U2, U3>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3) ){
-		AddMethod( name_, new CppMethod4<Class,OUT,U0, U1, U2, U3>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3), ValidMethod valid = &yes_arity<4> ){
+		AddMethod( name_, new CppMethod4<Class,OUT,U0, U1, U2, U3>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3) const ){
-		AddMethod( name_, new const_CppMethod4<Class,OUT,U0, U1, U2, U3>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3) const , ValidMethod valid = &yes_arity<4>){
+		AddMethod( name_, new const_CppMethod4<Class,OUT,U0, U1, U2, U3>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -158,26 +158,26 @@
 
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4) ){
-		AddMethod( name_, new CppMethod5<Class,OUT,U0, U1, U2, U3, U4>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4), ValidMethod valid = &yes_arity<5> ){
+		AddMethod( name_, new CppMethod5<Class,OUT,U0, U1, U2, U3, U4>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4) const ){
-		AddMethod( name_, new const_CppMethod5<Class,OUT,U0, U1, U2, U3, U4>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4) const, ValidMethod valid = &yes_arity<5> ){
+		AddMethod( name_, new const_CppMethod5<Class,OUT,U0, U1, U2, U3, U4>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4) ){
-		AddMethod( name_, new CppMethod5<Class,OUT,U0, U1, U2, U3, U4>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4), ValidMethod valid = &yes_arity<5> ){
+		AddMethod( name_, new CppMethod5<Class,OUT,U0, U1, U2, U3, U4>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4) const ){
-		AddMethod( name_, new const_CppMethod5<Class,OUT,U0, U1, U2, U3, U4>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4) const , ValidMethod valid = &yes_arity<5>){
+		AddMethod( name_, new const_CppMethod5<Class,OUT,U0, U1, U2, U3, U4>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -185,26 +185,26 @@
 
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5) ){
-		AddMethod( name_, new CppMethod6<Class,OUT,U0, U1, U2, U3, U4, U5>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5), ValidMethod valid = &yes_arity<6> ){
+		AddMethod( name_, new CppMethod6<Class,OUT,U0, U1, U2, U3, U4, U5>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5) const ){
-		AddMethod( name_, new const_CppMethod6<Class,OUT,U0, U1, U2, U3, U4, U5>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5) const, ValidMethod valid = &yes_arity<6> ){
+		AddMethod( name_, new const_CppMethod6<Class,OUT,U0, U1, U2, U3, U4, U5>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5) ){
-		AddMethod( name_, new CppMethod6<Class,OUT,U0, U1, U2, U3, U4, U5>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5), ValidMethod valid = &yes_arity<6> ){
+		AddMethod( name_, new CppMethod6<Class,OUT,U0, U1, U2, U3, U4, U5>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5) const ){
-		AddMethod( name_, new const_CppMethod6<Class,OUT,U0, U1, U2, U3, U4, U5>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5) const , ValidMethod valid = &yes_arity<6>){
+		AddMethod( name_, new const_CppMethod6<Class,OUT,U0, U1, U2, U3, U4, U5>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -212,26 +212,26 @@
 
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6) ){
-		AddMethod( name_, new CppMethod7<Class,OUT,U0, U1, U2, U3, U4, U5, U6>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6), ValidMethod valid = &yes_arity<7> ){
+		AddMethod( name_, new CppMethod7<Class,OUT,U0, U1, U2, U3, U4, U5, U6>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6) const ){
-		AddMethod( name_, new const_CppMethod7<Class,OUT,U0, U1, U2, U3, U4, U5, U6>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6) const, ValidMethod valid = &yes_arity<7> ){
+		AddMethod( name_, new const_CppMethod7<Class,OUT,U0, U1, U2, U3, U4, U5, U6>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6) ){
-		AddMethod( name_, new CppMethod7<Class,OUT,U0, U1, U2, U3, U4, U5, U6>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6), ValidMethod valid = &yes_arity<7> ){
+		AddMethod( name_, new CppMethod7<Class,OUT,U0, U1, U2, U3, U4, U5, U6>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6) const ){
-		AddMethod( name_, new const_CppMethod7<Class,OUT,U0, U1, U2, U3, U4, U5, U6>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6) const , ValidMethod valid = &yes_arity<7>){
+		AddMethod( name_, new const_CppMethod7<Class,OUT,U0, U1, U2, U3, U4, U5, U6>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -239,26 +239,26 @@
 
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7) ){
-		AddMethod( name_, new CppMethod8<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7), ValidMethod valid = &yes_arity<8> ){
+		AddMethod( name_, new CppMethod8<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7) const ){
-		AddMethod( name_, new const_CppMethod8<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7) const, ValidMethod valid = &yes_arity<8> ){
+		AddMethod( name_, new const_CppMethod8<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7) ){
-		AddMethod( name_, new CppMethod8<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7), ValidMethod valid = &yes_arity<8> ){
+		AddMethod( name_, new CppMethod8<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7) const ){
-		AddMethod( name_, new const_CppMethod8<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7) const , ValidMethod valid = &yes_arity<8>){
+		AddMethod( name_, new const_CppMethod8<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -266,26 +266,26 @@
 
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8) ){
-		AddMethod( name_, new CppMethod9<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8), ValidMethod valid = &yes_arity<9> ){
+		AddMethod( name_, new CppMethod9<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8) const ){
-		AddMethod( name_, new const_CppMethod9<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8) const, ValidMethod valid = &yes_arity<9> ){
+		AddMethod( name_, new const_CppMethod9<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8) ){
-		AddMethod( name_, new CppMethod9<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8), ValidMethod valid = &yes_arity<9> ){
+		AddMethod( name_, new CppMethod9<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8) const ){
-		AddMethod( name_, new const_CppMethod9<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8) const , ValidMethod valid = &yes_arity<9>){
+		AddMethod( name_, new const_CppMethod9<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -293,26 +293,26 @@
 
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9) ){
-		AddMethod( name_, new CppMethod10<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9), ValidMethod valid = &yes_arity<10> ){
+		AddMethod( name_, new CppMethod10<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9) const ){
-		AddMethod( name_, new const_CppMethod10<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9) const, ValidMethod valid = &yes_arity<10> ){
+		AddMethod( name_, new const_CppMethod10<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>( fun ), valid ) ;
   		return *this ;
 	}
 
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9) ){
-		AddMethod( name_, new CppMethod10<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9), ValidMethod valid = &yes_arity<10> ){
+		AddMethod( name_, new CppMethod10<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	template <typename OUT, typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9) const ){
-		AddMethod( name_, new const_CppMethod10<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9) const , ValidMethod valid = &yes_arity<10>){
+		AddMethod( name_, new const_CppMethod10<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -320,26 +320,26 @@
 
 
 	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>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10) ){
-		AddMethod( name_, new CppMethod11<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10), ValidMethod valid = &yes_arity<11> ){
+		AddMethod( name_, new CppMethod11<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	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>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10) const ){
-		AddMethod( name_, new const_CppMethod11<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10) const, ValidMethod valid = &yes_arity<11> ){
+		AddMethod( name_, new const_CppMethod11<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10>( fun ), valid ) ;
   		return *this ;
 	}
 
 	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>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10) ){
-		AddMethod( name_, new CppMethod11<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10), ValidMethod valid = &yes_arity<11> ){
+		AddMethod( name_, new CppMethod11<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	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>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10) const ){
-		AddMethod( name_, new const_CppMethod11<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10) const , ValidMethod valid = &yes_arity<11>){
+		AddMethod( name_, new const_CppMethod11<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -347,26 +347,26 @@
 
 
 	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, typename U11>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11) ){
-		AddMethod( name_, new CppMethod12<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11), ValidMethod valid = &yes_arity<12> ){
+		AddMethod( name_, new CppMethod12<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	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, typename U11>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11) const ){
-		AddMethod( name_, new const_CppMethod12<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11) const, ValidMethod valid = &yes_arity<12> ){
+		AddMethod( name_, new const_CppMethod12<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11>( fun ), valid ) ;
   		return *this ;
 	}
 
 	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, typename U11>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11) ){
-		AddMethod( name_, new CppMethod12<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11), ValidMethod valid = &yes_arity<12> ){
+		AddMethod( name_, new CppMethod12<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	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, typename U11>
-	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11) const ){
-		AddMethod( name_, new const_CppMethod12<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11>( fun ) ) ;
+	self& const_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11) const , ValidMethod valid = &yes_arity<12>){
+		AddMethod( name_, new const_CppMethod12<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11>( fun ), valid ) ;
   		return *this ;
 	}
 
@@ -374,26 +374,26 @@
 
 
 	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, typename U11, typename U12>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11, U12 u12) ){
-		AddMethod( name_, new CppMethod13<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11, U12>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11, U12 u12), ValidMethod valid = &yes_arity<13> ){
+		AddMethod( name_, new CppMethod13<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11, U12>( fun ), valid ) ;
   		return *this ;
 	}
 	
 	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, typename U11, typename U12>
-	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11, U12 u12) const ){
-		AddMethod( name_, new const_CppMethod13<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11, U12>( fun ) ) ;
+	self& method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11, U12 u12) const, ValidMethod valid = &yes_arity<13> ){
+		AddMethod( name_, new const_CppMethod13<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11, U12>( fun ), valid ) ;
   		return *this ;
 	}
 
 	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, typename U11, typename U12>
-	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11, U12 u12) ){
-		AddMethod( name_, new CppMethod13<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11, U12>( fun ) ) ;
+	self& nonconst_method( const char* name_, OUT (Class::*fun)(U0 u0, U1 u1, U2 u2, U3 u3, U4 u4, U5 u5, U6 u6, U7 u7, U8 u8, U9 u9, U10 u10, U11 u11, U12 u12), ValidMethod valid = &yes_arity<13> ){
+		AddMethod( name_, new CppMethod13<Class,OUT,U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, U10, U11, U12>( fun ), valid ) ;
   		return *this ;
 	}
 	
[TRUNCATED]

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


More information about the Rcpp-commits mailing list