[Rcpp-devel] [Rcpp-commits] r293 - in pkg/src: . Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 7 10:23:38 CET 2010


Author: romain
Date: 2010-01-07 10:23:37 +0100 (Thu, 07 Jan 2010)
New Revision: 293

Modified:
   pkg/src/Rcpp/WeakReference.h
   pkg/src/WeakReference.cpp
Log:
wrap the result in an RObject

Modified: pkg/src/Rcpp/WeakReference.h
===================================================================
--- pkg/src/Rcpp/WeakReference.h	2010-01-07 09:16:44 UTC (rev 292)
+++ pkg/src/Rcpp/WeakReference.h	2010-01-07 09:23:37 UTC (rev 293)
@@ -40,15 +40,18 @@
 	 */
 	WeakReference( SEXP x) throw(not_compatible) ; 
 
+	/* TODO: constructor that makes a new weak reference based
+		on key, value, finalizer (C and R) */
+	
 	/** 
 	 * Retrieve the key
 	 */
-	SEXP key() const ; 
+	RObject key() const ; 
 
 	/**
 	 * Retrieve the value
 	 */
-	SEXP value() const ;
+	RObject value() const ;
 
 } ;
 

Modified: pkg/src/WeakReference.cpp
===================================================================
--- pkg/src/WeakReference.cpp	2010-01-07 09:16:44 UTC (rev 292)
+++ pkg/src/WeakReference.cpp	2010-01-07 09:23:37 UTC (rev 293)
@@ -20,6 +20,7 @@
 // along with Rcpp.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <Rcpp/WeakReference.h>
+#include <Rcpp/wrap.h>
 
 namespace Rcpp{
 	
@@ -31,12 +32,12 @@
 		}
 	}
 	
-	SEXP WeakReference::key() const {
-		return isNULL() ? R_NilValue : R_WeakRefKey(m_sexp) ;
+	RObject WeakReference::key() const {
+		return isNULL() ? RObject() : wrap( R_WeakRefKey(m_sexp) ) ;
 	}
 	
-	SEXP WeakReference::value() const {
-		return isNULL() ? R_NilValue : R_WeakRefValue(m_sexp) ;
+	RObject WeakReference::value() const {
+		return isNULL() ? RObject() : wrap( R_WeakRefValue(m_sexp) );
 	}
 	
 }

_______________________________________________
Rcpp-commits mailing list
Rcpp-commits at lists.r-forge.r-project.org
https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-commits


More information about the Rcpp-devel mailing list