0.01.00
ot::MessagePool Class Reference

This class represents a message pool. More...

#include <src/core/common/message.hpp>

Inheritance diagram for ot::MessagePool:
ot::InstanceLocator

Classes

class  Iterator
 This class represents an iterator for iterating through all queued message from this pool. More...
 

Public Member Functions

 MessagePool (otInstance &aInstance)
 This constructor initializes the object.
 
MessageNew (uint8_t aType, uint16_t aReserveHeader)
 This method is used to obtain a new message. More...
 
void Free (Message *aMessage)
 This method is used to free a message and return all message buffers to the buffer pool. More...
 
Iterator GetAllMessagesHead (void) const
 This method returns a pointer to the first message (head) in the all-messages list. More...
 
Iterator GetAllMessagesTail (void) const
 This method returns a pointer to the last message (head) in the all-messages list. More...
 
uint16_t GetFreeBufferCount (void) const
 This method returns the number of free buffers. More...
 
- Public Member Functions inherited from ot::InstanceLocator
otInstanceGetInstance (void) const
 This method returns a reference to the parent otInstance structure. More...
 
Ip6::Ip6GetIp6 (void) const
 This method returns a reference to the Ip6. More...
 
ThreadNetifGetNetif (void) const
 This method returns a reference to the thread network interface. More...
 

Friends

class Message
 
class MessageQueue
 
class PriorityQueue
 

Additional Inherited Members

- Protected Member Functions inherited from ot::InstanceLocator
 InstanceLocator (otInstance &aInstance)
 This constructor initializes the object. More...
 

Detailed Description

This class represents a message pool.

Member Function Documentation

§ Free()

void ot::MessagePool::Free ( Message aMessage)

This method is used to free a message and return all message buffers to the buffer pool.

Parameters
[in]aMessageThe message to free.

§ GetAllMessagesHead()

MessagePool::Iterator ot::MessagePool::GetAllMessagesHead ( void  ) const

This method returns a pointer to the first message (head) in the all-messages list.

Messages are sorted based on their priority (head with highest priority) and order by which they are enqueued.

Returns
A pointer to the first message.

§ GetAllMessagesTail()

Iterator ot::MessagePool::GetAllMessagesTail ( void  ) const
inline

This method returns a pointer to the last message (head) in the all-messages list.

Messages are sorted based on their priority (head with highest priority) and order by which they are enqueued.

Returns
A pointer to the last message.

§ GetFreeBufferCount()

uint16_t ot::MessagePool::GetFreeBufferCount ( void  ) const
inline

This method returns the number of free buffers.

Returns
The number of free buffers.

§ New()

Message * ot::MessagePool::New ( uint8_t  aType,
uint16_t  aReserveHeader 
)

This method is used to obtain a new message.

The default priority kDefaultMessagePriority is assigned to the message.

Parameters
[in]aTypeThe message type.
[in]aReserveHeaderThe number of header bytes to reserve.
Returns
A pointer to the message or NULL if no message buffers are available.

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