genericCOMHandler: Dispatch mechanism for arbitrary S object

genericCOMHandlerR Documentation

Dispatch mechanism for arbitrary S object

Description

This function is used to create a dynamic dispatch handler for representing an arbitrary S object as a COM object. It takes the S object and exports its named elements and attributes as properties and allows clients to call arbitrary S functions as methods with this object as the first argument.

Usage

genericCOMHandler(obj)

Arguments

obj

the S object to be exported as a COM object.

Details

This creates a closure that has access to the object and which provides methods for the Invoke and GetIDsOfNames methods for a COM object. These are then passed to the C++ constructor function for the C++ class RCOMSObject which calls these methods when the corresponding COM object methods are invoked.

Value

A list with two elements

Invoke

the function which is called in response to low-level COM invocations for this object. It is given the integer identifier for the method, the style of invocation as a logical vector of length 4, the argument values, the integer identifiers for the names of any named arguments. The arguments are given in reverse order and the named arguments come first. See genericCOMHandler for an example.

GetIDsOfNames

a function that maps the names of methods, properties and argument parameters to integers that are fixed across calls. This allows clients to cache these values.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

http://www.omegahat.org/RDCOMServer http://www.omegahat.org/RDCOMClient


omegahat/RDCOMServer documentation built on July 17, 2022, 7:25 p.m.