QP/C++  8.0.0
Real-Time Embedded Framework
Loading...
Searching...
No Matches
QP::QActive Class Reference

Active object class (based on the QHsm implementation strategy) More...

#include "qp.hpp"

Inheritance diagram for QP::QActive:
QP::QAsm QP::QMActive QP::QTicker

Public Member Functions

void init (void const *const e, std::uint_fast8_t const qsId) override
 Virtual function to take the top-most initial transition in the state machine.
 
void init (std::uint_fast8_t const qsId) override
 Virtual function to take the top-most initial transition in the state machine (overloaded).
 
void dispatch (QEvt const *const e, std::uint_fast8_t const qsId) override
 Virtual function to dispatch an event to the state machine.
 
bool isIn (QStateHandler const state) noexcept override
 Virtual function to check whether the state machine is in a given state.
 
QStateHandler childState (QStateHandler const parent) noexcept
 
void setAttr (std::uint32_t attr1, void const *attr2=nullptr)
 
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)
 
void start (QPrioSpec const prioSpec, QEvtPtr *const qSto, std::uint_fast16_t const qLen, void *const stkSto, std::uint_fast16_t const stkSize)
 
void stop ()
 
void register_ () noexcept
 
void unregister_ () noexcept
 
bool post_ (QEvt const *const e, std::uint_fast16_t const margin, void const *const sender) noexcept
 
void postLIFO (QEvt const *const e) noexcept
 
QEvt const * get_ () noexcept
 
void subscribe (enum_t const sig) const noexcept
 
void unsubscribe (enum_t const sig) const noexcept
 
void unsubscribeAll () const noexcept
 
bool defer (QEQueue *const eq, QEvt const *const e) const noexcept
 
bool recall (QEQueue *const eq) noexcept
 
std::uint_fast16_t flushDeferred (QEQueue *const eq, std::uint_fast16_t const num=0xFFFFU) const noexcept
 
std::uint_fast8_t getPrio () const noexcept
 
void setPrio (QPrioSpec const prio) noexcept
 
std::uint_fast8_t getPThre () const noexcept
 
QACTIVE_EQUEUE_TYPE const & getEQueue () const noexcept
 
QACTIVE_OS_OBJ_TYPE const & getOsObject () const noexcept
 
QACTIVE_THREAD_TYPE const & getThread () const noexcept
 
void setThread (QACTIVE_THREAD_TYPE const &thr)
 
virtual bool postFromISR (QEvt const *const e, std::uint_fast16_t const margin, void *par, void const *const sender) noexcept
 
- Public Member Functions inherited from QP::QAsm
virtual ~QAsm () noexcept
 Virtual destructor of the QP::QAsm abstract base class.
 
QStateHandler state () const noexcept
 
QMState const * stateObj () const noexcept
 
virtual QStateHandler getStateHandler () noexcept
 Virtual method for getting the state handler.
 

Static Public Member Functions

static std::uint_fast16_t getQueueMin (std::uint_fast8_t const prio) noexcept
 
static void psInit (QSubscrList *const subscrSto, enum_t const maxSignal) noexcept
 
static void publish_ (QEvt const *const e, void const *const sender, std::uint_fast8_t const qsId) noexcept
 
static void evtLoop_ (QActive *act)
 
static void publishFromISR (QEvt const *e, void *par, void const *sender) noexcept
 
- Static Public Member Functions inherited from QP::QAsm
static QState top (void *const me, QEvt const *const e) noexcept
 Top state handler that ignores all events.
 

Public Attributes

std::uint8_t m_prio_dis
 
std::uint8_t m_pthre_dis
 

Static Public Attributes

static QActiveregistry_ [QF_MAX_ACTIVE+1U]
 
static QSubscrListsubscrList_
 
static enum_t maxPubSignal_
 

Protected Member Functions

 QActive (QStateHandler const initial) noexcept
 
- 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.
 

Protected Attributes

std::uint8_t m_prio
 
std::uint8_t m_pthre
 
