qpcpp/doxygen/snippets/qep_qfsm.cpp

16 lines
542 B
C++
Raw Normal View History

2015-12-31 14:56:37 -05:00
class Bomb : public QFsm { // derived from QFsm
2013-10-10 20:01:51 -04:00
uint8_t m_timeout; // number of seconds till explosion
uint8_t m_defuse; // the secret defuse code
uint8_t m_code; // the current defuse code entry
2012-08-14 18:00:48 -04:00
public:
2015-12-31 14:56:37 -05:00
Bomb() : QFsm(Q_STATE_CAST(&QBomb::initial)) {
2012-08-14 18:00:48 -04:00
}
protected:
2015-12-31 14:56:37 -05:00
static QState initial(Bomb * const me, QEvt const *e);
static QState setting(Bomb * const me, QEvt const *e);
static QState timing(Bomb * const me, QEvt const *e);
static QState blast(Bomb * const me, QEvt const *e);
2012-08-14 18:00:48 -04:00
};