EVOLUTION-MANAGER
Edit File: plugins.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Plugin system for cxxfunction</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for plugins {inline}"><tr><td>plugins {inline}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Plugin system for cxxfunction </h2> <h3>Description</h3> <p><code><a href="cxxfunction.html">cxxfunction</a></code> uses a plugin system to assembly the code that it compiles. These functions allow to register and get plugins by their name. </p> <h3>Usage</h3> <pre> getPlugin(name, ...) registerPlugin(name, plugin) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>name</code></td> <td> <p>name of the plugin. </p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Further argments to pass to the plugin. </p> </td></tr> <tr valign="top"><td><code>plugin</code></td> <td> <p>plugin function. </p> </td></tr> </table> <h3>Details</h3> <p>plugins are functions that return a list with : </p> <dl> <dt>includes</dt><dd><p>mandatory. it is included at the top of the compiled file by <code><a href="cxxfunction.html">cxxfunction</a></code> </p> </dd> <dt>body</dt><dd><p>optional. a function that takes one argument (the body of the c++ function) and returned a modified version of the body. The "Rcpp" plugin uses this to surround the code with the <code>BEGIN_RCPP</code> and <code>END_RCPP</code> macros </p> </dd> <dt>LinkingTo</dt><dd><p>optional. character vector containing the list of packages that the code needs to link to. This adds the include path of the given packages. The "Rcpp" and "RcppArmadillo" plugins use this. </p> </dd> <dt>env</dt><dd><p>optional. named list of environment variables. For example, the "Rcpp" plugin uses this to add Rcpp user library to the <code>PKG_LIBS</code> environment variable. </p> </dd> </dl> <p>plugins can be manually registered using the <code>registerPlugin</code> function. Alternatively, a package may supply an inline plugin implicitely by defining a function called <code>inlineCxxPlugin</code>, which does not necessarily need to be exported from the namespace of the package. </p> <p>Known packages implementing this scheme include <code>Rcpp</code> and <code>RcppArmadillo</code>. </p> <h3>Value</h3> <p><code>getPlugin</code> retrieves the plugin and invokes it with the ... arguments </p> <p><code>registerPlugin</code> does not return anything. </p> <h3>See Also</h3> <p><code><a href="cxxfunction.html">cxxfunction</a></code> </p> <h3>Examples</h3> <pre> ## Not run: getPlugin( "Rcpp" ) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>inline</em> version 0.3.19 <a href="00Index.html">Index</a>]</div> </body></html>