Le 21/04/11 11:01, schattenpfla...@arcor.de a écrit :
Now, for Rcpp classes to be aware of a custom wrap, you need some
gymnatics, as described in the Rcpp-extending vignette.
You need to include RcppCommon.h first, define you class and declare the
custom wrap, then include Rcpp.h, then define yo
Now, for Rcpp classes to be aware of a custom wrap, you need some
gymnatics, as described in the Rcpp-extending vignette.
You need to include RcppCommon.h first, define you class and declare the
custom wrap, then include Rcpp.h, then define you wrap.
I'm pasting a full pass at it below.
Thanks a
Hello,
The approach here is to use a callback to the new function of R, to
mimic the call :
b <- new( B, 0L )
which you can do for example using the Language class:
namespace Rcpp {
template <>
SEXP wrap( const B& object ){
Language call( "new", Symbol( "B" ), object.get_i()
The way you try to implement it would require the class B to be
wrappable. You can have a look at the Rcpp-extending vignette for how to
enable wrap for custom classes.
The vignette states that I should specialize the wrap template or
implement the operator SEXP() for my class B. Unfortunately, i
Le 18/04/11 10:04, schattenpfla...@arcor.de a écrit :
Dirk,
Could you mock up a small example?
Here is a small, abstract example which demonstrates one of the
scenarios where I would like to create and return object pointers. There
are two classes, A and B. Instances of A contain pointers to i
Dirk,
Could you mock up a small example?
Here is a small, abstract example which demonstrates one of the
scenarios where I would like to create and return object pointers. There
are two classes, A and B. Instances of A contain pointers to instances
of B. I would like to create the B objects p
Peter,
On 17 April 2011 at 10:45, schattenpfla...@arcor.de wrote:
| Hello,
|
| I have made progress exposing my C++ classes to R with Rcpp-Modules and
| I really like the way it works. Thanks for this great package!
|
| There are, however, lots of aspects about Rcpp which I do not yet fully
|
Hello,
I have made progress exposing my C++ classes to R with Rcpp-Modules and
I really like the way it works. Thanks for this great package!
There are, however, lots of aspects about Rcpp which I do not yet fully
understand. Here is one of them:
I have exposed a C++ class MyClass to R via an