|
OpenCPN Partial API docs
|
Fixed size, synchronized FIFO buffer. More...
#include <comm_buffers.h>
Public Member Functions | |
| CircularBuffer (size_t size) | |
| void | Reset () noexcept |
| Reset internal state, ditch possible contained data. | |
| size_t | Capacity () const noexcept |
| Return buffer max size. | |
| size_t | Size () const noexcept |
| Return actual size. | |
| bool | IsEmpty () const noexcept |
| Return true if buffer is empty. | |
| bool | IsFull () const noexcept |
| Return true if buffer is full. | |
| bool | SafePut (const T &item) noexcept |
| Add item to buffer without throwing exceptions. | |
| void | Put (const T &item) |
| Add item to buffer; throw BufferError if full. | |
| T | Get () |
| Get item from buff; throw BufferError if empty. | |
| bool | Get (T &item) noexcept |
| Retrieve item from buffer without throwing exceptions. | |
| const T & | Peek () const |
| bool | Peek (T &item) const noexcept |
Fixed size, synchronized FIFO buffer.
Some methods throws BufferError.
Definition at line 107 of file comm_buffers.h.
|
inlineexplicit |
Definition at line 109 of file comm_buffers.h.
|
inlinenoexcept |
Return buffer max size.
Definition at line 125 of file comm_buffers.h.
|
inline |
Get item from buff; throw BufferError if empty.
Definition at line 167 of file comm_buffers.h.
|
inlinenoexcept |
Retrieve item from buffer without throwing exceptions.
Definition at line 177 of file comm_buffers.h.
|
inlinenoexcept |
Return true if buffer is empty.
Definition at line 137 of file comm_buffers.h.
|
inlinenoexcept |
Return true if buffer is full.
Definition at line 143 of file comm_buffers.h.
|
inline |
Definition at line 184 of file comm_buffers.h.
|
inlinenoexcept |
Definition at line 190 of file comm_buffers.h.
|
inline |
Add item to buffer; throw BufferError if full.
Definition at line 160 of file comm_buffers.h.
|
inlinenoexcept |
Reset internal state, ditch possible contained data.
Definition at line 117 of file comm_buffers.h.
|
inlinenoexcept |
Add item to buffer without throwing exceptions.
Definition at line 152 of file comm_buffers.h.
|
inlinenoexcept |
Return actual size.
Definition at line 128 of file comm_buffers.h.