QACTIVE_THREAD_TYPE m_thread
 
QACTIVE_OS_OBJ_TYPE m_osObject
 
QACTIVE_EQUEUE_TYPE m_eQueue
 
- Protected 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.
 

Friends

class QTimeEvt
 
class QTicker
 
class QXThread
 
class QXMutex
 
class QXSemaphore
 
class QActiveDummy
 
class GuiQActive
 
class GuiQMActive
 
void schedLock ()
 

Additional Inherited Members

- Public Types inherited from QP::QAsm
enum  QStateRet : QState {
  Q_RET_SUPER , Q_RET_UNHANDLED , Q_RET_HANDLED , Q_RET_IGNORED ,
  Q_RET_ENTRY , Q_RET_EXIT , Q_RET_NULL , Q_RET_TRAN ,
  Q_RET_TRAN_INIT , Q_RET_TRAN_HIST
}
 
enum  ReservedSig : QSignal { Q_EMPTY_SIG , Q_ENTRY_SIG , Q_EXIT_SIG , Q_INIT_SIG }
 Reserved signals by the QP-framework. More...
 

Detailed Description

Active object class (based on the QHsm implementation strategy)

Details
Active objects are encapsulated tasks (each containing an event queue and a state machine) that communicate with one another asynchronously by sending and receiving events. Within an active object, events are processed in a run-to-completion (RTC) fashion, while QF encapsulates all the details of thread-safe event exchange and queuing.

QP::QActive 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.

Note
QP::QActive is not intended to be instantiated directly, but rather serves as the abstract base class for derivation of active objects in the applications.
See also
QP::QMActive
Backward Traceability
Usage
The following example illustrates how to derive an active object from QP::QActive.
class Philo : public QP::QActive { // <=== inherit QP::QActive
private:
QP::QTimeEvt m_timeEvt;
std::uint8_t m_id;
public:
static Philo inst[N_PHILO];
public:
Philo();
protected:
Q_STATE_DECL(initial);
Q_STATE_DECL(thinking);
Q_STATE_DECL(hungry);
Q_STATE_DECL(eating);
};
Active object class (based on the QHsm implementation strategy)
Definition qp.hpp:699
Time Event class.
Definition qp.hpp:927
#define Q_STATE_DECL(state_)
Definition qp.hpp:436

Definition at line 699 of file qp.hpp.

Constructor & Destructor Documentation

◆ QActive()

QP::QActive::QActive ( QStateHandler const initial)
inlineexplicitprotectednoexcept

QActive constructor (abstract base class)

Parameters
[in]initialpointer to the top-most initial state-handler function in the derived active object

Definition at line 741 of file qp.hpp.

Member Function Documentation

◆ init() [1/2]

void QP::QActive::init ( void const *const e,
std::uint_fast8_t const qsId )
inlineoverridevirtual

Virtual function to take the top-most initial transition in the state machine.

Details
Synchronously executes the top-most initial transition in a state machine (must be overridden in the subclasses).
Parameters
[in]epointer to an initialization parameter (might be nullptr)
[in]qsIdQS-id of this state machine (for QS local filter)

Implements QP::QAsm.

Reimplemented in QP::QMActive, and QP::QTicker.

Definition at line 756 of file qp.hpp.

◆ init() [2/2]

void QP::QActive::init ( std::uint_fast8_t const qsId)
inlineoverridevirtual

Virtual function to take the top-most initial transition in the state machine (overloaded).

Details
Synchronously executes the top-most initial transition in a state machine. This overloaded version takes no initialization parameter.
Parameters
[in]qsIdQS-id of this state machine (for QS local filter)

Reimplemented from QP::QAsm.

Reimplemented in QP::QMActive, and QP::QTicker.

Definition at line 762 of file qp.hpp.

◆ dispatch()

void QP::QActive::dispatch ( QEvt const *const e,
std::uint_fast8_t const qsId )
inlineoverridevirtual

Virtual function to dispatch an event to the state machine.

