FreeRTOScpp
Loading...
Searching...
No Matches
StreamBufferBase Class Reference

Base class for the Various Stream Buffers. More...

#include <StreamBufferCPP.h>

Inheritance diagram for StreamBufferBase:
Collaboration diagram for StreamBufferBase:

Public Member Functions

 StreamBufferBase (StreamBufferHandle_t sbHandle)
 
virtual ~StreamBufferBase ()
 
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

Base class for the Various Stream Buffers.

This class provides all the generic operations.

The derived class will create the buffer, or can be created as a wrapper from an existing streambuffer.

Constructor & Destructor Documentation

◆ StreamBufferBase()

StreamBufferBase::StreamBufferBase ( StreamBufferHandle_t sbHandle)
inline

◆ ~StreamBufferBase()

virtual StreamBufferBase::~StreamBufferBase ( )
inlinevirtual

Member Function Documentation

◆ available()

size_t StreamBufferBase::available ( ) const
inline

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
inline

◆ isFull()

bool StreamBufferBase::isFull ( ) const
inline

◆ read()

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

◆ read_ISR()

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

◆ reset()

bool StreamBufferBase::reset ( )
inline

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 )
inline

◆ send_ISR()

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

◆ trigger()

bool StreamBufferBase::trigger ( size_t trigger)
inline

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
inline

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

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