FreeRTOScpp
Loading...
Searching...
No Matches
MessageBuffer< size > Class Template Reference

Template to implement a Message Buffer of a given size. More...

#include <MessageBufferCPP.h>

Inheritance diagram for MessageBuffer< size >:
Collaboration diagram for MessageBuffer< size >:

Public Member Functions

 MessageBuffer ()
 
virtual ~MessageBuffer ()
 
size_t available () const
 Get the amount of available space open in the MessageBuffer.
 
bool isEmpty () const
 
bool isFull () const
 
size_t read (void *data, size_t len, TickType_t delay=portMAX_DELAY)
 
size_t read_ISR (void *data, size_t len, BaseType_t &wasWoken)
 
bool reset ()
 Resets the buffer to empty.
 
size_t send (const void *data, size_t len, TickType_t delay=portMAX_DELAY)
 
size_t send_ISR (const void *data, size_t len, BaseType_t &wasWoken)
 

Public Attributes

MessageBufferHandle_t msgHandle
 

Detailed Description

template<size_t size>
class MessageBuffer< size >

Template to implement a Message Buffer of a given size.

MessageBuffer will be created statically if possible.

Template Parameters
sizeThe number of bytes to store in the buffer, 0 = dynamically created

Constructor & Destructor Documentation

◆ MessageBuffer()

template<size_t size>
MessageBuffer< size >::MessageBuffer ( )
inline

◆ ~MessageBuffer()

template<size_t size>
virtual MessageBuffer< size >::~MessageBuffer ( )
inlinevirtual

Member Function Documentation

◆ available()

size_t MessageBufferBase::available ( ) const
inlineinherited

Get the amount of available space open in the MessageBuffer.

Returns
The number of bytes that can be sent before the buffer is full

◆ isEmpty()

bool MessageBufferBase::isEmpty ( ) const
inlineinherited

◆ isFull()

bool MessageBufferBase::isFull ( ) const
inlineinherited

◆ read()

size_t MessageBufferBase::read ( void * data,
size_t len,
TickType_t delay = portMAX_DELAY )
inlineinherited

◆ read_ISR()

size_t MessageBufferBase::read_ISR ( void * data,
size_t len,
BaseType_t & wasWoken )
inlineinherited

◆ reset()

bool MessageBufferBase::reset ( )
inlineinherited

Resets the buffer to empty.

Returns
True if done, stream can not be reset if a task is waiting on the MessageBuffer.

◆ send()

size_t MessageBufferBase::send ( const void * data,
size_t len,
TickType_t delay = portMAX_DELAY )
inlineinherited

◆ send_ISR()

size_t MessageBufferBase::send_ISR ( const void * data,
size_t len,
BaseType_t & wasWoken )
inlineinherited

Member Data Documentation

◆ msgHandle

MessageBufferHandle_t MessageBufferBase::msgHandle
inherited

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