[Rcpp-devel] Rcpp modules and parsing an object back and forth between R & C++

Hadley Wickham h.wickham at gmail.com
Tue Feb 19 18:19:32 CET 2013


> Unfortunately, at the moment modules and attributes don't play together. The
> attributes feature used to be built on top of modules, but this caused
> issues on windows.
>
> One thing we could perhaps negociate with JJ is recognition of the export
> attribute on module. Something like :
>
> // [[Rcpp::export]]
> RCPP_MODULE(SimpleModule) {
>   class_<Simple>( "Simple")
>         .constructor<double>()
>         .const_method("times", &Simple::times)
>   ;
> }
>
> or perhaps even just recognizing the RCPP_MODULE declaration.

That'd be cool!

> Once we have that, you won't need the SEXP constructor or the SEXP
> conversion operator, and you would only need that before your class
> declaration:
>
> RCPP_EXPOSED_CLASS(Simple)
>
> So that as and wrap are taken care of.

Until that happens, is it possible to write my own as and wrap methods?

Hadley

-- 
Chief Scientist, RStudio
http://had.co.nz/


More information about the Rcpp-devel mailing list