SOM Compiler unqualified modifiers
Unqualified modifiers (described below) include the SOM Compiler-defined
identifiers abstract, baseproxyclass, callstyle, classinit, directinitclasses,
dllname, filestem, functionprefix, majorversion, metaclass, memory_management,
minorversion, somallocte and somdeallocate.
abstract
Specifies that the class is intended
for use as a parent for subclass derivations, but not for creating instances.
baseproxyclass =class
Specifies
the base proxy class to be used by DSOM when dynamically creating a proxy
class for the current class. The base proxy class must be derived from the
class SOMDClientProxy The SOMDClientProxy class will be used
if the baseproxyclass modifier is unspecified. (See chapter 6, "distributed
SOM," for a discussion on customizing proxy classes.)
callstyle
= oidl
Specifies that the method
stub procedures generated by SOM's C/C++ bindings will not include the CORBA-specified
(Environment *ev) and (context *ctx) parameters.
classinit
= procedure
Specifies a user-written
procedure that will be executed to complete the initialization of a class
object after it is created. The classinit modifier is needed if something
should happen exactly once when a class is created. (That is, you
want to define an action that will not be inherited when subclasses are
created. One example of this is for staticdata variables.) When the
classinit modifier is specified in the .idl file for a class, the
implementation file generated by the SOM Compiler provides a template for
the procedure, which includes a parameter that is a pointer to the class.
The class implementor can then fill in the body of this procedure template.
(For an example, see the examples following the staticdata modifier
under "SOM Compiler qualified modifiers.")
directinitclasses
="ancestor1, ancestor2, ..."
Specifies the ancestor class(es) whose initializers
(and destructors) will be directly invoked by this class's initialization
(and destruction) routines. If this modifier is not explicitly specified,
the default setting is the parents of the class. For further information,
see "Initializing and Uninitializing Objects" in Chapter 5, "Implementing
Classes in SOM."
dllname = filename
Specifies the name of the library file that
will contain the class's implementation. If filename contains special
characters (e.g., periods, backslashes), then filename should be
surrounded by double quotes (""). The filename specified can be either
a full pathname, or an unqualified (or partially qualified) filename. In
the latter cases, the LIBPATH environment variable is used to locate the
file.
filestem = stem
Specifies
how the SOM Compiler will construct file names for the binding files it
generates (<stem>.h, <stem>.c, etc.). The default stem is the
file stem of the .idl file for the class.
functionprefix
= prefix
Directs the SOM Compiler
to construct method-procedure names by prefixing method names with "prefix".
For example, "functionprefix = xx;" within an implementation statement
would result in a procedure name of xxfoo for method foo. The default for
this attribute is the empty string. If an interface is defined in a module,
then the default function prefix is the fully scooped interface name. Tip:
Using a function prefix with the same name as the class makes it easier
to remember method-procedure names when debugging.
When an .idl file defines multiple interfaces not contained within a module,
use of a function prefix for each interface is
essential to avoid name collisions. For example, if one interface introduces
a
method and another interface in the same .idl file overrides it, then the
implementation file for the classes will contain two method procedures of
the same name (unless function prefixes are defined for one of the classes),
resulting in a name collision at compile time.
majorversion
= number
Specifies the major version
number of the current class definition. The major version number of a class
definition usually changes only when a significant enhancement or incompatible
change is made to the class. The "number" must be a positive integer less
than 2[32]-1. If a non-zero major version number is specified, SOM will
verify that any code that purports to implement the class has the same major
version number. The default major version number is zero.
memory_management
= corba
Specifies that all methods introduced by the class
follow the CORBA specification for parameter memory management, except where
a particular method has an explicit modifier indicating otherwise (either
"object_owns_result" or "object_owns_parameters"). See the section in Chapter
6 entitled "Memory Management" for a discussion of the CORBA memory-management
requirements.
metaclass = class
Specifies
the class's metaclass. The specified metaclass (or one automatically derived
from it at run time) will be used to create the class object for the class.
If a metaclass is specified, its .idl file (if separate) must be
included in the include section of the class's .idl file. If no metaclass
is specified, the metaclass will be defined automatically.
minorversion
= number
Specifies the minor version
number of the current class definition. The minor version number of a class
definition changes whenever minor enhancements or fixes are made to a class.
Class implementers usually maintain backward compatibility across changes
in the minor version number. The "number" must be a positive integer less
than 2[32]-1. If a non-zero minor version number is specified, SOM will
verify that any code that purports to implement the class has the same or
a higher minor version number. The default minor version number is zero.
somallocate=procedure
Specifies
a user-written procedure that will be executed to allocate memory for class
instances when the somAllocate class method is invoked.
somdeallocate=procedure
Specifies a user-written procedure that will
be executed to deallocate memory for class instances when the somDeallocate
class method is invoked.
The following example illustrates the specification of unqualified interface
modifiers:
implementation {
filestem = hello;
functionprefix = hel;
majorversion = 1;
minorversion = 2;
classinit = helloInit;
metaclass = M_Hello;
};
[Back: Modifier statements]
[Next: SOM Compiler qualified modifiers]