Constructors and destructors

A default constructor and destructor are generated for each class. You can explicitly specify additional constructors, or override the default constructor or destructor by explicitly adding them to the model.

For example:

class::class(OMThread* thread) {
   NOTIFY_CONSTRUCTOR(class, class(), 0,
      class_SERIALIZE);
   setThread(thread);
   initRelations();
};

If you are defining states, use initStatechart instead of initRelations:

class::~class() {
   NOTIFY_DESTRUCTOR(~class);
   cleanUpRelations();
};

Similarly, if you are defining states, use cleanUpStatechart instead of cleanUpRelations.


Feedback