QP/C  7.3.4
Real-Time Embedded Framework
Loading...
Searching...
No Matches
Core Classes in QP

Purpose and ScopeClasses in QXK

Architecture Items

The following class diagram shows the main classes comprising the QP Framework and their relation to the application-level code, such as the Flyn 'n' Shoot game example application (shown at the bottom 1/3 of the diagram).

Figure 210: Main Classes in the QP Framework

ARC-QP-02_10

ARC-QP-02_10
QEvt class
Detailed Description
The QEvt class (Figure 210[0]) represents events without parameters and serves as the base class for derivation of events with parameters as well as time events. For example, application-level events ObjectPosEvt and ObjectImageEvt (Figure 210[8]) inherit QEvt and add to it some parameters.

ARC-QP-02_20

ARC-QP-02_20
QAsm abstract class
Detailed Description
The abstract QAsm class (Figure 210[1]) is the Abstract Base Class (ABC) for all State Machines in the framework. This class specifies the abstract state machine interface.

ARC-QP-02_30

ARC-QP-02_30
QHsm class
Detailed Description
The QHsm class (Figure 210[2]) represents a Hierarchical State Machine (HSM) with full support for hierarchical nesting of states, entry/exit actions, initial transitions, and transitions to history in any composite state. This class is designed for ease of manual coding of HSMs in C, but it is also supported by the QM modeling tool. QHsm is also the base class for the QMsm state machine, which provides a superior efficiency, but requires the use of the QM modeling tool to generate code.

ARC-QP-02_40

ARC-QP-02_40
QMsm class
Detailed Description
The QMsm class (Figure 210[3], QM State Machine) derives from QHsm and implements the fastest and the most efficient strategy for coding hierarchical state machines, but this strategy is not human-maintainable and requires the use of the QM modeling tool. The class is abstract, meaning that it is not designed to be instantiated directly, but rather only for inheritance.

ARC-QP-02_60

ARC-QP-02_60
QTimeEvt class
Detailed Description
The QTimeEvt class (Figure 210[10]) represents time events in QP. Time events are special QP events equipped with the notion of time passage. The basic usage model of the time events is as follows. An active object allocates one or more QTimeEvt objects (provides the storage for them). When the active object needs to arrange for a timeout, it arms one of its time events to fire either just once (one-shot) or periodically. Each time event times out independently from the others, so a QP application can make multiple parallel timeout requests (from the same or different active objects). When QP detects that the appropriate moment has arrived, it inserts the time event directly into the recipient's event queue. The recipient then processes the time event just like any other event.

ARC-QP-02_70

ARC-QP-02_70
QActive class
Detailed Description
The abstract QActive class (Figure 210[12]) represents an active object that uses the QHsm style implementation strategy for state machines. This strategy is tailored to manual coding, but it is also supported by the QM modeling tool. The resulting code is slower than in the QMsm-style implementation strategy. The game application provides an example of application-level classes deriving from QActive and QHsm (see Figure 210[6] and Figure 210[7]).

ARC-QP-02_80

ARC-QP-02_80
QMActive abstract class
Detailed Description
The abstract QMActive class (Figure 210[13]) represents an active object that uses the QMsm state machine implementation strategy. This strategy requires the use of the QM modeling tool to generate state machine code automatically, but the code is faster than in the QHsm style implementation strategy and needs less run-time support (smaller event-processor).

Purpose and ScopeClasses in QXK