The state machine generator create or update the classes implementing a behavioral state machine on which it is applied.
Currently the state machine generator only generates C++ definitions.
When you apply this plug-out on a state machine, a class having the same name (removing non legal characters) is created (or updated in case it already exist) in the same class view to implement it. This class doesn't contain static attributes and may have several instances. Each sub-state is managed through an own sub-class, the tree of the states and the associated classes is the same. For each trigger, whatever the state waiting for it, an operation having the same name (the C++ trigger must have a legal C++ name, the C++ guards must be legal C++ forms etc ...) is defined. Currently the triggers can't have parameters, and a transition can't have several triggers. You must apply these operations on the instance of the class implementing the state machine to simulate the event, the returned value is true until the final state is reached. The operation starting the execution is named create (the only legal trigger for a transition from an initial pseudo state). A trigger's name can't start by the character '_', allowing me to produce operations and attributes starting by '_' without collision.
For instance, in case you apply the state machine generator on the following state machine :
you will obtain these definitions :
Having an instance of ReadAmount, you must first call create to execute the initial transition, then you may call otherAmount etc ...
Previous : Idl generator
Next : XMI generator