[Rcpp-devel] module/S4 retval

Richard Downe richard-downe at uiowa.edu
Wed Sep 5 23:22:22 CEST 2012


I would like to be able to create object factories in my rcpp module, 
such that I can call
classA::GetInitializedB(), and get an S4 object (module instance?) back.
 From what I can tell, the "module" class definition macros are not 
quite flexible to permit this, but I'm wondering if there's a way to 
leverage the code in Module.h/cpp in an operator SEXP() block to 
appropriately wrap up object factory pointers.

I really am loathe to have to enumerate all exported methods *again*, 
and would like to be able to use template metaprogramming to slurp in a 
header, parse it, and use that to enumerate the list of methods in the 
returned S4 object.

Has anyone ever done anything like this?
-rd


More information about the Rcpp-devel mailing list