Exiting from a state

The exit() operation allows an object to exit from a state. It also executes any user‑defined action on exit for the state.

About this task

The exit() operation name has the following format:

<object>_<state>_exit(<object*> const <me>)

For example, the following exit() operation is generated for the systemControl state in the HomeHeatingSystem:

void HomeHeatingSystem_systemControl_exit(
   HomeHeatingSystem* const me);

This operation has the following implementation:

void HomeHeatingSystem_systemControl_exit(
   HomeHeatingSystem* const me) {
      RiCTask_unschedTm(me->ric_reactive.myTask,
         HomeHeatingSystem_Timeout_systemControl_id,
         &me->ric_reactive);
      NOTIFY_STATE_EXITED(me, HomeHeatingSystem,
         "ROOT.systemControl");
}
Note: An exit() operation is generated for the root state.

Feedback