Skip to content
Prev 2675 / 10988 Next

[Rcpp-devel] Passing an exposed function to another C++ function as a parameter

Thank you for your effort in summarizing the necessary steps using that
approach. In fact, as I mentioned in the first message, I did my search
before posting and I had already seen the sources of RcppDE --- sorry for
the misspell, I wrote RppDE in the first message. Using what I understood
from those sources I deviced my attempt which proved wrong due to my lack
of experience.

What I intend to do is slightly different. I'm trying to get access to the
pointer of the original function that I guess --- it's a supposition---,
is stored somewhere in the exposed function on the R side. I might be
wrong on that assumption and you might have implemented it in a different
manner.

The interest of doing that and used a exposed function is to lighten the
user of the package of the burden of having to deal with pointers. I
believe that the RCPP_MODULE construct is something I could ask a user to
deal with, but not much more given that many of them may not even have
experience on C++.

Having a look at :
Class "C++Function" [package "Rcpp"]

Slots:
                   
Name:        .Data     pointer   docstring   signature
Class:    function externalptr   character   character

Extends: 
Class "function", from data part
Class "OptionalFunction", by class "function", distance 2
Class "PossibleMethod", by class "function", distance 2

We can see a pointer Slot. Is there any chance that this pointer would be
pointing at the original C++ function?


Thank you for your patience and support.
Manuel

 

El 03/08/11 19:22, "Dirk Eddelbuettel" <edd at debian.org> escribi??: