Reference Manual For QP/C++ 8.1.5
Loading...
Searching...
No Matches
QP::QActiveDummy Class Reference

Dummy Active Object for testing. More...

Inheritance diagram for QP::QActiveDummy:
QP::QActive QP::QAsm

Public Member Functions

void init (void const *const e, std::uint_fast8_t const qsId) override
 Take the top-most initial transition in QActive (delegate to QP::QHsm).
void dispatch (QEvt const *const e, std::uint_fast8_t const qsId) override
 Dispatch an event to QActive (delegate to QP::QHsm).
QStateHandler getStateHandler () const noexcept override
 Get current state-handler in QActive (delegate to QP::QHsm).
Public Member Functions inherited from QP::QActive
bool isIn (QStateHandler const stateHndl) noexcept override
 Is-in-state query in QActive (delegate to QP::QHsm).
QStateHandler childState (QStateHandler const parentHandler) noexcept
void setAttr (std::uint32_t attr1, void const *attr2=nullptr)
 Generic setting of additional attributes (defined in some QP ports).
void start (QPrioSpec const prioSpec, QEvtPtr *const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize, void const *const par=nullptr)
 Starts execution of an active object and registers the object with the framework.
void stop ()
 Stops execution of an active object and removes it from the framework's supervision.
void register_ () noexcept
 Register this active object to be managed by the framework.
void unregister_ () noexcept
 Un-register the active object from the framework.
void post_ (QEvt const *const e, void const *const sender) noexcept
 Posts an event e directly to the event queue of the active object using the First-In-First-Out (FIFO) policy.