Details
Synchronously dispatches an event for processing to a state machine (must be overridden in the subclasses). The processing of an event represents one run-to-completion (RTC) step.
Parameters
[in]epointer to the event to be dispatched to the MSM
[in]qsIdQS-id of this state machine (for QS local filter)

Implements QP::QAsm.

Reimplemented in QP::QMActive, and QP::QTicker.

Definition at line 765 of file qp.hpp.

◆ isIn()

bool QP::QActive::isIn ( QStateHandler const state)
inlineoverridevirtualnoexcept

Virtual function to check whether the state machine is in a given state.

Details
Tests if a given state is part of the current active state configuration. Please note that in a hierarchical state machine, to "be in a state" means also to be in a superstate of of the state.
Parameters
[in]statepointer to the state-handler function to be checked
Returns
'true' if the state machine "is in" the state and 'false' otherwise
Attention
This function must be called only on a state machine that is in the "stable state configuration". Among others, this means that the state machine cannot call it in the middle of its own transition.
Precondition qep_hsm:602
  • internal integrity check (Software Self-Monitoring (SSM))
Backward Traceability
  • SRS_QP_SM_25 : All State Machine Implementation Strategies provided by QP/C++ Framework might supply a method for checking if a state machine is in a given state

Reimplemented from QP::QAsm.

Reimplemented in QP::QMActive.

Definition at line 771 of file qp.hpp.

◆ childState()

QStateHandler QP::QActive::childState ( QStateHandler const parent)
inlinenoexcept

Definition at line 774 of file qp.hpp.

◆ setAttr()

void QP::QActive::setAttr ( std::uint32_t attr1,
void const * attr2 = nullptr )

Generic setting of additional attributes (defined in some QP ports)

◆ start() [1/2]

void QP::QActive::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 )

Definition at line 284 of file qv.cpp.

◆ start() [2/2]

void QP::QActive::start ( QPrioSpec const prioSpec,
QEvtPtr *const qSto,
std::uint_fast16_t const qLen,
void *const stkSto,
std::uint_fast16_t const stkSize )
inline

Definition at line 787 of file qp.hpp.

◆ stop()

void QP::QActive::stop ( )

Stops execution of an active object and removes it from the framework's supervision

Attention
QActive::stop() must be called only from the AO that is about to stop its execution. By that time, any pointers or references to the AO are considered invalid (dangling) and it becomes illegal for the rest of the application to post events to the AO.

◆ register_()

void QP::QActive::register_ ( )
noexcept

Register this active object to be managed by the framework

Details
This function adds a given active object to the active objects managed by the QF framework. It should not be called by the application directly, only through the function QActive::start().
Precondition qf_qact:100
  • the "QF-priority" of the AO must be in range (must be set before calling QActive_register_())
  • the "QF-priority" must not be already in use (unique priority)
  • the "QF-priority" must not exceed the "preemption-threshold"
Postcondition qf_qact:190
  • the preceding pre-thre must not exceed the preemption-threshold
  • the preemption-threshold must not exceed the next preemption-threshold

Definition at line 67 of file qf_qact.cpp.

◆ unregister_()

void QP::QActive::unregister_ ( )
noexcept

Un-register the active object from the framework

Details
This function un-registers a given active object from the active objects managed by the QF framework. It should not be called by the QP ports.
Precondition qf_qact:200
  • the priority of the active object must not be zero and cannot exceed the maximum QF_MAX_ACTIVE
  • the priority of the AO must be already registered.
Note
The active object that is removed from the framework can no longer participate in any event exchange.

Definition at line 123 of file qf_qact.cpp.

◆ post_()

