[Rcpp-devel] plugin in a package - how is it registered?

JJ Allaire jj.allaire at gmail.com
Sat Oct 12 01:01:21 CEST 2013


Simon,

To make a plugin available for use with both inline and Rcpp attributes you
need only define a function named "inlineCxxPlugin" within your package
(which can in turn call Rcpp.plugin.maker). This allow you to use it with
inline as well as Rcpp::depends.

I think this is the scenario you are targeting (since you are writing a
package). The registerPlugin function is used when you want to make
available a plugin that isn't part of a package (e.g. for some type of
ad-hoc complier/linker recipe you need to cook up).

J.J.


On Fri, Oct 11, 2013 at 5:54 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

>
> Simon,
>
> On 11 October 2013 at 23:43, Simon Zehnder wrote:
> | I have a very short question in regard to plugins in packages. I have
> written my own plugin using Rcpp.plugin.maker (very well documented in FAQ
> btw).
> |
> | I know, that on the command line calling registerPlugin() registers the
> plugin. From RcppArmadillo I can see, that the registerPlugin function is
> never called inside the package - but I see also, that the file is called
> inline.R. How does the inline package register/identify a plugin? Is a
> plugin registered automatically when called inside cxxfunction? Does it
> have to be put into a file called 'inline.R'?
>
> What is your actual intent?  To support inline? To support Rcpp Attributes?
>
> I have not looked at this in a while, but I think we may not actually
> required registration (ie there is no run-time state vector accumulating
> plugin callbacks...) but when a plugin is invoked, it points to a package
> and
> hence the package namespace is searched and a corresponding function is
> called.
>
> This is from memory. Actual details may differ. Void where prohibited :)
>
> Dirk
>
> --
> Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
> _______________________________________________
> 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/20131011/0baf742c/attachment.html>


More information about the Rcpp-devel mailing list