Listing 1: Declaration of the Bomb FSM from Figure 2(b).

 1: class Bomb : public Fsm {
 2:    int myTimeout;            // extended state variable
 3: public:
 4:    Bomb() : Fsm((State)&Bomb::initial) {}       // ctor
 5:    void initial(Event const *e); // initial pseudostate
 6:    void setting(Event const *e);       // state handler
 7:    void timing(Event const *e);        // state handler
 8:    void blast(Event const *e);         // state handler
 9: };