#include <Buffer.h>
Public Member Functions | |
uint32_t | available (void) |
Buffer (uint32_t size=0x100) | |
void | clear (void) |
T | get (void) |
uint32_t | getSize () |
T * | head (void) |
operator int (void) | |
Buffer & | operator= (T data) |
uint32_t | peek (char c) |
void | put (T data) |
~Buffer () | |
Private Attributes | |
T * | _buf |
volatile uint32_t | _rloc |
uint32_t | _size |
volatile uint32_t | _wloc |
A templated software ring buffer
Example:
Create a Buffer and allocate memory for it
size | The size of the buffer |
Definition at line 27 of file Buffer.cpp.
Destry a Buffer and release it's allocated memory
Definition at line 37 of file Buffer.cpp.
|
inline |
void Buffer< T >::clear | ( | void | ) |
Reset the buffer to 0. Useful if using head() to parse packeted data
Definition at line 51 of file Buffer.cpp.
|
inline |
uint32_t Buffer< T >::getSize | ( | ) |
Get the size of the ring buffer
Definition at line 45 of file Buffer.cpp.
|
inline |
|
inline |
uint32_t Buffer< T >::peek | ( | char | c | ) |
Definition at line 61 of file Buffer.cpp.
|
inline |
|
private |
|
private |