Checking the state of an object

The IN() operation checks whether an object is in a particular state.

About this task

The IN() operation name has the following format:

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

It returns True if the object is in the state, and False otherwise.

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

/*systemControl:*/
int HomeHeatingSystem_systemControl_IN(
   HomeHeatingSystem* const me);

This operation has the following implementation:

int HomeHeatingSystem_systemControl_IN(
   HomeHeatingSystem* const me) {
   return me->rootState_subState ==
      HomeHeatingSystem_systemControl;
}

Note the following:


Feedback