copyToR: Copy a native C/C++ object to an R representation

copyToRR Documentation

Copy a native C/C++ object to an R representation

Description

This function is intended to be a simple coercion function that converts a reference to C/C++ object to the corresponding class in R. Each '*Ptr' class has an associated R class that mirrors the fields in the C/C++ structure with slots in the R class definition. This function converts the '*Ptr' object to this R-based form. It is meant as a simplified way to perform coercion with as(obj, "MyClass") where obj is an object of class MyClassPtr. This approach means the caller doesn't have to know the name of the target R class (or of the reference class).

Usage

copyToR(obj)

Arguments

obj

the reference to the native data structure that is to be copie to an R representation.

Author(s)

Duncan Temple Lang

References

“Writing R Extensions Manual”, R Development Core Team

The RAutoGenRunTime package for programmatically reading C/C++ code and generating bindings for the data structures, methods and routines.


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