Description Usage Arguments Value Author(s) References See Also
This function takes a translation unit node defining a class and then computes information about it to define an R class corresponding to that C++ class. It provides the R code to define this class as well as providing information about the ancestor classes. When working in recursive mode, the function can generate the R code to define classes for the entire hierarchy of ancestor classes.
1 2 | getRClassDefinitions(node, recursive = FALSE, className = getNodeName(node),
defaultBaseClass = "RC++Reference")
|
node |
a translation parser node which defines a C++ class.
This has class |
recursive |
a logical value indicating whether to process the
node and its ancestor classes recursively or just this leaf node by
itself. If this is |
className |
the name to use for the R base of the class
name. Note that |
defaultBaseClass |
the name of the base R class to use in the R class definition if the specified C++ class does not have any ancestors. |
If recursive
is FALSE
(the default)
this returns an object of S3 class ClassDefinition
which has fields named:
definition |
|
baseClasses |
a named character vector giving the names of the classes from which this C++ class is derived. The names for this vector are the node identifiers in the translation unit of the corresponding class nodes for these parent classes. |
ancestors |
a named character vector giving the name of the C++ class and the name of that element is the corresponding R class name |
className |
the name of the class being defined |
If recursive
is TRUE
, the function returns a list
with elements of class ClassDefinition
as described
in the previous paragraph.
Duncan Temple Lang
The GCC compiler suite
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.