ClassDefinition-class: Classes representing code for defining DCOM classes.

ClassDefinition-classR Documentation

Classes representing code for defining DCOM classes.

Description

These classes are used to represent pending or would-be R class definitions for DCOM interfaces. These are converted into actual commands to define R classes when the code is written via writeCode to a file for use in future R sessions. So these are not class definitions directly, but representation of information about how to define particular classes.

ClassDefinition is a virtual class. This provides a slot inherited by the other two classes giving the name of the new class to be defined.

NamedClassDefinition is a simple class that contains information about the names of the class(es) that the new class extends.

InlinedClassDefinition uses a slightly different representation, which is the R command (as a string) that defines the class. This allows it to include more complex structure in the setClass command such as a prototype.

The function classDefinitionString is used to convert an instance these classes into a string (a character vector of length 1) that can be used within code to define the class.

Objects from the Class

Objects can be created by calls of the form new("InlineClassDefinition", ...) and new("NamedClassDefinition").

Slots

code:

Object of class "character". For NamedClassDefinition, this is a character vector giving the name of the new class being defined, and the class(es) that it contains. This is conveted into a definition as setClass(x@className, contains = x@code[2]), so currently only the second element is really used.

For InlineClassDefinition, again the className gives the name of the new class being defined. The code slot is a string that gives the R command to define the new class. As such, it is entirely free form but must evaluate correctly when parsed and evaluated by the R interpreter.

className:

Object of class "character". This is a string (i.e. vector of length 1) that gives the name of the new class being defined.

Methods

No methods defined with class "ClassDefinition" in the signature.

Author(s)

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

References

http://msdn.microsoft.com/library http://www.omegahat.org/RWinTypeLibs

See Also

classDefinitionString generateInterface

getListClassName computeClassName

Examples

 new("NamedClassDefinition", 
      className = "Workbook",
      code = "CompiledCOMIDispatch")

 cmd = "setClass('Workbooks', contains = 'COMNamedTypedList',
                 prototype = list(name = '_Workbook'))"
 new("InlineClassDefinition", 
      className = "Workbooks",
      code = cmd)

omegahat/SWinTypeLibs documentation built on Jan. 17, 2024, 6:40 p.m.