QP/C++  5.8.2
QP Namespace Reference
QEP | QF | QS | QV | QK | QXK

namespace associated with the QP/C++ framework More...

Classes

class  QActive
 QActive active object (based on QP::QHsm implementation) More...
 
class  QEP
 Provides miscellaneous QEP services. More...
 
class  QEQueue
 Native QF Event Queue class. More...
 
struct  QEvt
 QEvt base class. More...
 
class  QF
 QF services. More...
 
struct  QFreeBlock
 Structure representing a free block in the Native QF Memory Pool. More...
 
class  QHsm
 Hierarchical State Machine base class. More...
 
union  QHsmAttr
 Attribute of for the QHsm class (Hierarchical State Machine). More...
 
class  QK
 QK services. More...
 
class  QMActive
 QMActive active object (based on QP::QMsm implementation) More...
 
class  QMPool
 Native QF memory pool class. More...
 
class  QMsm
 QM State Machine implementation strategy. More...
 
struct  QMState
 State object for the QMsm class (Meta State Machine). More...
 
struct  QMTranActTable
 Transition-Action Table for the Meta State Machine. More...
 
class  QMutex
 Priority-ceiling Mutex the QK preemptive kernel. More...
 
class  QPSet
 Priority Set of up to 32 elements */. More...
 
class  QS
 Quantum Spy logging facilities. More...
 
class  QTicker
 Ticker Active Object class. More...
 
class  QTimeEvt
 Time Event class. More...
 
class  QV
 QV services. More...
 
class  QXK
 QXK services. More...
 
class  QXKIdleThread
 
class  QXMutex
 Priority Ceiling Mutex the QXK preemptive kernel. More...
 
class  QXSemaphore
 Counting Semaphore of the QXK preemptive kernel. More...
 
class  QXThread
 Extended (blocking) thread of the QXK preemptive kernel. More...
 

Typedefs

typedef uint16_t QSignal
 QSignal represents the signal of an event. More...
 
typedef uint_fast8_t QState
 Type returned from state-handler functions.
 
typedef QState(* QStateHandler) (void *const me, QEvt const *const e)
 pointer to state-handler function
 
typedef QState(* QActionHandler) (void *const me)
 pointer to an action-handler function
 
typedef uint_fast8_t QEQueueCtr
 The data type to store the ring-buffer counters based on the macro QF_EQUEUE_CTR_SIZE. More...
 
typedef uint16_t QEvtSize
 The data type to store the block-size defined based on the macro QF_EVENT_SIZ_SIZE. More...
 
typedef uint16_t QTimeEvtCtr
 type of the Time Event counter, which determines the dynamic range of the time delays measured in clock ticks. More...
 
typedef QPSet QSubscrList
 Subscriber List. More...
 
typedef uint16_t QMPoolSize
 The data type to store the block-size based on the macro QF_MPOOL_SIZ_SIZE. More...
 
typedef uint16_t QMPoolCtr
 The data type to store the block-counter based on the macro QF_MPOOL_CTR_SIZE. More...
 
typedef QEvt QEvent
 deprecated typedef for backwards compatibility
 
typedef uint32_t QSTimeCtr
 The type of the QS time stamp. This type determines the dynamic range of QS time stamps.
 
typedef unsigned int QSCtr
 QS ring buffer counter and offset type.
 
typedef void(* QXThreadHandler) (QXThread *const me)
 Thread handler pointer-to-function.
 

Enumerations

