Mark3 Realtime Kernel
Mark3::MessagePool Class Reference

The MessagePool Class The MessagePool class implements a simple allocator for message objects exchanged between threads. The sender allocates (pop's) messages, then sends them to the receiver. Upon receipt, it is the receiver's responsibility to deallocate (push) the message back to the pool. More...

#include <message.h>

Public Member Functions

void * operator new (size_t sz, void *pv)
 
 ~MessagePool ()
 
void Init ()
 Init. More...
 
void Push (Message *pclMessage_)
 Push. More...
 
MessagePop ()
 Pop. More...
 
MessageGetHead ()
 GetHead. More...
 

Private Attributes

TypedDoubleLinkList< Messagem_clList
 Linked list used to manage the Message objects. More...
 

Detailed Description

The MessagePool Class The MessagePool class implements a simple allocator for message objects exchanged between threads. The sender allocates (pop's) messages, then sends them to the receiver. Upon receipt, it is the receiver's responsibility to deallocate (push) the message back to the pool.

Examples:
lab8_messages/main.cpp.

Definition at line 157 of file message.h.

Constructor & Destructor Documentation

◆ ~MessagePool()

Mark3::MessagePool::~MessagePool ( )
inline

Definition at line 161 of file message.h.

Member Function Documentation

◆ GetHead()

Message * Mark3::MessagePool::GetHead ( )

GetHead.

Return a pointer to the first element in the message list

Returns

Definition at line 52 of file message.cpp.

◆ Init()

void Mark3::MessagePool::Init ( void  )

Init.

Initialize the message queue prior to use

Definition at line 26 of file message.cpp.

◆ operator new()

void* Mark3::MessagePool::operator new ( size_t  sz,
void *  pv 
)
inline

Definition at line 160 of file message.h.

◆ Pop()

Message * Mark3::MessagePool::Pop ( )

Pop.

Pop a message from the queue, returning it to the user to be popu32ated before sending by a transmitter.

Returns
Pointer to a Message object
Examples:
lab8_messages/main.cpp.

Definition at line 41 of file message.cpp.

◆ Push()

void Mark3::MessagePool::Push ( Message pclMessage_)

Push.

Return a previously-claimed message object back to the queue. used once the message has been processed by a receiver.

Parameters
pclMessage_Pointer to the Message object to return back to the queue
Examples:
lab8_messages/main.cpp.

Definition at line 32 of file message.cpp.

Member Data Documentation

◆ m_clList

TypedDoubleLinkList<Message> Mark3::MessagePool::m_clList
private

Linked list used to manage the Message objects.

Definition at line 201 of file message.h.


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