getDerivedClassMethods | R Documentation |
A C++ class has methods and fields. We can create an extension of such a class which has methods that are implemented as R functions. Basically, we define a new C++ class that extends the original C++ class. For each method in the new C++ class, we implement it by having it check to see if there is an R function registered for that method. If so, the C++ code invokes that R function, passing the arguments from the C++ call to the R function, and returning the R value in the appropriate form. If there is no R function registered for that method, the C++ code calls the inherited method. In this way, we can use an R implemented version of any C++ class without modifying any existing compiled code.
These functions and methods allow us to access and register R functions registered for different methods of the C++ class.
getDerivedClassMethods(obj, mergeClassMethods = TRUE, simplify = FALSE)
obj |
either the name of the R class or an instance of that class |
mergeClassMethods |
a logical value that |
simplify |
a logical value |
Duncan Temple Lang
The RGCCTranslationUnit package and the code it generates to interface to C++ classes and methods
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.