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

StreamBuffer wrapper. More...

#include <StreamBufferCPP.h>

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

Public Member Functions

 StreamBuffer (size_t trigger=1)
 
virtual ~StreamBuffer ()
 
size_t available () const
 Get the amount of available space open in the StreamBuffer.
 
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)
 
bool trigger (size_t trigger)
 Sets the Trigger Level for the StreamBuffer.
 
size_t waiting () const
 Get number of bytes of data available in the StreamBuffer.
 

Public Attributes

StreamBufferHandle_t streamHandle
 

Detailed Description

template<size_t size>
class StreamBuffer< size >

StreamBuffer wrapper.

Template Parameters
sizeThe size of the stream buffer, 0 for dynamically created

Constructor & Destructor Documentation

◆ StreamBuffer()

template<size_t size>
StreamBuffer< size >::StreamBuffer ( size_t trigger = 1)
inline

◆ ~StreamBuffer()

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

Member Function Documentation

◆ available()

size_t StreamBufferBase::available ( ) const
inlineinherited

Get the amount of available space open in the StreamBuffer.

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

◆ isEmpty()

bool StreamBufferBase::isEmpty ( ) const
inlineinherited

◆ isFull()

bool StreamBufferBase::isFull ( ) const
inlineinherited

◆ read()

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

◆ read_ISR()

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

◆ reset()

bool StreamBufferBase::reset ( )
inlineinherited

Resets the buffer to empty.

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

◆ send()

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

◆ send_ISR()

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

◆ trigger()

bool StreamBufferBase::trigger ( size_t trigger)
inlineinherited

Sets the Trigger Level for the StreamBuffer.

Parameters
triggerthe Trigger Level
Returns
If trigger level was set (false means trigger bigger than the buffer size)

◆ waiting()

size_t StreamBufferBase::waiting ( ) const
inlineinherited

Get number of bytes of data available in the StreamBuffer.

Returns
The number of bytes that can be read

Member Data Documentation

◆ streamHandle

StreamBufferHandle_t StreamBufferBase::streamHandle
inherited

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