bool QP::QActive::post_ ( 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.

Details
Direct event posting is the simplest asynchronous communication method available in QF.
Parameters
[in]epointer to the event to be posted
[in]marginnumber of required free slots in the queue after posting the event or QF::NO_MARGIN.
[in]senderpointer to a sender object (used in QS only)
Returns
'true' (success) if the posting succeeded (with the provided margin) and 'false' (failure) when the posting fails.
Precondition qf_actq:102
  • the event pointer must be valid
  • check internal event integrity (QP FuSa Subsystem)
Postcondition qf_actq:110
Attention
This operation is typically used via macros POST() and POST_X(). This is because the last parameter sender might be defined/provided only in the Spy build configuration (see Q_SPY). The macros ignore the sender parameter outside the Spy configuration, so the same code builds correctly in all configurations.
Note
This function might be implemented differently in various QP/C++ ports. The provided implementation assumes that the QP::QEQueue class is used for the QP::QActive event queue.
Backward Traceability
  • DVP_QS_MC4_R15_05
Usage
extern QP::QActive * const AO_Table;
. . .
Q_STATE_DEF(Philo, hungry) {
QP::QState status_;
switch (e->sig) {
case Q_ENTRY_SIG: {
TableEvt const *pe = QP::QF::q_new<TableEvt>(HUNGRY_SIG, m_id);
AO_Table->POST(pe, this); // <===
status_ = Q_RET_HANDLED;
break;
}
. . .
}
return status_;
}
@ Q_RET_HANDLED
event handled (internal transition)
Definition qp.hpp:228
@ Q_ENTRY_SIG
signal for entry actions
Definition qp.hpp:249
evtT_ * q_new(enum_t const sig, Args... args)
Definition qp.hpp:1137
std::uint_fast8_t QState
Type returned from state-handler functions.
Definition qp.hpp:165

Definition at line 62 of file qf_actq.cpp.

◆ postLIFO()

void QP::QActive::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.

Details
The LIFO policy should be used only for self-posting and with caution because it alters order of events in the queue.
Parameters
[in]epointer to the event to be posted
Precondition qf_actq:200
  • for the QXK kernel, postLIFO() cannot be called from an extended thread
Precondition qf_actq:201
  • the queue must be able to accept the event (cannot overflow)
Backward Traceability
  • DVP_QS_MC4_R15_05
Note
This function might be implemented differently in various QP/C++ ports. The provided implementation assumes that the QP::QEQueue class is used for the QActive event queue.
See also
QP::QActive::post()

Definition at line 247 of file qf_actq.cpp.

◆ get_()

QEvt const * QP::QActive::get_ ( )
noexcept

Get an event from the event queue of an active object

Details
The behavior of this function depends on the kernel used in the QF port. For built-in kernels (QV or QK) the function can be called only when the queue is not empty, so it doesn't block. For a blocking kernel/OS the function can block and wait for delivery of an event.
Returns
A pointer to the received event. The returned pointer is guaranteed to be valid (can't be NULL).
Note
This function might be implemented differently in various QP/C++ ports. The provided implementation assumes that the QP::QEQueue class is used for the QActive event queue.

Definition at line 355 of file qf_actq.cpp.

◆ getQueueMin()

static std::uint_fast16_t QP::QActive::getQueueMin ( std::uint_fast8_t const prio)
staticnoexcept

◆ psInit()

void QP::QActive::psInit ( QSubscrList *const subscrSto,
enum_t const maxSignal )
staticnoexcept

Publish event to all subscribers of a given signal e->sig

Details
This function posts (using the FIFO policy) the event e to all active objects that have subscribed to the signal e->sig, which is called multicasting. The multicasting performed in this function is very efficient based on reference-counting inside the published event ("zero-copy" event multicasting). This function is designed to be callable from any part of the system, including ISRs, device drivers, and active objects.
Note
To avoid any unexpected re-ordering of events posted into AO queues, the event multicasting is performed with scheduler locked. However, the scheduler is locked only up to the priority level of the highest-priority subscriber, so any AOs of even higher priority, which did not subscribe to this event are not affected.

Definition at line 75 of file qf_ps.cpp.

◆ publish_()

void QP::QActive::publish_ ( QEvt const *const e,
void const *const sender,
std::uint_fast8_t const qsId )
staticnoexcept

Publish event to all subscribers of a given signal e->sig

Details
This function posts (using the FIFO policy) the event e to all active objects that have subscribed to the signal e->sig, which is called multicasting. The multicasting performed in this function is very efficient based on reference-counting inside the published event ("zero-copy" event multicasting). This function is designed to be callable from any part of the system, including ISRs, device drivers, and active objects.
Precondition qf_ps:200
  • the published signal must be within the configured range
Precondition qf_ps:202
  • check the integrity of the subscriber set (QP FuSa Subsystem)
Note
To avoid any unexpected re-ordering of events posted into AO queues, the event multicasting is performed with scheduler locked. However, the scheduler is locked only up to the priority level of the highest-priority subscriber, so any AOs of even higher priority, which did not subscribe to this event are not affected.
Attention
This operation is typically used via macro PUBLISH(). This is because the last parameter qsId might be defined/provided only in the Spy build configuration (see Q_SPY). The macro ignores the qsId parameter outside the Spy configuration, so the same code builds correctly in all configurations.
Usage
Q_STATE_DEF(Philo, eating) {
QP::QState status_;
switch (e->sig) {
. . .
case Q_EXIT_SIG: {
m_timeEvt.disarm();
TableEvt const *pe = QP::QF::q_new<TableEvt>(DONE_SIG, m_id);
QP::QActive::PUBLISH(pe, this); // <===
status_ = Q_RET_HANDLED;
break;
}
. . .
}
return status_;
}
@ Q_EXIT_SIG
signal for exit actions
Definition qp.hpp:250
#define Q_STATE_DEF(subclass_, state_)
Definition qp.hpp:441

Definition at line 98 of file qf_ps.cpp.

◆ subscribe()

void QP::QActive::subscribe ( enum_t const sig) const
noexcept

Subscribes for delivery of signal sig to the active object

Details
This function is part of the Publish-Subscribe event delivery mechanism available in QF. Subscribing to an event means that the framework will start posting all published events with a given signal sig to the event queue of the active object.
Parameters
[in]sigevent signal to subscribe
Precondition qf_ps:300
  • signal must be in range of subscribe signals
  • subscriber AO priority must be in range
  • the AO must be registered (started)
Precondition qf_ps:302
  • check the integrity of the subscriber set (QP FuSa Subsystem)
Usage
The following example shows how the Table active object subscribes to three signals in the initial transition:
Q_STATE_DEF(Philo, initial) {
. . .
subscribe(EAT_SIG); // <===
subscribe(TEST_SIG); // <===
. . .
return tran(&thinking);
}
void subscribe(enum_t const sig) const noexcept
Definition qf_ps.cpp:206
QState tran(QStateHandler const target) noexcept
Internal helper function to take a state transition in sublclasses of QP::QAsm.
Definition qp.hpp:302
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
Definition qp.hpp:498

Definition at line 206 of file qf_ps.cpp.

◆ unsubscribe()

void QP::QActive::unsubscribe ( enum_t const sig) const
noexcept

Unsubscribes from the delivery of signal sig to the active object

Details
This function is part of the Publish-Subscribe event delivery mechanism available in QF. Un-subscribing from an event means that the framework will stop posting published events with a given signal sig to the event queue of the active object.
Parameters
[in]sigevent signal to unsubscribe
Precondition qf_ps:400
  • signal must be in range of subscribe signals
  • subscriber AO priority must be in range
  • the AO must be registered (started)
Precondition qf_ps:402
  • check the integrity of the subscriber set (QP FuSa Subsystem)
Note
Due to the latency of event queues, an active object should NOT assume that a given signal sig will never be dispatched to the state machine of the active object after un-subscribing from that signal. The event might be already in the queue, or just about to be posted and the un-subscribe operation will not flush such events.
Un-subscribing from a signal that has never been subscribed in the first place is considered an error and QF will raise an assertion.

Definition at line 243 of file qf_ps.cpp.

◆ unsubscribeAll()

void QP::QActive::unsubscribeAll ( ) const
noexcept

Unsubscribes from the delivery of all signals to the active object

Details
This function is part of the Publish-Subscribe event delivery mechanism available in QF. Un-subscribing from all events means that the framework will stop posting any published events to the event queue of the active object.
Precondition qf_ps:500
  • subscriber AO priority must be in range
  • the AO must be registered (started)
Note
Due to the latency of event queues, an active object should NOT assume that no events will ever be dispatched to the state machine of the active object after un-subscribing from all events. The events might be already in the queue, or just about to be posted and the un-subscribe operation will not flush such events. Also, the alternative event-delivery mechanisms, such as direct event posting or time events, can be still delivered to the event queue of the active object.

Definition at line 280 of file qf_ps.cpp.

◆ defer()

bool QP::QActive::defer ( QEQueue *const eq,
QEvt const *const e ) const
noexcept

Defer an event to a given separate event queue

Details
This function is part of the event deferral support. An active object uses this function to defer an event e to the QF-supported native event queue eq. QF correctly accounts for another outstanding reference to the event and will not recycle the event at the end of the RTC step. Later, the active object might recall one event at a time from the event queue.
Remarks
An active object can use multiple event queues to defer events of different kinds.
Parameters
[in]eqpointer to a "raw" thread-safe queue to recall an event from.
[in]epointer to the event to be deferred
Returns
'true' (success) when the event could be deferred and 'false' (failure) if event deferral failed due to overflowing the queue.

Definition at line 61 of file qf_defer.cpp.

◆ recall()

bool QP::QActive::recall ( QEQueue *const eq)
noexcept

Recall a deferred event from a given event queue

Details
This function is part of the event deferral support. An active object uses this function to recall a deferred event from a given QF event queue. Recalling an event means that it is removed from the deferred event queue eq and posted (LIFO) to the event queue of the active object.
Parameters
[in]eqpointer to a "raw" thread-safe queue to recall an event from.
Returns
'true' if an event has been recalled and 'false' if not.
Note
An active object can use multiple event queues to defer events of different kinds.

Definition at line 90 of file qf_defer.cpp.

◆ flushDeferred()

std::uint_fast16_t QP::QActive::flushDeferred ( QEQueue *const eq,
std::uint_fast16_t const num = 0xFFFFU ) const
noexcept

Flush the specified deferred queue eq

Details
This function is part of the event deferral support. An active object can use this function to flush a given QF event queue. The function makes sure that the events are not leaked.
Parameters
[in]eqpointer to a "raw" thread-safe queue to flush.
Returns
the number of events actually flushed from the queue.

Definition at line 152 of file qf_defer.cpp.

◆ getPrio()

std::uint_fast8_t QP::QActive::getPrio ( ) const
inlinenoexcept

Definition at line 826 of file qp.hpp.

◆ setPrio()

void QP::QActive::setPrio ( QPrioSpec const prio)
inlinenoexcept

Definition at line 829 of file qp.hpp.

◆ getPThre()

std::uint_fast8_t QP::QActive::getPThre ( ) const
inlinenoexcept

Definition at line 833 of file qp.hpp.

◆ getEQueue()

QACTIVE_EQUEUE_TYPE const & QP::QActive::getEQueue ( ) const
inlinenoexcept

Definition at line 838 of file qp.hpp.

◆ getOsObject()

QACTIVE_OS_OBJ_TYPE const & QP::QActive::getOsObject ( ) const
inlinenoexcept

Definition at line 844 of file qp.hpp.

◆ getThread()

QACTIVE_THREAD_TYPE const & QP::QActive::getThread ( ) const
inlinenoexcept

Definition at line 850 of file qp.hpp.

◆ setThread()

void QP::QActive::setThread ( QACTIVE_THREAD_TYPE const & thr)
inline

Definition at line 856 of file qp.hpp.

◆ evtLoop_()

static void QP::QActive::evtLoop_ ( QActive * act)
static

Event loop thread routine for executing an active object act (defined some in QP ports)

◆ postFromISR()

virtual bool QP::QActive::postFromISR ( QEvt const *const e,
std::uint_fast16_t const margin,
void * par,
void const *const sender )
virtualnoexcept

The "FromISR" variant used in the QP port to "FreeRTOS"

◆ publishFromISR()

static void QP::QActive::publishFromISR ( QEvt const * e,
void * par,
void const * sender )
staticnoexcept

The "FromISR" variant used in the QP port to "FreeRTOS"

Friends And Related Symbol Documentation

◆ QTimeEvt

friend class QTimeEvt
friend

Definition at line 730 of file qp.hpp.

◆ QTicker

friend class QTicker
friend

Definition at line 731 of file qp.hpp.

◆ QXThread

friend class QXThread
friend

Definition at line 732 of file qp.hpp.

◆ QXMutex

friend class QXMutex
friend

Definition at line 733 of file qp.hpp.

◆ QXSemaphore

friend class QXSemaphore
friend

Definition at line 734 of file qp.hpp.

◆ QActiveDummy

friend class QActiveDummy
friend

Definition at line 735 of file qp.hpp.

◆ GuiQActive

friend class GuiQActive
friend

Definition at line 736 of file qp.hpp.

◆ GuiQMActive

friend class GuiQMActive
friend

Definition at line 737 of file qp.hpp.

◆ schedLock

void schedLock ( )
friend

Member Data Documentation

◆ m_prio

std::uint8_t QP::QActive::m_prio
protected

QF-priority [1..QF_MAX_ACTIVE] of this AO.

See also
QP::QPrioSpec

Definition at line 701 of file qp.hpp.

◆ m_pthre

std::uint8_t QP::QActive::m_pthre
protected

Preemption-threshold [1..QF_MAX_ACTIVE] of this AO.

See also
QP::QPrioSpec

Definition at line 702 of file qp.hpp.

◆ m_thread

QACTIVE_THREAD_TYPE QP::QActive::m_thread
protected

Port-dependent representation of the thread of the active object

Details
This data might be used in various ways, depending on the QF port. In some ports me->thread is used store the thread handle. In other ports me->thread can be a pointer to the Thread-Local-Storage (TLS).

Definition at line 705 of file qp.hpp.

◆ m_osObject

QACTIVE_OS_OBJ_TYPE QP::QActive::m_osObject
protected

Port-dependent per-thread object.

Details
This data might be used in various ways, depending on the QF port. In some ports me->osObject is used to block the calling thread when the native QF queue is empty. In other QF ports the OS-dependent object might be used differently.

Definition at line 709 of file qp.hpp.

◆ m_eQueue

QACTIVE_EQUEUE_TYPE QP::QActive::m_eQueue
protected

Port-dependent event-queue type (often QP::QEQueue)

Details
The type of the queue depends on the underlying operating system or a kernel. Many kernels support "message queues" that can be adapted to deliver QF events to the active object. Alternatively, QF provides a native event queue implementation that can be used as well.
Note
The native QF event queue is configured by defining the macro QP::QACTIVE_EQUEUE_TYPE as QP::QEQueue.

Definition at line 713 of file qp.hpp.

◆ m_prio_dis

std::uint8_t QP::QActive::m_prio_dis

Definition at line 719 of file qp.hpp.

◆ m_pthre_dis

std::uint8_t QP::QActive::m_pthre_dis

Definition at line 723 of file qp.hpp.

◆ registry_

QActive * QP::QActive::registry_
static

Static (one per-class) array of registered active objects

Definition at line 725 of file qp.hpp.

◆ subscrList_

QSubscrList * QP::QActive::subscrList_
static

Static (one per-class) pointer to all subscriber AOs for a given event signal.

Definition at line 726 of file qp.hpp.

◆ maxPubSignal_

enum_t QP::QActive::maxPubSignal_
static

Static (one per-class) maximum published signal (the size of the subscrList_ array)

Definition at line 727 of file qp.hpp.


The documentation for this class was generated from the following files: