Templated Circular buffer class. More...
#include <CircularBuffer.h>
Public Member Functions | |
| void | push (const T &data) |
| Push the transaction to the buffer. More... | |
| void | push (const T *src, CounterType len) |
| Push the transaction to the buffer. More... | |
| void | push (mbed::Span< const T > src) |
| Push the transaction to the buffer. More... | |
| bool | pop (T &data) |
| Pop from the buffer. More... | |
| CounterType | pop (T *dest, CounterType len) |
| Pop multiple elements from the buffer. More... | |
| mbed::Span< T > | pop (mbed::Span< T > dest) |
| Pop multiple elements from the buffer. More... | |
| bool | empty () const |
| Check if the buffer is empty. More... | |
| bool | full () const |
| Check if the buffer is full. More... | |
| void | reset () |
| Reset the buffer. More... | |
| CounterType | size () const |
| Get the number of elements currently stored in the circular_buffer. More... | |
| bool | peek (T &data) const |
| Peek into circular buffer without popping. More... | |
Templated Circular buffer class.
Definition at line 69 of file CircularBuffer.h.
| bool empty | ( | ) | const |
Check if the buffer is empty.
Definition at line 261 of file CircularBuffer.h.
| bool full | ( | ) | const |
Check if the buffer is full.
Definition at line 273 of file CircularBuffer.h.
| bool peek | ( | T & | data | ) | const |
Peek into circular buffer without popping.
| data | Data to be peeked from the buffer. |
Definition at line 306 of file CircularBuffer.h.
| bool pop | ( | T & | data | ) |
Pop from the buffer.
| data | Container to store the data to be popped from the buffer. |
Definition at line 172 of file CircularBuffer.h.
| CounterType pop | ( | T * | dest, |
| CounterType | len | ||
| ) |
Pop multiple elements from the buffer.
| dest | The array which will receive the elements. |
| len | The number of elements to pop. |
Definition at line 199 of file CircularBuffer.h.
| mbed::Span<T> pop | ( | mbed::Span< T > | dest | ) |
Pop multiple elements from the buffer.
| dest | The span that contains the buffer that will be used to store the elements. |
Definition at line 251 of file CircularBuffer.h.
| void push | ( | const T & | data | ) |
Push the transaction to the buffer.
This overwrites the buffer if it's full.
| data | Data to be pushed to the buffer. |
Definition at line 93 of file CircularBuffer.h.
| void push | ( | const T * | src, |
| CounterType | len | ||
| ) |
Push the transaction to the buffer.
This overwrites the buffer if it's full.
| src | Data to be pushed to the buffer. |
| len | Number of items to be pushed to the buffer. |
Definition at line 115 of file CircularBuffer.h.
| void push | ( | mbed::Span< const T > | src | ) |
Push the transaction to the buffer.
This overwrites the buffer if it's full.
| src | Data to be pushed to the buffer. |
Definition at line 162 of file CircularBuffer.h.
| void reset | ( | ) |
Reset the buffer.
Definition at line 281 of file CircularBuffer.h.
| CounterType size | ( | ) | const |
Get the number of elements currently stored in the circular_buffer.
Definition at line 293 of file CircularBuffer.h.