[Rcpp-commits] r629 - in pkg: . inst src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Feb 7 17:46:43 CET 2010


Author: romain
Date: 2010-02-07 17:46:43 +0100 (Sun, 07 Feb 2010)
New Revision: 629

Removed:
   pkg/src/RcppSexp.h
Modified:
   pkg/NEWS
   pkg/inst/ChangeLog
Log:
remove RcppSexp

Modified: pkg/NEWS
===================================================================
--- pkg/NEWS	2010-02-07 16:34:37 UTC (rev 628)
+++ pkg/NEWS	2010-02-07 16:46:43 UTC (rev 629)
@@ -1,6 +1,17 @@
 
 0.7.5	(under development)
 
+    o 	wrap has been much improved. wrappable types now are :
+    	- primitive types : int, double, Rbyte, Rcomplex, float, bool
+    	- std::string
+    	- STL-like containers which have iterators over wrappable types:
+    	  (e.g. std::vector<T>, std::deque<T>, std::list<T>, etc ...). 
+    	- STL-like maps keyed by std::string, e.g std::map<std::string,T>
+    	- classes that have implicit conversion to SEXP
+    	- classes for which the wrap template if fully or partly specialized
+    	This allows composition, so for example this class is wrappable: 
+    	std::vector< std::map<std::string,T> > (if T is wrappable)
+    	
     o 	The range based version of wrap is now exposed at the Rcpp::
     	level with the following interface : 
     	Rcpp::wrap( InputIterator first, InputIterator last )
@@ -10,20 +21,16 @@
     o	a new namespace Rcpp::traits has been added to host the various
     	type traits used by wrap
 
-    o 	wrap is now able to handle more stl and tr1 types. Given that T
-    	can be wrapped, the following can be wrapped: 
-    	- std::list<T>
-    	- std::multiset<T>
-    	- std::map<std::string,T>
-    	- std::multimap<std::string,T>
-    	- std::tr1::unordered_set<T>
-    	- std::tr1::unordered_map<std::string,T>
-    	- std::tr1::unordered_multimap<std::string,T>
-
     o 	The doxygen documentation now shows the examples
 
     o 	A new file inst/THANKS acknowledges the kind help we got from others
 
+    o	The RcppSexp has been removed from the library.
+    
+    o 	The methods RObject::asFoo are deprecated and will be removed
+    	in the next version. The alternative is to use as<Foo>.
+
+
 0.7.4	2010-01-30
 
     o	matrix matrix-like indexing using operator() for all vector 

Modified: pkg/inst/ChangeLog
===================================================================
--- pkg/inst/ChangeLog	2010-02-07 16:34:37 UTC (rev 628)
+++ pkg/inst/ChangeLog	2010-02-07 16:46:43 UTC (rev 629)
@@ -1,3 +1,7 @@
+2010-02-07  Romain Francois <francoisromain at free.fr>
+
+	* src/RcppSexp.h: class RcppSexp removed (was deprecated)
+
 2010-02-06  Dirk Eddelbuettel  <edd at debian.org>
 
 	* inst/examples/functionCallback/newApiExamples.r: Added simpler