bool postx_ (QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept
 Posts an event e directly to the event queue of the active object using the First-In-First-Out (FIFO) policy.
void postLIFO (QEvt const *const e) noexcept
 Posts an event e directly to the event queue of the active object using the Last-In-First-Out (LIFO) policy.
QEvt const * get_ () noexcept
 Get an event from the event queue of an active object.
void subscribe (QSignal const sig) const noexcept
 Subscribes for delivery of signal sig to the active object.
void unsubscribe (QSignal const sig) const noexcept
 Unsubscribes from the delivery of signal sig to the active object.
void unsubscribeAll () const noexcept
 Unsubscribes from the delivery of all signals to the active object.
bool defer (QEQueue *const eq, QEvt const *const e) const noexcept
 Defer an event to a given separate event queue.
bool recall (QEQueue *const eq) noexcept
 Recall a deferred event from a given event queue.
std::uint16_t flushDeferred (QEQueue *const eq, std::uint_fast16_t const num=0xFFFFU) const noexcept
 Flush the specified deferred queue eq.
std::uint8_t getPrio () const noexcept
QACTIVE_THREAD_TYPE const & getThread () const &
QACTIVE_THREAD_TYPE const & getThread () const &&=delete
void setThread (QACTIVE_THREAD_TYPE const &thr) noexcept
QACTIVE_OS_OBJ_TYPE const & getOsObject () const &
QACTIVE_OS_OBJ_TYPE const & getOsObject () const &&=delete
virtual bool postFromISR (QEvt const *const e, std::uint_fast16_t const margin, void *const par, void const *const sender) noexcept
 The "FromISR" variant used in the QP port to "FreeRTOS" .
virtual void init (std::uint_fast8_t const qsId)
 Virtual function to take the top-most initial transition in the state machine (overloaded).
Public Member Functions inherited from QP::QAsm
virtual ~QAsm ()=default
 Virtual destructor of the QP::QAsm abstract base class.
QStateHandler state () const noexcept
QMState const * stateObj () const noexcept

Private Member Functions

bool fakePost (QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept
void fakePostLIFO (QEvt const *const e) noexcept

Friends

class QActive

Additional Inherited Members

Static Public Member Functions inherited from QP::QActive
static std::uint16_t getQueueUse (std::uint_fast8_t const prio) noexcept
static std::uint16_t getQueueFree (std::uint_fast8_t const prio) noexcept
static std::uint16_t getQueueMin (std::uint_fast8_t const prio) noexcept
static void psInit (QSubscrList *const subscrSto, QSignal const maxSignal) noexcept
 Initializes the publish-subscribe facility for the application.
static void publish_ (QEvt const *const e, void const *const sender, std::uint_fast8_t const qsId) noexcept
 Publish event to all subscribers of a given signal e->sig.
static void evtLoop_ (QActive *act)
 Event loop thread routine for executing an active object act (defined some in QP ports).
static QActive * fromRegistry (std::uint_fast8_t const prio)
static void publishFromISR (QEvt const *const e, void *const par, void const *const sender) noexcept
 The "FromISR" variant used in the QP port to "FreeRTOS" .
Static Public Member Functions inherited from QP::QAsm
static constexpr QState Q_HANDLED ()
static constexpr QState Q_UNHANDLED ()
static constexpr QState QM_HANDLED ()
static constexpr QState QM_UNHANDLED ()
static constexpr QState QM_SUPER ()
static QState top (void *const me, QEvt const *const e) noexcept
 Top state handler that ignores all events .
Public Attributes inherited from QP::QAsm
QAsmAttr m_state
 Current state (pointer to the current state-handler function) .
QAsmAttr m_temp
 Temporary storage for target/act-table etc.
Static Public Attributes inherited from QP::QAsm
static constexpr QState Q_RET_SUPER {0U}
static constexpr QState Q_RET_UNHANDLED {1U}
static constexpr QState Q_RET_HANDLED {2U}
static constexpr QState Q_RET_TRAN {3U}
static constexpr QState Q_RET_TRAN_HIST {4U}
static constexpr QState Q_RET_IGNORED {5U}
static constexpr QState Q_RET_ENTRY {6U}
static constexpr QState Q_RET_EXIT {7U}
static constexpr QState Q_RET_TRAN_INIT {8U}
static constexpr QSignal Q_EMPTY_SIG {0U}
static constexpr QSignal Q_ENTRY_SIG {1U}
static constexpr QSignal Q_EXIT_SIG {2U}
static constexpr QSignal Q_INIT_SIG {3U}
static constexpr QMState const * QM_STATE_NULL { nullptr }
static constexpr QActionHandler const Q_ACTION_NULL { nullptr }
Protected Member Functions inherited from QP::QActive
 QActive (QStateHandler const initial) noexcept
 QActive constructor (abstract base class).
Protected Member Functions inherited from QP::QAsm
 QAsm () noexcept
 Constructor of the QP::QAsm base class.
QState tran (QStateHandler const target) noexcept
 Internal helper function to take a state transition in sublclasses of QP::QAsm .
QState tran_hist (QStateHandler const hist) noexcept
 Internal helper function to take a state transition to history in sublclasses of QP::QAsm .
QState super (QStateHandler const superstate) noexcept
 Internal helper function to indicate superstate of a given state in sublclasses of QP::QAsm .
QState qm_tran (void const *const tatbl) noexcept
 Internal helper function to take a state transition in QP::QMsm .
QState qm_tran_init (void const *const tatbl) noexcept
QState qm_tran_hist (QMState const *const hist, void const *const tatbl) noexcept
 Internal helper function to take a state transition to history in QP::QMsm .
QState qm_entry (QMState const *const s) noexcept
 Internal helper function to execute state entry actions in QP::QMsm .
QState qm_exit (QMState const *const s) noexcept
 Internal helper function to execute state exit actions in QP::QMsm .

Detailed Description

Dummy Active Object for testing.

Details

QActiveDummy is a test double for the role of collaborating active objects in QUTest unit testing.

Definition at line 705 of file qs.hpp.

Constructor & Destructor Documentation

◆ QActiveDummy()

QP::QActiveDummy::QActiveDummy ( )

Definition at line 456 of file qutest.cpp.

Member Function Documentation

◆ init()

void QP::QActiveDummy::init ( void const *const e,
std::uint_fast8_t const qsId )
overridevirtual

Take the top-most initial transition in QActive (delegate to QP::QHsm).

Forward Traceability

  • [MISRA_QP_DVR_MP2_R8_2_5] Rule 8.2.5(Required): reinterpret_cast<> shall not be used
  • [MISRA_QP_DVR_PCLP_1933] call to unqualified virtual function from non-static member function

Reimplemented from QP::QActive.

Definition at line 460 of file qutest.cpp.

◆ dispatch()

void QP::QActiveDummy::dispatch ( QEvt const *const e,
std::uint_fast8_t const qsId )
overridevirtual

Dispatch an event to QActive (delegate to QP::QHsm).

Forward Traceability

  • [MISRA_QP_DVR_MP2_R8_2_5] Rule 8.2.5(Required): reinterpret_cast<> shall not be used

Reimplemented from QP::QActive.

Definition at line 484 of file qutest.cpp.

◆ getStateHandler()

QStateHandler QP::QActiveDummy::getStateHandler ( ) const
overridevirtualnoexcept

Get current state-handler in QActive (delegate to QP::QHsm).

Forward Traceability

  • [MISRA_QP_DVR_MP2_R8_2_5] Rule 8.2.5(Required): reinterpret_cast<> shall not be used

Reimplemented from QP::QActive.

Definition at line 579 of file qutest.cpp.

◆ fakePost()

bool QP::QActiveDummy::fakePost ( QEvt const *const e,
std::uint_fast16_t const margin,
void const *const sender )
privatenoexcept

Definition at line 501 of file qutest.cpp.

◆ fakePostLIFO()

void QP::QActiveDummy::fakePostLIFO ( QEvt const *const e)
privatenoexcept

Definition at line 547 of file qutest.cpp.

◆ QActive

friend class QActive
friend

Definition at line 707 of file qs.hpp.