Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
QFsm Class Reference
Finite State Machine base class. More...
#include <qep.h>
Public Member Functions | |
| virtual | ~QFsm () |
| virtual destructor | |
| void | init (QEvent const *e=(QEvent *) 0) |
| Performs the second step of FSM initialization by triggering the top-most initial transition. | |
| void | dispatch (QEvent const *e) |
| Dispatches an event to a FSM. | |
Protected Member Functions | |
| QFsm (QStateHandler initial) | |
| Protected constructor of a FSM. | |
Protected Attributes | |
| QStateHandler | m_state |
| current active state (state-variable) | |
Detailed Description
Finite State Machine base class.
QFsm represents a traditional non-hierarchical Finite State Machine (FSM) without state hierarchy, but with entry/exit actions.
QFsm is also a base structure for the QHsm class.
- Note:
- QFsm is not intended to be instantiated directly, but rather serves as the base class for derivation of state machines in the application code.
The following example illustrates how to derive a state machine class from QFsm.
Definition at line 76 of file qep.h.
Constructor & Destructor Documentation
| virtual ~QFsm | ( | ) | [virtual] |
virtual destructor
| QFsm | ( | QStateHandler | initial ) | [protected] |
Protected constructor of a FSM.
Performs the first step of FSM initialization by assigning the initial pseudostate to the currently active state of the state machine.
- Note:
- The constructor is protected to prevent direct instantiating of QFsm objects. This class is intended for subclassing only.
Member Function Documentation
| void dispatch | ( | QEvent const * | e ) |
Dispatches an event to a FSM.
Processes one event at a time in Run-to-Completion (RTC) fashion. The argument e is a constant pointer the QEvent or a class derived from QEvent.
- Note:
- Must be called after QFsm::init().
- See also:
- example for QFsm::init()
Definition at line 35 of file qfsm_dis.cpp.
Performs the second step of FSM initialization by triggering the top-most initial transition.
The argument e is constant pointer to QEvent or a class derived from QEvent.
- Note:
- Must be called only ONCE before QFsm::dispatch()
The following example illustrates how to initialize a FSM, and dispatch events to it:
Definition at line 41 of file qfsm_ini.cpp.
Field Documentation
QStateHandler m_state [protected] |
Generated on Tue Jul 12 2022 20:22:36 by
1.7.2