enum  QSpyRecords {
  QS_EMPTY, QS_QEP_STATE_ENTRY, QS_QEP_STATE_EXIT, QS_QEP_STATE_INIT,
  QS_QEP_INIT_TRAN, QS_QEP_INTERN_TRAN, QS_QEP_TRAN, QS_QEP_IGNORED,
  QS_QEP_DISPATCH, QS_QEP_UNHANDLED, QS_QF_ACTIVE_ADD, QS_QF_ACTIVE_REMOVE,
  QS_QF_ACTIVE_SUBSCRIBE, QS_QF_ACTIVE_UNSUBSCRIBE, QS_QF_ACTIVE_POST_FIFO, QS_QF_ACTIVE_POST_LIFO,
  QS_QF_ACTIVE_GET, QS_QF_ACTIVE_GET_LAST, QS_QF_EQUEUE_INIT, QS_QF_EQUEUE_POST_FIFO,
  QS_QF_EQUEUE_POST_LIFO, QS_QF_EQUEUE_GET, QS_QF_EQUEUE_GET_LAST, QS_QF_MPOOL_INIT,
  QS_QF_MPOOL_GET, QS_QF_MPOOL_PUT, QS_QF_PUBLISH, QS_QF_RESERVED8,
  QS_QF_NEW, QS_QF_GC_ATTEMPT, QS_QF_GC, QS_QF_TICK,
  QS_QF_TIMEEVT_ARM, QS_QF_TIMEEVT_AUTO_DISARM, QS_QF_TIMEEVT_DISARM_ATTEMPT, QS_QF_TIMEEVT_DISARM,
  QS_QF_TIMEEVT_REARM, QS_QF_TIMEEVT_POST, QS_QF_TIMEEVT_CTR, QS_QF_CRIT_ENTRY,
  QS_QF_CRIT_EXIT, QS_QF_ISR_ENTRY, QS_QF_ISR_EXIT, QS_QF_INT_DISABLE,
  QS_QF_INT_ENABLE, QS_QF_ACTIVE_POST_ATTEMPT, QS_QF_EQUEUE_POST_ATTEMPT, QS_QF_MPOOL_GET_ATTEMPT,
  QS_QF_RESERVED1, QS_QF_RESERVED0, QS_SCHED_LOCK, QS_SCHED_UNLOCK,
  QS_SCHED_NEXT, QS_SCHED_IDLE, QS_SCHED_RESUME, QS_QEP_TRAN_HIST,
  QS_QEP_TRAN_EP, QS_QEP_TRAN_XP, QS_QEP_RESERVED1, QS_QEP_RESERVED0,
  QS_SIG_DICT, QS_OBJ_DICT, QS_FUN_DICT, QS_USR_DICT,
  QS_TARGET_INFO, QS_RESERVED0, QS_RX_STATUS, QS_TEST_STATUS,
  QS_PEEK_DATA, QS_ASSERT_FAIL, QS_USER
}
 Quantum Spy record types. More...
 
enum  QSpyRxRecords {
  QS_RX_INFO, QS_RX_COMMAND, QS_RX_RESET, QS_RX_TICK,
  QS_RX_PEEK, QS_RX_POKE, QS_RX_RESERVED7, QS_RX_RESERVED6,
  QS_RX_RESERVED5, QS_RX_RESERVED4, QS_RX_GLB_FILTER, QS_RX_LOC_FILTER,
  QS_RX_AO_FILTER, QS_RX_RESERVED3, QS_RX_RESERVED2, QS_RX_RESERVED1,
  QS_RX_EVENT
}
 Quantum Spy Receive (RX) record types. More...
 
enum  { QEP_EMPTY_SIG_ = 0 }
 
enum  { MUTEX_UNUSED = 0xFF }
 
enum  { MUTEX_UNUSED = 0xFF }
 
enum  QXK_Timeouts { QXK_DELAY_SIG = Q_USER_SIG, QXK_QUEUE_SIG, QXK_SEMA_SIG }
 timeout signals
 

Functions

uint_fast8_t QF_LOG2 (uint32_t const x)
 function that returns (log2(x) + 1), where x is uint32_t */ More...
 
uint8_t QF_EVT_POOL_ID_ (QEvt const *const e)
 access to the poolId_ of an event e
 
uint8_t QF_EVT_REF_CTR_ (QEvt const *const e)
 access to the refCtr_ of an event e
 
void QF_EVT_REF_CTR_INC_ (QEvt const *const e)
 increment the refCtr_ of an event e
 
void QF_EVT_REF_CTR_DEC_ (QEvt const *const e)
 decrement the refCtr_ of an event e
 
static void initial_events (void)
 process all events posted during initialization */
 
void QS_target_info_ (uint8_t const isReset)
 send the Target info (object sizes, build time-stamp, QP version)
 
static void rxParseData_ (uint8_t const b)
 
static void rxHandleGoodFrame_ (void)
 
static void rxHandleBadFrame_ (void)
 
static void rxReportSuccess_ (enum QSpyRxRecords const recId)
 
static void rxReportError_ (uint8_t const stateId)
 
