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

Kevin Ushey kevinushey at gmail.com
Tue Feb 19 20:16:08 CET 2013


Hi Hadley,

Dirk has an example in the Rcpp gallery --
http://gallery.rcpp.org/articles/custom-as-and-wrap-example/. Not sure if
you've seen it already, but it might help.

-Kevin

On Tue, Feb 19, 2013 at 9:19 AM, Hadley Wickham <h.wickham at gmail.com> wrote:

> > 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/
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130219/1c284e44/attachment.html>


More information about the Rcpp-devel mailing list