Accessing and modifying attributes
Attributes
are accessed through the me
pointer,
which provides a context for the current object. Therefore, specifying
conditions, assigning values, and performing calculations requires
accessing attributes through this context variable.
About this task
Note: You can
specify the
actual name of the
context variable generated as an argument to an operation using the
properties for the operation.
For example, in the Room statechart, testing the condition for heat demand is expressed as follows:
me->ctemp < me->wtemp
When entered as a guard on the transition from the heatOK state to the
needsHeat state in the heatMode region of the statechart, this comparison determines
whether the Room
's current temperature is lesser than the working
temperature.