static bool rxAddr_ (uint8_t const b, QSAddr *const addr, uint8_t *const idx)
 
static void initial_events (void)
 process all events posted during initialization
 

Variables

char_t const versionStr [6] = QP_VERSION_STR
 the current QP version number string based on QP_VERSION_STR
 
QState const Q_RET_SUPER = static_cast<QState>(0)
 event passed to the superstate to handle
 
QState const Q_RET_SUPER_SUB = static_cast<QState>(1)
 event passed to submachine superstate
 
QState const Q_RET_UNHANDLED = static_cast<QState>(2)
 event unhandled due to a guard evaluating to FALSE
 
QState const Q_RET_HANDLED = static_cast<QState>(3)
 event handled (internal transition)
 
QState const Q_RET_IGNORED = static_cast<QState>(4)
 event silently ignored (bubbled up to top)
 
QState const Q_RET_ENTRY = static_cast<QState>(5)
 state entry action executed
 
QState const Q_RET_EXIT = static_cast<QState>(6)
 state exit action executed
 
QState const Q_RET_NULL = static_cast<QState>(7)
 return value without any effect
 
QState const Q_RET_TRAN = static_cast<QState>(8)
 regular transition taken
 
QState const Q_RET_TRAN_INIT = static_cast<QState>(9)
 initial transition taken
 
QState const Q_RET_TRAN_HIST = static_cast<QState>(10)
 event handled (transition to history)
 
QState const Q_RET_TRAN_EP = static_cast<QState>(11)
 entry-point transition into a submachine
 
QState const Q_RET_TRAN_XP = static_cast<QState>(12)
 exit-point transition out of a submachine
 
QMState *const QMsm_top = static_cast<QMState *>(0)
 Top-most state of QMSM is NULL.
 
enum_t const Q_USER_SIG = static_cast<enum_t>(4)
 Offset or the user signals.
 
uint8_t const QF_log2Lkup [256]
 Lookup table for (log2(n) + 1), where n = 0..255 */. More...
 
uint_fast8_t const QS_ALL_RECORDS = static_cast<uint_fast8_t>(0xFF)
 Specification of all QS records for the QP::QS::filterOn() and QP::QS::filterOff()
 
uint16_t const QS_EOD = static_cast<uint16_t>(0xFFFF)
 Constant representing End-Of-Data condition returned from the QP::QS::getByte() function.
 
char_t const BUILD_DATE [12] = __DATE__
 the calendar date of the last translation of the form: "Mmm dd yyyy"
 
char_t const BUILD_TIME [9] = __TIME__
 the time of the last translation of the form: "hh:mm:ss"
 
static QEvt const QEP_reservedEvt_ [4]
 
QF_EPOOL_TYPE_ QF_pool_ [QF_MAX_EPOOL]
 allocate event pools
 
uint_fast8_t QF_maxPool_
 

of initialized event pools


 
QSubscrListQF_subscrList_
 the subscriber list array
 
enum_t QF_maxPubSignal_
 the maximum published signal
 
uint8_t const QS_FRAME = static_cast<uint8_t>(0x7E)
 Frame character of the QS output protocol.
 
uint8_t const QS_ESC = static_cast<uint8_t>(0x7D)
 Escape character of the QS output protocol.
 
uint8_t const QS_ESC_XOR = static_cast<uint8_t>(0x20)
 Escape modifier of the QS output protocol. More...
 
uint8_t const QS_GOOD_CHKSUM = static_cast<uint8_t>(0xFF)
 Escape character of the QS output protocol.
 
QPSet QV_readySet_
 ready set of AOs More...
 
static QXKIdleThread l_idleThread
 

Detailed Description

namespace associated with the QP/C++ framework


Class Documentation

◆ QP::QFreeBlock

struct QP::QFreeBlock

Structure representing a free block in the Native QF Memory Pool.

See also
QP::QMPool

Definition at line 97 of file qf_pkg.h.

Class Members
QFreeBlock *volatile m_next link to the next free block

◆ QP::QHsmAttr

union QP::QHsmAttr

Attribute of for the QHsm class (Hierarchical State Machine).

Description
This union represents possible values stored in the 'state' and 'temp' attributes of the QHsm and QMsm classes.

Definition at line 238 of file qep.h.

