构造函数和析构函数

对于每个类,都会生成缺省的构造函数和析构函数。您可以显式指定其他构造函数,或者通过显式将其添加到模型中来覆盖缺省的构造函数或析构函数。

例如:

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

如果您要定义状态,请使用 initStatechart,而不是 initRelations

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

类似地,如果您要定义状态,请使用 cleanUpStatechart,而不是 cleanUpRelations


反馈