VariableReference-class: Class "VariableReference"

VariableReference-classR Documentation

Class "VariableReference"

Description

This class allows us to represent a reference to a native variable. We hold the address of the native variable in our R object and can access the value of it from within R via this object. We do not hold the value of the variable in the R object but the address of the native variable. This allows us to query its value at any moment, and allow us to obtain its value should it change. In some ways, this acts like a dynamic variable. We can get the value of the native variable at any time but the value assigned to that variable may change at any time (due to native code).

Objects from the Class

Objects can be created by calls of the form new("VariableReference", ...).

Slots

ref:

Object of class "RC++Reference" This is the address of/reference to the native object.

Extends

Class "ANY", directly, with explicit coerce.

Methods

asReference

signature(x = "VariableReference"): ...

coerce

signature(from = "VariableReference", to = "ANY"): coerce the value of the native variable to an R object

coerce

signature(from = "VariableReference", to = "integer"): coerce the value of the native variable to an R integer vector

coerce

signature(from = "VariableReference", to = "logical"): coerce the value of the native variable to an R logical vector

coerce

signature(from = "VariableReference", to = "numeric"): coerce the value of the native variable to an R numeric vector

Author(s)

Duncan Temple Lang

See Also

The RGCCTranslationUnit package

Examples

showClass("VariableReference")

omegahat/RAutoGenRunTime documentation built on Jan. 12, 2023, 9:19 p.m.