Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: SPIne CH_Communicatuin_Test CH_Communicatuin_Test2 MCP_SPIne ... more
Fork of mbed-dev-f303 by
CircularBuffer< T, BufferSize, CounterType > Class Template Reference
[Platform]
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. |
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
Definition at line 30 of file 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 79 of file CircularBuffer.h.
bool full | ( | ) | const |
Check if the buffer is full.
- Returns:
- True if the buffer is full, false if not
Definition at line 90 of file CircularBuffer.h.
bool pop | ( | T & | data ) |
Pop the transaction from the buffer.
- Parameters:
-
data Data to be pushed to the buffer
- Returns:
- True if the buffer is not empty and data contains a transaction, false otherwise
Definition at line 62 of file 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 43 of file CircularBuffer.h.
void reset | ( | ) |
Reset the buffer.
Definition at line 100 of file CircularBuffer.h.
Generated on Tue Jul 12 2022 19:39:50 by
