setProxyClass {XR} | R Documentation |
Create a Proxy Class
Description
Creates a proxy class of a given name and other requirements. Usually infers fields and methods from server language metadata, but can also use explicitly supplied values. Particular interface packages will typically have a specialized version that calls this function.
Usage
setProxyClass(Class, module = "", fields = character(), methods = NULL,
ServerClass = Class, where = topenv(parent.frame()),
contains = character(), evaluatorClass,
proxyObjectClass = "ProxyClassObject", language = if (is.null(evaluator))
"" else evaluator$languageName, readOnly = NULL, ..., save = FALSE,
objName = Class, docText = NULL)
Arguments
Class |
the name of the class to be used in the proxy, usually just the server language class. |
module |
the name of the server langauge module if it needs to be imported. |
fields , methods |
explicit field and method information if this cannot be found by inspection. Normally omitted. |
ServerClass |
the name of the server language class, normall defaults to |
where |
the environment for the class definition. By default, and nearly always, the namespace of the
package in which the call to |
contains |
explicitly needed superclasses if any. |
evaluatorClass |
the evaluator class to identify the evaluator, e.g. |
proxyObjectClass |
The general class for proxy objects in this interface. Typically
obtained automatically from the |
language |
the server language, taken from the evaluator if one is found. |
readOnly |
character vector of any field names that should be marked read-only. |
... |
extra arguments to pass on to |
save |
If the proxy class is being defined in an application package,
use this to write to a source file (see Ch. 12 of Extending R)
Default |
objName |
When using the |
docText |
metadata information supplied by the interface for a particular server language. |
Details
A proxy class has fields and methods that are created to use the corresponding fields
and methods of the server language, through an interface evaluator. This function
normally expects information about the class to be returned by the $ServerClassDef()
method of the evaluator, specialized to the language. It can also be called with explicit
lists for the fields and methods. The actual fields and methods will use the interface to
access or call the corresponding code in the server language.
Value
a generator object for the R class, along with the side effect of setting the class definition.
References
Chambers, John M. (2016) Extending R, Chapman & Hall/CRC. ( Chapter 13, discussing this package, is included in the package: ../doc/Chapter_XR.pdf.)