Deleted: pkg/src/RcppSexp.h
===================================================================
--- pkg/src/RcppSexp.h	2010-02-07 16:34:37 UTC (rev 628)
+++ pkg/src/RcppSexp.h	2010-02-07 16:46:43 UTC (rev 629)
@@ -1,141 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// RcppSexp.h: Rcpp R/C++ interface class library -- SEXP support
-//
-// Copyright (C) 2009 - 2010	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 RcppSexp_h
-#define RcppSexp_h
-
-#include <RcppCommon.h>
-#include <set>
-
-/**
- * This class is DEPRECATED, will be DEFUNCT in a next version and 
- * eventually removed from Rcpp. 
- *
- * The alternative is to use the Rcpp::RObject class and the set of functions
- * Rcpp::wrap. 
- */
-class RcppSexp {
-public:
-	
-    /**
-     * wraps the SEXP into an Rcpp::RObject. The RObject does not 
-     * automatically enforce protection of the SEXP, so if you want to 
-     * preserve the SEXP from R garbage collection, you must call the 
-     * protect member function
-     */
-    RcppSexp(SEXP m_sexp = R_NilValue) : object( m_sexp ) {
-    	    DEPRECATED() ; 
-    };
-    
-    ~RcppSexp() ;
-	
-    RcppSexp(const double & v) : object( Rcpp::wrap( v ) ) { DEPRECATED() ; } ;
-    RcppSexp(const int & v): object( Rcpp::wrap(v) ){ DEPRECATED() ; } ;
-    RcppSexp(const Rbyte & v) : object( Rcpp::wrap(v) ){ DEPRECATED() ;} ;
-    RcppSexp(const std::string & v) : object( Rcpp::wrap(v) ){ DEPRECATED() ;} ;
-    RcppSexp(const bool & v) : object( Rcpp::wrap(v) ){ DEPRECATED() ; };
-    
-    RcppSexp(const std::vector<int> & v): object( Rcpp::wrap(v) ){ DEPRECATED() ; };
-    RcppSexp(const std::vector<double> & v): object( Rcpp::wrap(v) ){ DEPRECATED() ; };
-    RcppSexp(const std::vector<std::string> & v): object( Rcpp::wrap(v) ){ DEPRECATED() ;};
-    RcppSexp(const std::vector<Rbyte> & v): object( Rcpp::wrap(v) ){ DEPRECATED() ;};
-    RcppSexp(const std::vector<bool> & v): object( Rcpp::wrap(v) ){ DEPRECATED() ;};
-    
-    RcppSexp(const std::set<int> & v): object( Rcpp::wrap(v) ){ DEPRECATED() ;};
-    RcppSexp(const std::set<double> & v): object( Rcpp::wrap(v) ){ DEPRECATED() ; };
-    RcppSexp(const std::set<std::string> & v): object( Rcpp::wrap(v) ){ DEPRECATED() ; };
-    RcppSexp(const std::set<Rbyte> & v): object( Rcpp::wrap(v) ){ DEPRECATED() ; };
-    
-    
-    /* we don't provide implicit converters because 
-       of Item 5 in More Effective C++ */
-       inline bool                     asBool() const  {return as<bool>( object ) ; } ;
-       inline double                   asDouble() const   { return as<double>(object) ; }
-       inline int                      asInt() const { return as<int>(object) ; }
-       inline Rbyte                    asRaw() const { return as<Rbyte>(object) ; }
-       inline std::string              asStdString() const { return as<std::string>(object) ; }
-       inline std::vector<int>         asStdVectorInt() const { return as< std::vector<int> >( object ) ; }
-       inline std::vector<double>      asStdVectorDouble() const { return as< std::vector<double>(object); }
-       inline std::vector<std::string> asStdVectorString() const { return as< std::vector<std::string> >(object); }
-       inline std::vector<Rbyte>       asStdVectorRaw() const { return as< std::vector<Rbyte> >(object) ;}
-       inline std::vector<bool>        asStdVectorBool() const { return as< std::vector<bool> >(object) ; }
-    
-    	/**
-	 * Calls the preserve method of the wrapped RObject, which 
-	 * prevents the underlying SEXP from being garbage collected
-	 */
-	inline void protect(){ /* object.preserve() ; */ } 
-	
-	/**
-	 * calls the release method of the RObject. the underlying SEXP
-	 * becomes subject of garbage collection
-	 */
-	inline void release() { /* object.release() */ };
-	
-	/**
-	 * implicit conversion to SEXP
-	 */
-	inline operator SEXP() const { return object.asSexp() ; }
-	
-	
-	/* attributes */
-	
-	/**
-	 * extracts the names of the attributes of the wrapped SEXP
-	 */
-	inline std::vector<std::string> attributeNames() const { return object.attributeNames() };
-    
-    	/**
-    	 * Identifies if the SEXP has the given attribute
-    	 */
-    	 inline bool hasAttribute( const std::string& attr) const { return object.hasAttribute( attr ) }; 
-    
-	/**
-	 * extract the given attribute
-	 */
-	inline SEXP attr( const std::string& name) const { return object.attr( name) ; } ;
-    
-	/**
-	 * is this object NULL
-	 */
-	inline bool isNULL() const{ return object.isNULL() ; }
-    
-	/**
-	 * The SEXP typeof, calls TYPEOF on the underlying SEXP
-	 */
-	 inline int sexp_type() const {  return object.sexp_type()  ; }
-    
-	/** 
-	 * explicit conversion to SEXP
-	 */
-	inline SEXP asSexp() const {  return object.asSexp() ; }
-	
-protected:
-	
-	/**
-	 * The RObject this wraps
-	 */
-	Rcpp::RObject object ;
-	
-	void DEPRECATED(){ Rf_warning( "The class RcppSexp is deprecated, and will eventually be removed, please consider using Rcpp::RObject instead" ) ; }
-};
-
-#endif



More information about the Rcpp-commits mailing list