The method declarations section of the specification file includes declarations of methods (constructors and destructors) for packages, objects, relations, and events.
Two methods (operations) are generated to initialize memory when an element is created and clean up memory when the element is destroyed.
For example, the following initializer and cleanup methods are generated for the Default package:
void Default_OMInitializer_Init();
void Default_OMInitializer_Cleanup();
IBM® Rational® Rhapsody® generates a constructor to initialize relations between elements within a package. The relation initializer name has the format <package>_initRelations().
For example, the following method initializes relations between the objects in the Default package:
static void Default_initRelations();
Applying the keyword static to the method allows it to be accessed by other operations in the same file.
Rational Rhapsody generates the following constructors and destructors to deal with events:
For example, Rational Rhapsody generates the following methods for evStart events:
evStart * RiC_Create_evStart();
void RiC_Destroy_evStart(evStart* const me);
void evStart_Init(evStart* const me);
void evStart_Cleanup(evStart* const me);