Class Members
QActionHandler act pointer to an action-handler function
QStateHandler fun pointer to a state handler function
QMState const * obj pointer to QMState object
QMTranActTable const * tatbl transition-action table

◆ QP::QMState

struct QP::QMState

State object for the QMsm class (Meta State Machine).

Description
This class groups together the attributes of a QMsm state, such as the parent state (state nesting), the associated state handler function and the exit action handler function. These attributes are used inside the QP::QMsm::dispatch() and QP::QMsm::init() functions.
Attention
The QMStateObj class is only intended for the QM code generator and should not be used in hand-crafted code.

Definition at line 554 of file qep.h.

Class Members
QActionHandler const entryAction entry action handler function
QActionHandler const exitAction exit action handler function
QActionHandler const initAction init action handler function
QStateHandler const stateHandler state handler function
QMState const * superstate superstate of this state

◆ QP::QMTranActTable

struct QP::QMTranActTable

Transition-Action Table for the Meta State Machine.

Definition at line 563 of file qep.h.

Class Members
QActionHandler const act[1]
QMState const * target

Typedef Documentation

◆ QEQueueCtr

The data type to store the ring-buffer counters based on the macro QF_EQUEUE_CTR_SIZE.

Description
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 72 of file qequeue.h.

◆ QEvtSize

The data type to store the block-size defined based on the macro QF_EVENT_SIZ_SIZE.

Description
The dynamic range of this data type determines the maximum block size that can be managed by the pool.

Definition at line 87 of file qf.h.

◆ QMPoolCtr

The data type to store the block-counter based on the macro QF_MPOOL_CTR_SIZE.

Description
The dynamic range of this data type determines the maximum number of blocks that can be stored in the pool.

Definition at line 78 of file qmpool.h.

◆ QMPoolSize

The data type to store the block-size based on the macro QF_MPOOL_SIZ_SIZE.

Description
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 63 of file qmpool.h.

◆ QSignal

QSignal represents the signal of an event.

Description
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 form of event parameters.

Definition at line 151 of file qep.h.

◆ QSubscrList

Subscriber List.

Description
This data type represents a set of active objects that subscribe to a given signal. The set is represented as priority-set, where each bit corresponds to the unique priority of an active object.

Definition at line 472 of file qf.h.

◆ QTimeEvtCtr

type of the Time Event counter, which determines the dynamic range of the time delays measured in clock ticks.

Description
This typedef is configurable via the preprocessor switch QF_TIMEEVT_CTR_SIZE. The other possible values of this type are as follows:
uint8_t when (QF_TIMEEVT_CTR_SIZE == 1), and
uint32_t when (QF_TIMEEVT_CTR_SIZE == 4).

Definition at line 106 of file qf.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
QEP_EMPTY_SIG_ 

empty signal for internal use only

Definition at line 79 of file qep_hsm.cpp.

◆ QSpyRecords

Quantum Spy record types.

Description
This enumeration specifies the record types used in the QP components. You can specify your own record types starting from QP::QS_USER offset. Currently, the maximum of all records cannot exceed 256.
See also
QP::QS::filterOn() / QS_FILTER_ON() and QP::QS::filterOff() / QS_FILTER_OFF()
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 unhandled due to a guard

QS_QF_ACTIVE_ADD 

an AO has been added to QF (started)

QS_QF_ACTIVE_REMOVE 

an AO has been removed from QF (stopped)

QS_QF_ACTIVE_SUBSCRIBE 

an AO subscribed to an event

QS_QF_ACTIVE_UNSUBSCRIBE 

an AO unsubscribed to an event

QS_QF_ACTIVE_POST_FIFO 

an event was posted (FIFO) directly to an AO

QS_QF_ACTIVE_POST_LIFO 

an event was posted (LIFO) directly to an AO

QS_QF_ACTIVE_GET 

an AO got an event and its queue is still not empty

QS_QF_ACTIVE_GET_LAST 

an AO got an event and its queue is empty

QS_QF_EQUEUE_INIT 

an event queue was initialized

QS_QF_EQUEUE_POST_FIFO 

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_MPOOL_INIT 

a memory pool was initialized

QS_QF_MPOOL_GET 

a memory block was removed from a memory pool

QS_QF_MPOOL_PUT 

a memory block was returned to a memory pool

QS_QF_PUBLISH 

