PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

Embed: (wiki syntax)

« Back to documentation index

CircularBuffer< T, BufferSize, CounterType > Class Template Reference

CircularBuffer< T, BufferSize, CounterType > Class Template Reference

Templated Circular buffer class. More...

#include <CircularBuffer.h>

Public Member Functions

void push (const T &data)
 Push the transaction to the buffer.
bool pop (T &data)
 Pop the transaction from the buffer.
bool empty ()
 Check if the buffer is empty.
bool full ()
 Check if the buffer is full.
void reset ()
 Reset the buffer.

Detailed Description

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

Templated Circular buffer class.

Definition at line 24 of file CircularBuffer.h.


Member Function Documentation

bool empty (  )

Check if the buffer is empty.

Returns:
True if the buffer is empty, false if not

Definition at line 68 of file CircularBuffer.h.

bool full (  )

Check if the buffer is full.

Returns:
True if the buffer is full, false if not

Definition at line 76 of file CircularBuffer.h.

bool pop ( T &  data )

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

Definition at line 54 of file CircularBuffer.h.

void push ( const T &  data )

Push the transaction to the buffer.

This overwrites the buffer if it's full

Parameters:
dataData to be pushed to the buffer

Definition at line 37 of file CircularBuffer.h.

void reset (  )

Reset the buffer.

Definition at line 83 of file CircularBuffer.h.