QP/C++  7.3.3
Real-Time Embedded Framework
Loading...
Searching...
No Matches
qmpool.hpp File Reference

QP native, platform-independent memory pool QP::QMPool interface. More...

Go to the source code of this file.

Classes

struct  QP::QFreeBlock
 Structure representing a free block in QP::QMPool. More...
 
class  QP::QMPool
 Native QF Memory Pool. More...
 

Namespaces

namespace  QP
 QP/C++ framework.
 

Macros

#define QF_MPOOL_EL(evType_)
 

Typedefs

using QP::QMPoolSize = std::uint16_t
 
using QP::QMPoolCtr = std::uint16_t
 

Detailed Description

QP native, platform-independent memory pool QP::QMPool interface.

Traceability
  • DVP-QP-MC4-D04_08

Definition in file qmpool.hpp.

Macro Definition Documentation

◆ QF_MPOOL_EL

#define QF_MPOOL_EL (   evType_)
Value:
struct { \
QP::QFreeBlock sto_[((sizeof(evType_) - 1U) \
/ sizeof(QP::QFreeBlock)) + 1U]; }
Structure representing a free block in QP::QMPool.
Definition qmpool.hpp:84

Memory pool element to allocate correctly aligned storage for QMPool class.

Parameters
[in]evType_event type (name of the subclass of QP::QEvt)
Traceability
  • DVP-QP-MC4-D04_09A
Usage
static QF_MPOOL_EL(QP::QEvt) smallPoolSto[CONFIG_QPC_SMALL_POOL_SIZE];
struct {
QP::QEvt evt;
std::uint8_t data[CONFIG_QPC_MEDIUM_POOL_ENTRY_SIZE];
} mediumPool;
static QF_MPOOL_EL(mediumPool) mediumPoolSto[CONFIG_QPC_MEDIUM_POOL_SIZE];
struct {
QP::QEvt evt;
uint32_t data[CONFIG_QPC_LARGE_POOL_ENTRY_SIZE];
} largePool;
static QF_MPOOL_EL(largePool) largePoolSto[CONFIG_QPC_LARGE_POOL_SIZE];
. . .
int main() {
. . .
// initialize Event Memory Pools...
QF::poolInit(smallPoolSto, sizeof(smallPoolSto), sizeof(smallPoolSto[0]));
QF::poolInit(mediumPoolSto, sizeof(mediumPoolSto), sizeof(mediumPoolSto[0]));
QF::poolInit(largePoolSto, sizeof(largePoolSto), sizeof(largePoolSto[0]));
. . .
}
Event class.
Definition qp.hpp:139
#define QF_MPOOL_EL(evType_)
Definition qmpool.hpp:77

Definition at line 77 of file qmpool.hpp.