mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
CircularBuffer< T, BufferSize, CounterType > Class Template Reference
[CircularBuffer functions]
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 () const |
Check if the buffer is empty. | |
bool | full () const |
Check if the buffer is full. | |
void | reset () |
Reset the buffer. | |
CounterType | size () const |
Get the number of elements currently stored in the circular_buffer. | |
bool | peek (T &data) const |
Peek into circular buffer without popping. | |
void | push (const T &data) |
Push the transaction to the buffer. | |
bool | pop (T &data) |
Pop the transaction from the buffer. | |
bool | empty () const |
Check if the buffer is empty. | |
bool | full () const |
Check if the buffer is full. | |
void | reset () |
Reset the buffer. | |
CounterType | size () const |
Get the number of elements currently stored in the circular_buffer. | |
bool | peek (T &data) const |
Peek into circular buffer without popping. |
Detailed Description
template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
class mbed::CircularBuffer< T, BufferSize, CounterType >
Templated Circular buffer class.
- Note:
- Synchronization level: Interrupt safe
- CounterType must be unsigned and consistent with BufferSize
Definition at line 66 of file cmsis/BUILD/mbed/platform/CircularBuffer.h.
Member Function Documentation
bool empty | ( | ) | const |
Check if the buffer is empty.
- Returns:
- True if the buffer is empty, false if not
Definition at line 135 of file cmsis/BUILD/mbed/platform/CircularBuffer.h.
bool empty | ( | ) | const |
Check if the buffer is empty.
- Returns:
- True if the buffer is empty, false if not
Definition at line 135 of file platform/CircularBuffer.h.
bool full | ( | ) | const |
Check if the buffer is full.
- Returns:
- True if the buffer is full, false if not
Definition at line 147 of file cmsis/BUILD/mbed/platform/CircularBuffer.h.
bool full | ( | ) | const |
Check if the buffer is full.
- Returns:
- True if the buffer is full, false if not
Definition at line 147 of file platform/CircularBuffer.h.
bool peek | ( | T & | data ) | const |
Peek into circular buffer without popping.
- Parameters:
-
data Data to be peeked from the buffer
- Returns:
- True if the buffer is not empty and data contains a transaction, false otherwise
Definition at line 190 of file cmsis/BUILD/mbed/platform/CircularBuffer.h.
bool peek | ( | T & | data ) | const |
Peek into circular buffer without popping.
- Parameters:
-
data Data to be peeked from the buffer
- Returns:
- True if the buffer is not empty and data contains a transaction, false otherwise
Definition at line 190 of file platform/CircularBuffer.h.
bool pop | ( | T & | data ) |
Pop the transaction from the buffer.
- Parameters:
-
data Data to be popped from the buffer
- Returns:
- True if the buffer is not empty and data contains a transaction, false otherwise
Definition at line 115 of file platform/CircularBuffer.h.
bool pop | ( | T & | data ) |
Pop the transaction from the buffer.
- Parameters:
-
data Data to be popped from the buffer
- Returns:
- True if the buffer is not empty and data contains a transaction, false otherwise
Definition at line 115 of file cmsis/BUILD/mbed/platform/CircularBuffer.h.
void push | ( | const T & | data ) |
Push the transaction to the buffer.
This overwrites the buffer if it's full
- Parameters:
-
data Data to be pushed to the buffer
Definition at line 91 of file platform/CircularBuffer.h.
void push | ( | const T & | data ) |
Push the transaction to the buffer.
This overwrites the buffer if it's full
- Parameters:
-
data Data to be pushed to the buffer
Definition at line 91 of file cmsis/BUILD/mbed/platform/CircularBuffer.h.
void reset | ( | ) |
Reset the buffer.
Definition at line 158 of file platform/CircularBuffer.h.
void reset | ( | ) |
Reset the buffer.
Definition at line 158 of file cmsis/BUILD/mbed/platform/CircularBuffer.h.
CounterType size | ( | ) | const |
Get the number of elements currently stored in the circular_buffer.
Definition at line 168 of file cmsis/BUILD/mbed/platform/CircularBuffer.h.
CounterType size | ( | ) | const |
Get the number of elements currently stored in the circular_buffer.
Definition at line 168 of file platform/CircularBuffer.h.
Generated on Tue Jul 12 2022 20:41:18 by 1.7.2