Event class.
More...
#include "qp.hpp"
|
static constexpr std::uint8_t | MARKER {0xE0U} |
|
Event class.
- Description
- Class
QEvt
represents QP events and serves as the base class for derivation of events with parameters.
- Attention
- The
QEvt
subclasses are forbidden from having any virtual functions, including virtual destructors.
- Traceability
-
- Usage
- The following example illustrates how to add event parameter(s) by inheriting the QP::QEvt class:
- Note
- Please see QEvt::QEvt(QSignal) for examples of instantiating event objects (immutable and mutable on the stack). Please see Q_NEW()/Q_NEW_X() for code examples of allocating dynamic mutable events.
Definition at line 139 of file qp.hpp.
◆ DynEvt
Enumerator |
---|
DYNAMIC | dummy parameter for dynamic event constructor (see QEvt::QEvt(DynEvt))
|
Definition at line 149 of file qp.hpp.
◆ QEvt() [1/2]
|
inlineexplicitconstexprnoexcept |
Event constexpr
constructor applicable to immutable and mutable event instances.
- Parameters
-
[in] | s | signal of the event to initialize (for non-dynamic events) |
- Traceability
-
- Usage
- The following examples illustrate recommended ways to use this QEvt(QSignal) constructor to instantiate event objects based on the RAII principle (Resource Acquisition Is Initialization).
static QP::QEvt const myEvt { APP::MY_SIG };
static APP::KeypressEvt const keyEvt { APP::KEYPRESS_SIG, 12U };
static APP::KeypressEvt const keyboardEvt[] {
{ APP::KEYPRESS_SIG, 12U },
{ APP::KEYPRESS_SIG, 13U }
};
APP::KeypressEvt keyEvt {
sig, keyId };
Definition at line 157 of file qp.hpp.
◆ QEvt() [2/2]
Disallowed default event constructor.
- Description
- The default event constructor is explicitly disallowed (
= delete
), so that all subclasses of QP::QEvt must provide constructors.
◆ ctor()
◆ verify_()
QEvt::verify_ |
( |
QEvt const *const | e | ) |
|
|
inlinestaticnoexcept |
Internal function to verify the event pointer and the memory marker in the event (QP FuSa Subsystem)
- Returns
- 'true' if this event passes the integrity check and 'false' otherwise.
Definition at line 163 of file qp.hpp.
◆ getPoolNum_()
std::uint_fast8_t QP::QEvt::getPoolNum_ |
( |
| ) |
const |
|
inlinenoexcept |
◆ sig
◆ refCtr_
Reference counter (for mutable events, and 0 for immutable (statc) events)
- Traceability
-
Definition at line 142 of file qp.hpp.
◆ evtTag_
Event "tag" containing pool-ID (indicating which event pool it came from) plus event marker
- Description
- The 8-bit
evtTag_
member stores the event-pool number (in bits 0:3) and the QEvt::MARKER memory marker for integrity checking (in bits 4:7). In the special case of immutable events (not from event pools) the event-pool number bits are 0 (but bits 4:7 must still hold the QEvt::MARKER memory marker).
- Traceability
-
Definition at line 143 of file qp.hpp.
◆ MARKER
QP::QEvt memory marker (for internal integrity checks)
- Description
- The marker is implanted in bits 4:7 of QEvt::evtTag_.
Definition at line 146 of file qp.hpp.
The documentation for this class was generated from the following files: