[Rcpp-commits] r1119 - pkg/Rcpp/inst/include pkg/Rcpp/inst/include/Rcpp scripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 26 09:12:50 CEST 2010


Author: romain
Date: 2010-04-26 09:12:50 +0200 (Mon, 26 Apr 2010)
New Revision: 1119

Modified:
   pkg/Rcpp/inst/include/Rcpp.h
   pkg/Rcpp/inst/include/Rcpp/DataFrame.h
   pkg/Rcpp/inst/include/Rcpp/DataFrame_generated.h
   scripts/DataFrame.R
Log:
second shot

Modified: pkg/Rcpp/inst/include/Rcpp/DataFrame.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/DataFrame.h	2010-04-26 06:42:48 UTC (rev 1118)
+++ pkg/Rcpp/inst/include/Rcpp/DataFrame.h	2010-04-26 07:12:50 UTC (rev 1119)
@@ -34,12 +34,12 @@
 	}
 	
 	class DataFrame : public List {
+	public:	
+		DataFrame(): List( internal::empty_data_frame() ){}
 		
-		DataFrame(): List( empty_data_frame() ){}
-		
 		DataFrame(SEXP x) throw(not_compatible) : List(){
 			/* this might throw not_compatible */
-			SEXP y = convert_using_rfunction( x, "as.data.frame" ) ;
+			SEXP y = internal::convert_using_rfunction( x, "as.data.frame" ) ;
 			setSEXP( y ) ;
 		}
 		
@@ -51,7 +51,7 @@
 		}
 		
 		DataFrame& operator=( SEXP x) throw( not_compatible) {
-			SEXP y = convert_using_rfunction( x, "as.data.frame" ) ;
+			SEXP y = internal::convert_using_rfunction( x, "as.data.frame" ) ;
 			setSEXP( y ); 
 			return *this ;
 		}
@@ -62,7 +62,7 @@
 		
 #include <Rcpp/DataFrame_generated.h>		
 
-	}
+	} ;
 	
 }
 

Modified: pkg/Rcpp/inst/include/Rcpp/DataFrame_generated.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/DataFrame_generated.h	2010-04-26 06:42:48 UTC (rev 1118)
+++ pkg/Rcpp/inst/include/Rcpp/DataFrame_generated.h	2010-04-26 07:12:50 UTC (rev 1119)
@@ -26,141 +26,221 @@
 
 
 template <typename T1>
-static DataFrame( const T1& t1 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2>
-static DataFrame( const T1& t1, const T2& t2 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18, const T19& t19 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18, const T19& t19 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10, typename T11, typename T12, typename T13, typename T14, typename T15, typename T16, typename T17, typename T18, typename T19, typename T20>
-static DataFrame( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18, const T19& t19, const T20& t20 ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20 ), "as.data.frame" ) ) ;
+static DataFrame create( const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6, const T7& t7, const T8& t8, const T9& t9, const T10& t10, const T11& t11, const T12& t12, const T13& t13, const T14& t14, const T15& t15, const T16& t16, const T17& t17, const T18& t18, const T19& t19, const T20& t20 ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, t20 ), 
+			"as.data.frame" 
+		) ) ;
 }
 
 

Modified: pkg/Rcpp/inst/include/Rcpp.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp.h	2010-04-26 06:42:48 UTC (rev 1118)
+++ pkg/Rcpp/inst/include/Rcpp.h	2010-04-26 07:12:50 UTC (rev 1119)
@@ -67,6 +67,7 @@
 #include <Rcpp/WeakReference.h>
 #include <Rcpp/StringTransformer.h>
 #include <Rcpp/Formula.h>
+#include <Rcpp/DataFrame.h>
 
 #include <Rcpp/preprocessor.h>
 

Modified: scripts/DataFrame.R
===================================================================
--- scripts/DataFrame.R	2010-04-26 06:42:48 UTC (rev 1118)
+++ scripts/DataFrame.R	2010-04-26 07:12:50 UTC (rev 1119)
@@ -6,8 +6,12 @@
 	
 sprintf( '
 template <%s>
-static DataFrame( %s ) throw(not_compatible){
-	return DataFrame( convert_using_rfunction( List::create( %s ), "as.data.frame" ) ) ;
+static DataFrame create( %s ) throw(not_compatible){
+	return DataFrame( 
+		internal::convert_using_rfunction( 
+			List::create( %s ), 
+			"as.data.frame" 
+		) ) ;
 }
 ', 
 paste( sprintf( "typename T%d", 1:i ), collapse = ", "), 



More information about the Rcpp-commits mailing list