mbed-drivers
Public Member Functions | List of all members
mbed::CircularBuffer< T, BufferSize, CounterType > Class Template Reference

#include <CircularBuffer.h>

Public Member Functions

void push (const T &data)
 
bool pop (T &data)
 
bool empty ()
 
bool full ()
 
void reset ()
 

Detailed Description

template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
class mbed::CircularBuffer< T, BufferSize, CounterType >

Templated Circular buffer class

Member Function Documentation

template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
bool mbed::CircularBuffer< T, BufferSize, CounterType >::empty ( )
inline

Check if the buffer is empty

Returns
True if the buffer is empty, false if not
template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
bool mbed::CircularBuffer< T, BufferSize, CounterType >::full ( )
inline

Check if the buffer is full

Returns
True if the buffer is full, false if not
template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
bool mbed::CircularBuffer< T, BufferSize, CounterType >::pop ( T &  data)
inline

Pop the transaction from the buffer

Parameters
dataData to be pushed to the buffer
Returns
True if the buffer is not empty and data contains a transaction, false otherwise
template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
void mbed::CircularBuffer< T, BufferSize, CounterType >::push ( const T &  data)
inline

Push the transaction to the buffer. This overwrites the buffer if it's full

Parameters
dataData to be pushed to the buffer
template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
void mbed::CircularBuffer< T, BufferSize, CounterType >::reset ( )
inline

Reset the buffer


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