CRoutineDefinition: Create a code object

Description Usage Arguments Value Note Author(s) See Also

Description

These constructor functions are used to create a text representation of code that we can output later. We can represent a C routine or an R function with the actual definition and also its name and declaration/prototype for C routines.

Usage

1
2
3
4
5
CRoutineDefinition(name, code, nargs = NA,
                   declaration = getDeclaration(code),
                   className = character(),
                   obj =  new("CRoutineDefinition"),
                   formatCode = TRUE)

Arguments

name

the name of the C routine

code

a character vector giving the code for the routine including the declaration, etc. The return type should be on a separate line.(?)

obj

the object to be filled in and returned

nargs

the number of parameters

className

if specified, this is used to provide the namespace qualifier for the function.

declaration

the declaration for the routine. This will be enclosed within a #ifdef __cplusplus.

formatCode

a logical value controlling whether to process the text of the code to format it appropiately.

Value

An object of class CRoutineDefinition-class or RFunctionDefinition-class depending on which constructor is invoked!

Note

The RCode function uses S3-style classes and is less structured than the C routine representation as it does not need to know the name of the function, etc. but is merely a textual representation of R code.

Author(s)

Duncan Temple Lang

See Also

Any functions that we use to generate a C/C++ routine definition or an R function or R code.


omegahat/RGCCTranslationUnit documentation built on May 24, 2019, 1:53 p.m.