QP/C++ Framework namespace. More...
Namespaces | |
| namespace | QF |
| QF Active Object Framework namespace. | |
Classes | |
| class | QEQueue |
| Native QF Event Queue. More... | |
| class | QK |
| QK preemptive non-blocking kernel. More... | |
| class | QMPool |
| Native QF Memory Pool. More... | |
| class | QEvt |
| Event class. More... | |
| struct | QMState |
| State object for the QP::QMsm class (QM State Machine). More... | |
| struct | QMTranActTable |
| Transition-Action Table for the QP::QMsm State Machine. More... | |
| union | QAsmAttr |
| Attribute of for the QP::QAsm class (Abstract State Machine). More... | |
| class | QAsm |
| Abstract State Machine class (state machine interface). More... | |
| class | QHsm |
| Hierarchical State Machine class (QHsm-style state machine implementation strategy). More... | |
| class | QMsm |
| Hierarchical State Machine class (QMsm-style state machine implementation strategy). More... | |
| class | QPSet |
| Set of Active Objects of up to QF_MAX_ACTIVE elements. More... | |
| class | QSubscrList |
| Subscriber List (for publish-subscribe). More... | |
| class | QActive |
| Active object class (based on the QP::QHsm implementation strategy). More... | |
| class | QMActive |
| Active object class (based on QMsm implementation strategy). More... | |
| class | QTimeEvt |
| Time Event class. More... | |
| class | QTicker |
| "Ticker" Active Object class More... | |
| struct | QSpyId |
| QS ID type for applying local filtering. More... | |
| class | QS |
| Software tracing instrumentation target-resident component. More... | |
| class | QHsmDummy |
| Dummy hierarchical state machine class for testing. More... | |
| class | QActiveDummy |
| Dummy Active Object for testing. More... | |
| union | Endiannes |
| class | QV |
| QV non-preemptive kernel. More... | |
| class | QXK |
| QXK dual-mode (non-blocking / blocking) kernel. More... | |
| class | QXThread |
| eXtended (blocking) thread of the QXK preemptive kernel More... | |
| class | QXSemaphore |
| Counting Semaphore of the QXK preemptive kernel. More... | |
| class | QXMutex |
| Blocking Mutex of the QXK preemptive kernel. More... | |
Typedefs | |
| using | QEQueueCtr = std::uint16_t |
| The data type to store the ring-buffer counters. | |
| using | QSchedStatus = std::uint8_t |
| The scheduler lock status for QK::schedLock() and QK::schedUnlock(). | |
| using | QMPoolSize = std::uint16_t |
| The data type to store the block-size based on the macro QF_MPOOL_SIZ_SIZE. | |
| using | QMPoolCtr = std::uint16_t |
| The data type to store the block-counter based on the macro QF_MPOOL_CTR_SIZE. | |
| using | QSignal = std::uint16_t |
| The signal of event QP::QEvt. | |
| using | QEvtPtr = QEvt const * |
| Pointer to const event instances passed around in QP/C++ Framework. | |
| using | QState = std::uint_fast8_t |
| Type returned from state-handler functions. | |
| using | QStateHandler = QState (*)(void * const me, QEvt const * const e) |
| Pointer to a state-handler function. | |
| using | QActionHandler = QState (*)(void * const me) |
| Pointer to an action-handler function. | |
| using | QXThreadHandler = void (*)(QXThread * const me) |
| Pointer to an extended-thread handler function. | |
| using | QPrioSpec = std::uint16_t |
| Priority specification for Active Objects in QP. | |
| using | QTimeEvtCtr = std::uint32_t |
| Data type to store the block-size defined based on the macro QF_TIMEEVT_CTR_SIZE. | |
| using | QPSetBits = std::uint32_t |
| Bitmask for the internal representation of QPSet elements. | |
| using | QSObj = std::uint32_t |
| using | QSFun = std::uint32_t |
| using | QSpyFunPtr = void (*)() |
| using | QSTimeCtr = std::uint32_t |
| Unsigned integer type for QS timestamps. | |
Functions | |
| char const * | version () noexcept |
| std::uint_fast8_t | QF_LOG2 (QP::QPSetBits const bitmask) noexcept |
| void | QEvt_refCtr_inc_ (QEvt const *const me) noexcept |
| Internal function to increment the refCtr of a const event. | |
| void | QEvt_refCtr_dec_ (QEvt const *const me) noexcept |
| Internal function to decrement the refCtr of a const event. | |
| template<typename T_> | |
| static T_ | dis_update (T_ const org) |
| Internal function template to calculate the Duplicate Inverse Storage (DIS). | |
| template<typename T_> | |
| static bool | dis_verify (T_ const org, T_ const dis) |
| Internal function template to verify the Duplicate Inverse Storage (DIS). | |
| void | QXK_contextSw_ (QActive *const next) noexcept |
| QXK context switch management. | |
| std::int_fast8_t | tran_simple_ (QStateHandler *const path, std::uint_fast8_t const qsId) |
| std::int_fast8_t | tran_complex_ (QStateHandler *const path, std::uint_fast8_t const qsId) |
| void | enter_target_ (QStateHandler *const path, std::int_fast8_t const depth, std::uint_fast8_t const qsId) |
Variables | |
| constexpr QSignal | Q_USER_SIG {4U} |
| std::array< QActive *, QF_MAX_ACTIVE+1U > | QActive_registry_ |
| Internal array of pointers to the registered Active Objects. | |
| QSubscrList * | QActive_subscrList_ |
| Internal pointer to the array of subscribers to the event-signals. | |
| QSignal | QActive_maxPubSignal_ |
| Internal maximum published signal (# used entries in the QP::QActive_subscrList_ array). | |
| std::array< QTimeEvt, QF_MAX_TICK_RATE > | QTimeEvt_head_ |
| Internal heads of the time-event linked-lists (by clock-tick rate). | |
| constexpr std::uint8_t | QTE_FLAG_IS_LINKED {1U << 7U} |
| constexpr std::uint8_t | QTE_FLAG_WAS_DISARMED {1U << 6U} |
| constexpr std::int_fast16_t | QS_GRP_ALL { 0xF0 } |
| constexpr std::int_fast16_t | QS_GRP_SM { 0xF1 } |
| constexpr std::int_fast16_t | QS_GRP_AO { 0xF2 } |
| constexpr std::int_fast16_t | QS_GRP_EQ { 0xF3 } |
| constexpr std::int_fast16_t | QS_GRP_MP { 0xF4 } |
| constexpr std::int_fast16_t | QS_GRP_TE { 0xF5 } |
| constexpr std::int_fast16_t | QS_GRP_QF { 0xF6 } |
| constexpr std::int_fast16_t | QS_GRP_SC { 0xF7 } |
| constexpr std::int_fast16_t | QS_GRP_SEM { 0xF8 } |
| constexpr std::int_fast16_t | QS_GRP_MTX { 0xF9 } |
| constexpr std::int_fast16_t | QS_GRP_U0 { 0xFA } |
| constexpr std::int_fast16_t | QS_GRP_U1 { 0xFB } |
| constexpr std::int_fast16_t | QS_GRP_U2 { 0xFC } |
| constexpr std::int_fast16_t | QS_GRP_U3 { 0xFD } |
| constexpr std::int_fast16_t | QS_GRP_U4 { 0xFE } |
| constexpr std::int_fast16_t | QS_GRP_UA { 0xFF } |
| constexpr std::int_fast16_t | QS_USER { 100 } |
| constexpr std::int_fast16_t | QS_USER0 { QS_USER } |
| constexpr std::int_fast16_t | QS_USER1 { QS_USER + 5 } |
| constexpr std::int_fast16_t | QS_USER2 { QS_USER + 10 } |
| constexpr std::int_fast16_t | QS_USER3 { QS_USER + 15 } |
| constexpr std::int_fast16_t | QS_USER4 { QS_USER + 20 } |
| constexpr std::int_fast16_t | QS_ID_AO { 0 } |
| constexpr std::int_fast16_t | QS_ID_EP { 64 } |
| constexpr std::int_fast16_t | QS_ID_EQ { 80 } |
| constexpr std::int_fast16_t | QS_ID_AP { 96 } |
| constexpr std::int_fast16_t | QS_IDS_ALL { 0xF0 } |
| constexpr std::int_fast16_t | QS_IDS_AO { 0xF1 } |
| constexpr std::int_fast16_t | QS_IDS_EP { 0xF2 } |
| constexpr std::int_fast16_t | QS_IDS_EQ { 0xF3 } |
| constexpr std::int_fast16_t | QS_IDS_AP { 0xF4 } |
| constexpr std::uint16_t | QS_EOD { 0xFFFFU } |
| constexpr std::uint8_t | QS_CMD { 0x07U } |
| constexpr std::uint8_t | QS_HEX_FMT {0xFU} |
| constexpr std::uint8_t | QS_RXATTR_SIZE {128U} |
| constexpr std::uint8_t | QUTEST_ON_POST {124U} |
| constexpr std::uint8_t | QS_FRAME {0x7EU} |
| constexpr std::uint8_t | QS_ESC {0x7DU} |
| constexpr std::uint8_t | QS_ESC_XOR {0x20U} |
| constexpr std::uint8_t | QS_GOOD_CHKSUM {0xFFU} |
| constexpr union QP::Endiannes | QS_ENDIANNES = { static_cast<std::uint16_t>(0x7F00U) } |
| char const | BUILD_DATE [12] = __DATE__ |
| char const | BUILD_TIME [9] = __TIME__ |
| constexpr QTimeEvtCtr | QXTHREAD_NO_TIMEOUT {0U} |
| No-timeout when blocking on semaphores/mutextes/event-queues. | |
| QXK | QXK_priv_ |
| static constexpr char | versionStr [24] = "QP/C++ " QP_VERSION_STR |
QP/C++ Framework namespace.
| using QP::QEQueueCtr = std::uint16_t |
The data type to store the ring-buffer counters.
Details
The type is based on the macro QF_EQUEUE_CTR_SIZE. The dynamic range of this data type determines the maximum length of the ring buffer managed by the native QF event queue.
Definition at line 41 of file qequeue.hpp.
| typedef std::uint_fast16_t QP::QSchedStatus = std::uint8_t |
The scheduler lock status for QK::schedLock() and QK::schedUnlock().
The scheduler lock status for QP::QXK::schedLock() and QP::QXK::schedUnlock().
| using QP::QMPoolSize = std::uint16_t |
The data type to store the block-size based on the macro QF_MPOOL_SIZ_SIZE.
Details
The dynamic range of this data type determines the maximum size of blocks that can be managed by the native QF event pool.
Definition at line 49 of file qmpool.hpp.
| using QP::QMPoolCtr = std::uint16_t |
The data type to store the block-counter based on the macro QF_MPOOL_CTR_SIZE.
Details
The dynamic range of this data type determines the maximum number of blocks that can be stored in the pool.
Definition at line 59 of file qmpool.hpp.
| using QP::QSignal = std::uint16_t |
The signal of event QP::QEvt.
Details
The relationship between an event and a signal is as follows. A signal in UML is the specification of an asynchronous stimulus that triggers reactions, and as such is an essential part of an event. (The signal conveys the type of the occurrence–what happened?) However, an event can also contain additional quantitative information about the occurrence in the form of event parameters.
| using QP::QEvtPtr = QEvt const * |
| using QP::QState = std::uint_fast8_t |
| using QP::QStateHandler = QState (*)(void * const me, QEvt const * const e) |
| using QP::QActionHandler = QState (*)(void * const me) |
| using QP::QXThreadHandler = void (*)(QXThread * const me) |
| using QP::QPrioSpec = std::uint16_t |
Priority specification for Active Objects in QP.
Details
Active Object priorities in QP are integer numbers in the range [1..QF_MAX_ACTIVE], whereas the special priority number 0 is reserved for the lowest-priority idle thread. The QP Framework uses the direct priority numbering, in which higher numerical values denote higher urgency. For example, an AO with priority 32 has higher urgency than an AO with priority 23.
QP::QPrioSpec allows an application developer to assign two priorities to a given AO (see also Q_PRIO()):
In the QP native preemptive kernels, like QK, the "preemption-threshold" priority is used as to implement the "preemption-threshold scheduling" (PTS). It determines the conditions under which a given thread can be preempted by other threads. Specifically, a given thread can be preempted only by another thread with a higher priority than the "preemption-threshold" of the original thread.

| using QP::QTimeEvtCtr = std::uint32_t |
Data type to store the block-size defined based on the macro QF_TIMEEVT_CTR_SIZE.
Details
The dynamic range of this data type determines the maximum block size that can be managed by the pool.
| using QP::QPSetBits = std::uint32_t |
| using QP::QSpyFunPtr = void (*)() |
| using QP::QSTimeCtr = std::uint32_t |
Unsigned integer type for QS timestamps.
Details
The dynamic range of QP::QSTimeCtr is configurable by the macro QS_TIME_SIZE, which can take values 1-byte (256 counts), 2-bytes (64K counts) and 4-bytes (4G counts).
| enum QP::QS_Groups_old : std::int16_t |
| enum QP::QS_GlbPredef : std::int8_t |
Pre-defined QS record IDs (for QS_GLB_FILTER()).
| Enumerator | |
|---|---|
| QS_EMPTY | QS record for cleanly starting a session. |
| QS_QEP_STATE_ENTRY | a state was entered |
| QS_QEP_STATE_EXIT | a state was exited |
| QS_QEP_STATE_INIT | an initial transition was taken in a state |
| QS_QEP_INIT_TRAN | the top-most initial transition was taken |
| QS_QEP_INTERN_TRAN | an internal transition was taken |
| QS_QEP_TRAN | a regular transition was taken |
| QS_QEP_IGNORED | an event was ignored (silently discarded) |
| QS_QEP_DISPATCH | an event was dispatched (begin of RTC step) |
| QS_QEP_UNHANDLED | an event was un-handled due to a guard |
| QS_QF_ACTIVE_DEFER | AO deferred an event. |
| QS_QF_ACTIVE_RECALL | AO recalled an event. |
| QS_QF_ACTIVE_SUBSCRIBE | an AO subscribed to an event |
| QS_QF_ACTIVE_UNSUBSCRIBE | an AO unsubscribed to an event |
| QS_QF_ACTIVE_POST | an event was posted (FIFO) directly to AO |
| QS_QF_ACTIVE_POST_LIFO | an event was posted (LIFO) directly to AO |
| QS_QF_ACTIVE_GET | AO got an event and its queue is not empty. |
| QS_QF_ACTIVE_GET_LAST | AO got an event and its queue is empty. |
| QS_QF_ACTIVE_RECALL_ATTEMPT | AO attempted to recall an event. |
| QS_QF_EQUEUE_POST | an event was posted (FIFO) to a raw queue |
| QS_QF_EQUEUE_POST_LIFO | an event was posted (LIFO) to a raw queue |
| QS_QF_EQUEUE_GET | get an event and queue still not empty |
| QS_QF_EQUEUE_GET_LAST | get the last event from the queue |
| QS_QF_NEW_ATTEMPT | an attempt to allocate an event failed |
| QS_QF_MPOOL_GET | a memory block was removed from memory pool |
| QS_QF_MPOOL_PUT | a memory block was returned to memory pool |
| QS_QF_PUBLISH | an event was published to active objects |
| QS_QF_NEW_REF | new event reference was created |
| QS_QF_NEW | new event was created |
| QS_QF_GC_ATTEMPT | garbage collection attempt |
| QS_QF_GC | garbage collection |
| QS_QF_TICK | QTimeEvt tick was called. |
| QS_QF_TIMEEVT_ARM | a time event was armed |
| QS_QF_TIMEEVT_AUTO_DISARM | a time event expired and was disarmed |
| QS_QF_TIMEEVT_DISARM_ATTEMPT | attempt to disarm a disarmed QTimeEvt |
| QS_QF_TIMEEVT_DISARM | true disarming of an armed time event |
| QS_QF_TIMEEVT_REARM | rearming of a time event |
| QS_QF_TIMEEVT_POST | a time event posted itself directly to an AO |
| QS_QF_DELETE_REF | an event reference is about to be deleted |
| QS_QF_CRIT_ENTRY | critical section was entered |
| QS_QF_CRIT_EXIT | critical section was exited |
| QS_QF_ISR_ENTRY | an ISR was entered |
| QS_QF_ISR_EXIT | an ISR was exited |
| QS_QF_INT_DISABLE | interrupts were disabled |
| QS_QF_INT_ENABLE | interrupts were enabled |
| QS_QF_ACTIVE_POST_ATTEMPT | attempt to post an evt to AO failed |
| QS_QF_EQUEUE_POST_ATTEMPT | attempt to post evt to QEQueue failed |
| QS_QF_MPOOL_GET_ATTEMPT | attempt to get a memory block failed |
| QS_SCHED_PREEMPT | scheduler asynchronously preempted a task |
| QS_SCHED_RESTORE | scheduler restored preempted task |
| QS_SCHED_LOCK | scheduler was locked |
| QS_SCHED_UNLOCK | scheduler was unlocked |
| QS_SCHED_NEXT | scheduler started next task |
| QS_SCHED_IDLE | scheduler restored the idle task |
| QS_ENUM_DICT | enumeration dictionary entry |
| QS_QEP_TRAN_HIST | a tran. to history was taken |
| QS_RESERVED_56 | reserved (previously QS_QEP_TRAN_EP) |
| QS_RESERVED_57 | reserved (previously QS_QEP_TRAN_XP) |
| QS_TEST_PAUSED | test has been paused |
| QS_TEST_PROBE_GET | reports that Test-Probe has been used |
| QS_SIG_DICT | signal dictionary entry |
| QS_OBJ_DICT | object dictionary entry |
| QS_FUN_DICT | function dictionary entry |
| QS_USR_DICT | user QS record dictionary entry |
| QS_TARGET_INFO | reports the Target information |
| QS_TARGET_DONE | reports completion of a user callback |
| QS_RX_STATUS | reports QS data receive status |
| QS_QUERY_DATA | reports the data from "current object" query |
| QS_PEEK_DATA | reports the data from the PEEK query |
| QS_ASSERT_FAIL | assertion failed in the code |
| QS_QF_RUN | QF_run() was entered. |
| QS_SEM_TAKE | a semaphore was taken by a thread |
| QS_SEM_BLOCK | a semaphore blocked a thread |
| QS_SEM_SIGNAL | a semaphore was signaled |
| QS_SEM_BLOCK_ATTEMPT | a semaphore blocked was attempted |
| QS_MTX_LOCK | a mutex was locked |
| QS_MTX_BLOCK | a mutex blocked a thread |
| QS_MTX_UNLOCK | a mutex was unlocked |
| QS_MTX_LOCK_ATTEMPT | a mutex lock was attempted |
| QS_MTX_BLOCK_ATTEMPT | a mutex blocking was attempted |
| QS_MTX_UNLOCK_ATTEMPT | a mutex unlock was attempted |
| QS_QF_ACTIVE_DEFER_ATTEMPT | AO attempted to defer an event. |
| QS_PRE_MAX | the # predefined signals |
| enum QP::QS_ObjKind : std::uint8_t |
Object kinds used in QS-RX (NOTE: watch out for backwards compatibility!).
| enum QP::QS_RxRecords : std::uint8_t |
QS received record types (RX channel).
| Enumerator | |
|---|---|
| QS_RX_INFO | query Target info (ver, config, tstamp) |
| QS_RX_COMMAND | execute a user-defined command in the Target |
| QS_RX_RESET | reset the Target |
| QS_RX_TICK | call system clock tick in the Target |
| QS_RX_PEEK | peek Target memory |
| QS_RX_POKE | poke Target memory |
| QS_RX_FILL | fill Target memory |
| QS_RX_TEST_SETUP | test setup |
| QS_RX_TEST_TEARDOWN | test teardown |
| QS_RX_TEST_PROBE | set a Test-Probe in the Target |
| QS_RX_GLB_FILTER | set global filters in the Target |
| QS_RX_LOC_FILTER | set local filters in the Target |
| QS_RX_AO_FILTER | set local AO filter in the Target |
| QS_RX_CURR_OBJ | set the "current-object" in the Target |
| QS_RX_TEST_CONTINUE | continue a test after QS_TEST_PAUSE() |
| QS_RX_QUERY_CURR | query the "current object" in the Target |
| QS_RX_EVENT | inject an event to the Target |
Definition at line 36 of file qs_pkg.hpp.
|
noexcept |
Definition at line 52 of file qf_act.cpp.
|
noexcept |
Definition at line 172 of file qf_qact.cpp.
|
noexcept |
Internal function to increment the refCtr of a const event.
Details
This function requires "casting `const` away" from the event pointer and also applies reinterpret_cast<>, which violates MISRA-C++:2023 Rules 8.2.3 and 8.2.5. This function encapsulates these deviations.
Forward Traceability
Definition at line 57 of file qf_act.cpp.
|
noexcept |
Internal function to decrement the refCtr of a const event.
Details
Forward Traceability
Definition at line 68 of file qf_act.cpp.
|
static |
Internal function template to calculate the Duplicate Inverse Storage (DIS).
| T_ | integer type of the original variable |
| [in] | org | value of the original variable |
Forward Traceability
Definition at line 61 of file qp_pkg.hpp.
|
static |
Internal function template to verify the Duplicate Inverse Storage (DIS).
| T_ | integer type of the original variable |
| [in] | org | value of the original variable |
| [in] | dis | the Duplicate Inverse Storage to compare |
Forward Traceability
Definition at line 68 of file qp_pkg.hpp.
|
noexcept |
QXK context switch management.
Details
This internal function handles context switch. It calls QF_onContextSw() (if QF_ON_CONTEXT_SW is defined and performs software tracing (if Q_SPY is defined).
| [in] | next | pointer to the next thread (NULL for basic-thread) |
| std::array< QActive *, QF_MAX_ACTIVE+1U > QP::QActive_registry_ |
Internal array of pointers to the registered Active Objects.
Forward Traceability
Definition at line 47 of file qf_qact.cpp.
| QSubscrList * QP::QActive_subscrList_ |
| QSignal QP::QActive_maxPubSignal_ |
Internal maximum published signal (# used entries in the QP::QActive_subscrList_ array).
Forward Traceability
| std::array< QTimeEvt, QF_MAX_TICK_RATE > QP::QTimeEvt_head_ |
Internal heads of the time-event linked-lists (by clock-tick rate).
Forward Traceability
Definition at line 51 of file qf_time.cpp.
|
constexpr |
Definition at line 46 of file qp_pkg.hpp.
|
constexpr |
Definition at line 47 of file qp_pkg.hpp.
|
constexpr |
Definition at line 57 of file qs_pkg.hpp.
|
constexpr |
Definition at line 58 of file qs_pkg.hpp.
|
constexpr |
Definition at line 59 of file qs_pkg.hpp.
|
constexpr |
Definition at line 60 of file qs_pkg.hpp.
| union QP::Endiannes QP::QS_ENDIANNES = { static_cast<std::uint16_t>(0x7F00U) } |
| char const QP::BUILD_DATE = __DATE__ |
Definition at line 31 of file qstamp.cpp.
| char const QP::BUILD_TIME = __TIME__ |
Definition at line 32 of file qstamp.cpp.
|
constexpr |
|
staticconstexpr |
Definition at line 49 of file qf_act.cpp.