[Rcpp-devel] more on CPP

Romain François francoisromain at free.fr
Wed Dec 23 18:02:25 CET 2009


CPP now has vector, set and deque containers from the STL holding 
integer, double and raw.

I was fed up with the copy and paste, so I came up with a way to 
generate the headers and cpp files from a brew template.

Also, after generating these things, but before compilation, the headers 
are parsed with some regex voodoo to generate some reflection metadata, 
available in the dataset "reflection" that comes with the package.

This is much less painful to write than what I started to do to expose 
classes in RProtoBuf, because all goes through the "$" method. In 
RProtoBuf, for each new method I add to each new class, I need to update 
manually the method that generate the completions, possibly declare a 
new generic function (setGeneric), define the method for this generic 
function and the appropriate parameters (setMethod), ...

I'll probably revisit RProtoBuf based on this.


Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
|- http://tr.im/IlMh : CPP package: exposing C++ objects
|- http://tr.im/HlX9 : new package : bibtex
`- http://tr.im/Gq7i : ohloh

More information about the Rcpp-devel mailing list