[Rcpp-commits] r4137 - in pkg/Rcpp: . inst/include inst/include/Rcpp inst/include/Rcpp/internal

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Dec 10 17:19:37 CET 2012


Author: romain
Date: 2012-12-10 17:19:37 +0100 (Mon, 10 Dec 2012)
New Revision: 4137

Added:
   pkg/Rcpp/inst/include/Rcpp/internal/converter.h
Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/cache.h
   pkg/Rcpp/inst/include/RcppCommon.h
Log:
move the converter template in its own file

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-12-10 16:11:09 UTC (rev 4136)
+++ pkg/Rcpp/ChangeLog	2012-12-10 16:19:37 UTC (rev 4137)
@@ -14,6 +14,7 @@
         * include/Rcpp/macros/macros.h: master file for all macros includes
         * include/Rcpp/DataFrame.h: just have declaration for DataFrame
         * include/Rcpp/Benchmark/Timer.h: move it into the Rcpp:: namespace
+        * include/Rcpp/cache.h: clean
         
 2012-12-09 Romain Francois <romain at r-enthusiasts.com>
 

Modified: pkg/Rcpp/inst/include/Rcpp/cache.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/cache.h	2012-12-10 16:11:09 UTC (rev 4136)
+++ pkg/Rcpp/inst/include/Rcpp/cache.h	2012-12-10 16:19:37 UTC (rev 4137)
@@ -31,7 +31,6 @@
 }
 
 extern "C" {
-    SEXP rcpp_init_cached_functions(SEXP) ;
     int* get_cache( int ) ;
 }
 

Added: pkg/Rcpp/inst/include/Rcpp/internal/converter.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/internal/converter.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/internal/converter.h	2012-12-10 16:19:37 UTC (rev 4137)
@@ -0,0 +1,48 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
+//
+// converter.h: Rcpp R/C++ interface class library -- 
+//
+// Copyright (C) 2012 Dirk Eddelbuettel and Romain Francois
+//
+// This file is part of Rcpp.
+//
+// Rcpp is free software: you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 2 of the License, or
+// (at your option) any later version.
+//
+// Rcpp is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
+
+#ifndef Rcpp_internal_converter_h
+#define Rcpp_internal_converter_h
+
+namespace Rcpp{
+namespace internal{	
+	class converter {
+	public:
+		converter( ) : x(R_NilValue){} ;
+		converter( SEXP x_) : x(x_){} ;
+		converter( const converter& other) : x(other.x){}
+		converter& operator=( const converter& other){
+			x = other.x ;
+			return *this ;
+		}
+		~converter(){}
+	
+		template <typename T> operator T(){
+			return ::Rcpp::as<T>( x ) ;	
+		}
+	private:
+		SEXP x ;
+		
+	} ;
+} // namespace internal
+} // namespace Rcpp
+
+#endif

Modified: pkg/Rcpp/inst/include/RcppCommon.h
===================================================================
--- pkg/Rcpp/inst/include/RcppCommon.h	2012-12-10 16:11:09 UTC (rev 4136)
+++ pkg/Rcpp/inst/include/RcppCommon.h	2012-12-10 16:19:37 UTC (rev 4137)
@@ -122,6 +122,7 @@
 #include <Rcpp/internal/ListInitialization.h>
 #include <Rcpp/internal/Proxy_Iterator.h>
 #include <Rcpp/internal/SEXP_Iterator.h>
+#include <Rcpp/internal/converter.h>
 
 #include <Rcpp/algo.h>
 
@@ -133,27 +134,4 @@
 #include <Rcpp/iostream/Rstreambuf.h>
 #include <Rcpp/iostream/Rostream.h>
 
-namespace Rcpp{
-namespace internal{	
-	class converter {
-	public:
-		converter( ) : x(R_NilValue){} ;
-		converter( SEXP x_) : x(x_){} ;
-		converter( const converter& other) : x(other.x){}
-		converter& operator=( const converter& other){
-			x = other.x ;
-			return *this ;
-		}
-		~converter(){}
-	
-		template <typename T> operator T(){
-			return ::Rcpp::as<T>( x ) ;	
-		}
-	private:
-		SEXP x ;
-		
-	} ;
-} // namespace internal
-} // namespace Rcpp
-
 #endif



More information about the Rcpp-commits mailing list