[Rcpp-commits] r2108 - pkg/Rcpp/inst/include/Rcpp

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 14 22:30:52 CEST 2010


Author: romain
Date: 2010-09-14 22:30:51 +0200 (Tue, 14 Sep 2010)
New Revision: 2108

Modified:
   pkg/Rcpp/inst/include/Rcpp/Module.h
Log:
added CppClass__property_classes

Modified: pkg/Rcpp/inst/include/Rcpp/Module.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Module.h	2010-09-14 20:30:22 UTC (rev 2107)
+++ pkg/Rcpp/inst/include/Rcpp/Module.h	2010-09-14 20:30:51 UTC (rev 2108)
@@ -71,6 +71,7 @@
 	virtual std::string property_class(const std::string& ) throw(std::range_error){ return "" ; }
 	virtual Rcpp::IntegerVector methods_arity(){ return Rcpp::IntegerVector(0) ; }
 	virtual Rcpp::LogicalVector methods_voidness(){ return Rcpp::LogicalVector(0); }
+	virtual Rcpp::List property_classes(){ return Rcpp::List(0); }
 	
 	virtual Rcpp::CharacterVector complete(){ return Rcpp::CharacterVector(0) ; }
 	virtual ~class_Base(){}
@@ -284,6 +285,19 @@
 		return out ;
 	}
 	
+	Rcpp::List property_classes(){
+		int n = properties.size() ;
+		Rcpp::CharacterVector pnames(n) ;
+		Rcpp::List out(n) ;
+		typename PROPERTY_MAP::iterator it = properties.begin( ) ;
+		for( int i=0; i<n; i++, ++it){
+			pnames[i] = it->first ;
+			out[i] = it->second->get_class() ; 
+		} 
+		out.names() = pnames ;
+		return out ;
+	}
+	
 	Rcpp::CharacterVector complete(){
 		int n = methods.size() - specials ;
 		int ntotal = n + properties.size() ;



More information about the Rcpp-commits mailing list