In the constructor we can specify the initial one.
The FSM maintains the current state by means of a pointer to one of the class methods.
Then, whenever a new events in received, *handleEvent()* dereferences the current state pointer, calling the relative method (and passing the event as parameter):
Then, whenever a new event is received, *handleEvent()* dereferences the current state pointer, calling the relative method (and passing the event as parameter):