37 #include "qs_dummy.hpp"
40#if (QF_MAX_EPOOL > 0U)
44Q_DEFINE_THIS_MODULE(
"qf_dyn")
53 std::uint_fast32_t
const poolSize,
54 std::uint_fast16_t
const evtSize)
noexcept
56 std::uint_fast8_t
const poolNum =
priv_.maxPool_;
73 priv_.maxPool_ =
static_cast<std::uint8_t
>(poolNum + 1U);
83 std::array<std::uint8_t, 9> obj_name =
84 {
'E',
'v',
't',
'P',
'o',
'o',
'l',
'?',
'\0' };
86 obj_name[7] =
static_cast<std::uint8_t
>(
87 static_cast<std::uint8_t
>(
'0') +
priv_.maxPool_);
88 QS::obj_dict_pre_(&
priv_.ePool_[poolNum],
89 reinterpret_cast<char *
>(&obj_name[0]));
99 std::uint8_t
const maxPool =
priv_.maxPool_;
105 std::uint16_t
const maxSize =
115std::uint16_t
getPoolUse(std::uint_fast8_t
const poolNum)
noexcept {
128 std::uint16_t nUse = 0U;
135 for (std::uint_fast8_t pool =
priv_.
maxPool_; pool > 0U; --pool) {
150std::uint16_t
getPoolFree(std::uint_fast8_t
const poolNum)
noexcept {
155 std::uint8_t
const maxPool =
priv_.maxPool_;
174std::uint16_t
getPoolMin(std::uint_fast8_t
const poolNum)
noexcept {
179 std::uint8_t
const maxPool =
priv_.maxPool_;
198 std::uint_fast16_t
const evtSize,
199 std::uint_fast16_t
const margin,
205 std::uint8_t
const maxPool =
priv_.maxPool_;
211 std::uint8_t poolNum = 0U;
212 for (; poolNum < maxPool; ++poolNum) {
232 static_cast<std::uint_fast8_t
>(
QS_ID_EP) + poolNum);
235 ((margin !=
NO_MARGIN) ? margin : 0U), 0U);
245 static_cast<std::uint_fast8_t
>(
QS_ID_EP) + poolNum)
261 static_cast<std::uint_fast8_t
>(
QS_ID_EP) + poolNum)
283 std::uint8_t
const poolNum =
static_cast<std::uint8_t
>(e->poolNum_);
286 if (e->refCtr_ > 1U) {
289 static_cast<std::uint_fast8_t
>(
QS_ID_EP) + poolNum)
301 std::uint8_t
const maxPool =
priv_.maxPool_;
310 static_cast<std::uint_fast8_t
>(
QS_ID_EP) + poolNum)
322 const_cast<QEvt*
>(e),
323 static_cast<std::uint_fast8_t
>(
QS_ID_EP) + poolNum);
326 const_cast<QEvt*
>(e), 0U);
337 QEvt const *
const e,
338 QEvt const *
const evtRef)
noexcept
357 std::uint_fast8_t
const poolNum = e->poolNum_;
365 static_cast<std::uint_fast8_t
>(
QS_ID_EP) + poolNum)
382 QEvt const *
const e = evtRef;
388 std::uint8_t
const poolNum = e->
poolNum_;
391 static_cast<std::uint_fast8_t
>(
QS_ID_EP) + poolNum)
400#if (QF_MAX_EPOOL > 0U)
std::uint32_t poolNum_
Event pool number of this event.
std::uint32_t refCtr_
Event reference counter.
std::uint32_t sig
Signal of the event (see Event Signal).
std::array< QF_EPOOL_TYPE_, QF_MAX_EPOOL > ePool_
Array of event pools sized for the maximum allowed number of pools.
std::uint8_t maxPool_
Number of event pools managed by the QF Framework.
QF Active Object Framework namespace.
void deleteRef_(QEvt const *const evtRef) noexcept
std::uint16_t poolGetMaxBlockSize() noexcept
Obtain the block size of any registered event pools.
QEvt const * newRef_(QEvt const *const e, QEvt const *const evtRef) noexcept
void gc(QEvt const *const e) noexcept
Recycle a mutable (mutable) event.
QEvt * newX_(std::uint_fast16_t const evtSize, std::uint_fast16_t const margin, QSignal const sig) noexcept
void poolInit(void *const poolSto, std::uint_fast32_t const poolSize, std::uint_fast16_t const evtSize) noexcept
Event pool initialization for dynamic allocation of events.
std::uint16_t getPoolUse(std::uint_fast8_t const poolNum) noexcept
constexpr std::uint_fast16_t NO_MARGIN
Special value of margin that causes asserting failure in case event allocation or event posting fails...
std::uint16_t getPoolMin(std::uint_fast8_t const poolNum) noexcept
Obtain the minimum of free entries of the given event pool.
std::uint16_t getPoolFree(std::uint_fast8_t const poolNum) noexcept
QP/C++ Framework namespace.
constexpr std::int_fast16_t QS_ID_EP
@ QS_QF_NEW
new event was created
@ QS_QF_GC
garbage collection
@ QS_QF_DELETE_REF
an event reference is about to be deleted
@ QS_QF_NEW_ATTEMPT
an attempt to allocate an event failed
@ QS_QF_GC_ATTEMPT
garbage collection attempt
@ QS_QF_NEW_REF
new event reference was created
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.
std::uint16_t QSignal
The signal of event QP::QEvt.
#define Q_UNUSED_PAR(par_)
Helper macro to clearly mark unused parameters of functions.
#define QF_MAX_ACTIVE
Maximum # Active Objects in the system (1..64).
#define QF_MAX_EPOOL
Maximum # event pools in the system (0..15).
QP Framework in C++ internal (package-scope) interface
#define QF_EPOOL_FREE_(ePool_)
#define QF_EPOOL_MIN_(ePool_)
#define QF_EPOOL_EVENT_SIZE_(p_)
#define QF_EPOOL_PUT_(p_, e_, qsId_)
#define QF_EPOOL_INIT_(p_, poolSto_, poolSize_, evtSize_)
#define QF_EPOOL_USE_(ePool_)
#define QF_EPOOL_GET_(p_, e_, m_, qsId_)
#define QS_CRIT_EXIT()
Internal macro for exiting a critical section.
#define QS_CRIT_ENTRY()
Internal macro for entering a critical section.
QS (QP/Spy software tracing) internal (package-scope) interface.
#define QS_SIG_PRE(sig_)
Output pre-formatted event signal data element.
#define QS_2U8_PRE(data1_, data2_)
Output two pre-formatted unsigned 8-bit integer data elements.
#define QS_EVS_PRE(size_)
Output pre-formatted event queue size data element.
#define QS_END_PRE()
Pre-formatted QS trace record end.
#define QS_BEGIN_PRE(rec_, qsId_)
Pre-formatted QS trace record begin.
QP Functional Safety (FuSa) Subsystem.
#define Q_ASSERT_INCRIT(id_, expr_)
General-purpose assertion with user-specified ID number (in critical section).
#define Q_REQUIRE_INCRIT(id_, expr_)
Assertion for checking a precondition (in critical section).