SOM Kernel Reference 1-131
As mentioned previously, the object-initialization framework supported by SOMobjects
allows a class to support additional initializer methods besides somDefaultInit. These
additional initializers will typically include special-purpose arguments, so that objects of the
class can be initialized with special capabilities or characteristics. For each new initializer
method, the implementation section must include the method name with the init modifier.
Also, the directinitclasses modifier can be used if, for some reason, the class implementor
wants to control the order in which ancestor initializers are executed.
Notes: It is recommended that the method name for an initializer method include the class
name as a prefix. A newly defined initializer method will include an implicit Environment
argument if the class does not use a callstyle=oidl modifier.
Important: There are important constraints associated with modification of the procedure
stubs for initializers. These are documented in Section 5.5 of the SOMobjects Developer
Toolkit Users Guide.
Parameters
receiver A pointer to an object.
ctrl A pointer to a somInitCtrl data structure. SOMobjects uses this data
structure to control the initialization of the ancestor classes, thereby
ensuring that no ancestor class receives multiple initialization calls.
Example
// SOM IDL
#include <Animal.idl>
interface Dog : Animal
{
implementation {
releaseorder: ;
somDefaultInit: override, init;
};
};
Original Class
SOMObject
Related Information
Methods: somDestruct
Commenti su questo manuale