convertRValue: Create C/C++ code to convert R value to C/C++ type

Description Usage Arguments Value Author(s)

Description

These three functions (and associated methods) perform the code generation to marshal values between R and C/C++. coerceRValue is used in the R wrapper function to ensure that the argument is coerced to the appropriate type in R before being passed to the C code. This can perform explicit coercion to change the object and also raise errors if it is not appropriate. convertRValue generates C/C++ code to convert an R value given as a SEXP to the specified target type in C/C++. And convertValueToR is used for converting native types to their R equivalents when they are being returned to R, e.g. as return values of routines or copying fields in a struct/class back to R.

Usage

1
2
3
4
convertRValue(to, name, parm, parameters, typeMap = list(), helperInfo = NULL)
coerceRValue(name, parm, caller = NULL, typeMap = list(), helperInfo = NULL)
convertValueToR(name, parm, parameters, invoke = "", typeMap = list(),
                 out = FALSE, helperInfo = NULL, ...)

Arguments

to

the description of the native type to which the R value is to be converted.

name

the name of the C-level variable holding the R object.

parm

the type description for the target parameter. This is an object derived from TypeDefinition-class

parameters

a named list of the other paramter types. (Is this sometimes a character vector with just the names?)

typeMap

an object that provides customized options for different C/C++ types for any of the three different operations.

invoke

?

helperInfo

currently ignored.

out

currently ignored.

caller

an object that describes the routine that is calling for the coercion of the R object.

...

support for parameters that can be defined by particular methods

Value

These functions return code segments.

Author(s)

Duncan Temple Lang


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