an event was truly published to subscribers

QS_QF_NEW 

new event creation

QS_QF_GC_ATTEMPT 

garbage collection attempt

QS_QF_GC 

garbage collection

QS_QF_TICK 

QP::QF::tickX() 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_TIMEEVT_CTR 

a time event counter was requested

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 an evt to QEQueue failed

QS_QF_MPOOL_GET_ATTEMPT 

attempt to get a memory block failed

QS_SCHED_LOCK 

scheduler was locked

QS_SCHED_UNLOCK 

scheduler was unlocked

QS_SCHED_NEXT 

scheduler found next task to execute

QS_SCHED_IDLE 

scheduler became idle

QS_SCHED_RESUME 

scheduler resumed previous task (not idle)

QS_QEP_TRAN_HIST 

a tran to history was taken

QS_QEP_TRAN_EP 

a tran to entry point into a submachine

QS_QEP_TRAN_XP 

a tran to exit point out of a submachine

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_RX_STATUS 

reports QS data receive status

QS_TEST_STATUS 

reports test status

QS_PEEK_DATA 

reports the data from the PEEK query

QS_ASSERT_FAIL 

assertion failed in the code

QS_USER 

the first record available to QS users

Definition at line 74 of file qs.h.

◆ QSpyRxRecords

Quantum Spy Receive (RX) record types.

Description
This enumeration specifies the record types for the QS receive 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 QF_tick()

QS_RX_PEEK 

peek Target memory

QS_RX_POKE 

poke Target memory

QS_RX_RESERVED7 

reserved for future use

QS_RX_RESERVED6 

reserved for future use

QS_RX_RESERVED5 

reserved for future use

QS_RX_RESERVED4 

reserved for future use

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_RESERVED3 

reserved for future use

QS_RX_RESERVED2 

reserved for future use

QS_RX_RESERVED1 

reserved for future use

QS_RX_EVENT 

inject an event to the Target (post/publish)

Definition at line 394 of file qs.h.

Function Documentation

◆ QF_LOG2()

uint_fast8_t QP::QF_LOG2 ( uint32_t const  x)
inline

function that returns (log2(x) + 1), where x is uint32_t */

Description
This function returns the 1-based number of the most significant 1-bit of a 32-bit number. This function can be replaced in the QP ports, if the CPU supports special instructions, such as CLZ (count leading zeros).

Definition at line 67 of file qpset.h.

Variable Documentation

◆ QEP_reservedEvt_

QEvt const QP::QEP_reservedEvt_[4]
static
Initial value:
= {
{ static_cast<QSignal>(0),
static_cast<uint8_t>(0), static_cast<uint8_t>(0) },
{ static_cast<QSignal>(1),
static_cast<uint8_t>(0), static_cast<uint8_t>(0) },
{ static_cast<QSignal>(2),
static_cast<uint8_t>(0), static_cast<uint8_t>(0) },
{ static_cast<QSignal>(3),
static_cast<uint8_t>(0), static_cast<uint8_t>(0) }
}
uint16_t QSignal
QSignal represents the signal of an event.
Definition: qep.h:151
unsigned char uint8_t
exact-width 8-bit unsigned int
Definition: stdint.h:29
Description
Static, preallocated standard events that the QEP event processor sends to state handler functions of QP::QHsm and QP::QFsm subclasses to execute entry actions, exit actions, and initial transitions.

Definition at line 89 of file qep_hsm.cpp.

◆ QF_log2Lkup

uint8_t const QP::QF_log2Lkup

Lookup table for (log2(n) + 1), where n = 0..255 */.

Description
This lookup delivers the 1-based number of the most significant 1-bit of a byte.

Definition at line 159 of file qf_act.cpp.

◆ QS_ESC_XOR

uint8_t const QP::QS_ESC_XOR = static_cast<uint8_t>(0x20)

Escape modifier of the QS output protocol.

The escaped byte is XOR-ed with the escape modifier before it is inserted into the QS buffer.

Definition at line 88 of file qs_pkg.h.

◆ QV_readySet_

QPSet QP::QV_readySet_

ready set of AOs

Note
The functions implemented in this module can have a different implementation in other QF ports. The implementations included here are appropriate for the cooperative QV kernel only.

Definition at line 65 of file qv.cpp.