[Rcpp-devel] [Rcpp-commits] r332 - pkg/src/Rcpp
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Jan 9 23:36:05 CET 2010
Author: romain
Date: 2010-01-09 23:36:05 +0100 (Sat, 09 Jan 2010)
New Revision: 332
Modified:
pkg/src/Rcpp/RObject.h
Log:
added doc comments about attr proxy behavior
Modified: pkg/src/Rcpp/RObject.h
===================================================================
--- pkg/src/Rcpp/RObject.h 2010-01-09 22:31:01 UTC (rev 331)
+++ pkg/src/Rcpp/RObject.h 2010-01-09 22:36:05 UTC (rev 332)
@@ -149,9 +149,21 @@
} ;
/**
- * extract the given attribute
+ * extract or set the given attribute
+ *
+ * @param name name of the attribute to get/set
+ *
+ * @return this returns a proxy to the given attribute. Depending
+ * on whether the proxy is used as a lhs or a rhs the attribute is
+ * either set (if the proxy is used on the lhs) or extracted
+ * (if the proxy is used on the rhs).
+ *
+ * RObject y = x.attr("foo") ; // rhs : get the attribute
+ * x.attr( "bar" ) = 10 ; // lhs : set the attribute.
+ *
+ * wrap is called on the right side of the assignment it can be anything
+ * wrap can handle.
*/
- /* TODO: implement a proxy pattern for attributes */
AttributeProxy attr( const std::string& name) const ;
/**
_______________________________________________
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