Initializing statecharts

The initStatechart() operation initializes the statechart for a reactive object.

About this task

For example, the following initStatechart() operation, generated in the implementation file for the HomeHeatingSystem, initializes the statechart for HomeHeatingSystem:

static void initStatechart(HomeHeatingSystem* const me) {
   me->rootState_subState = HomeHeatingSystem_RiCNonState;
   me->rootState_active = HomeHeatingSystem_RiCNonState;
}

This routine initializes the rootState_subState and rootState_active pointers for the HomeHeatingSystem object to <object>_RiCNonState (the default state is 0) when the object is created.


Feedback