Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | tasking | |
Tool | servers |
The create function creates an object. The object that is created must be one of those inside the specified server.
Every C++ object that can be created with this function has a className member function. The string returned by this function is the string that must be specified in the type argument to create an instance of that class.
Some objects may be constructed only using a default constructor. For these objects the creator and invokerecord arguments should be left at their default values.
Objects which can be constructed in multiple ways will have a ``factory'' class associated with them. This factory class will map the string specified in the creator argument into the appropriate constructor.
Some constructors may require additional parameters and these are specified using fields in the invokerecord argument. The parameters that are relevant are defined using Parameter objects in the appropriate factory class.
id | Identifies which server to use | ||
Allowed: | A positive integer obtained from the activate function. | ||
Default: | no default | ||
type | The object to create. | ||
Allowed: | A string that corresponds to the output of the className function in the C++ class. | ||
Default: | no default | ||
creator | A string indicating which constructor to use. | ||
Allowed: | An empty string or one that matches a string in the ``factory'' class. | ||
Default: | An empty string | ||
invokerecord | Additional construction parameters | ||
Allowed: | A record with fields containing additional construction parameters. | ||
Default: | An empty record |
include 'servers.g'; private := [=]; private.serverid := defaultservers.activate('componentlist');, private.toolid := defaultservers.create(private.serverid, 'componentlist', 'readcomponentlist', [filename='crux.cl', readonly=T]);This will start up the componentlist process on the current machine. It then creates a componentlist object, using the ``readcomponentlist'' constructor. This constructor has two arguments the file to open and whether it should be opened read-only.