#include <RingBuffer.hpp>
template<typename T, size_t S>
class RingBuffer< T, S >
Definition at line 19 of file RingBuffer.hpp.
◆ RingBuffer()
template<typename T , size_t S>
Initializes the circular buffer and allocates the data memory.
Definition at line 25 of file RingBuffer.hpp.
◆ Capacity()
template<typename T , size_t S>
Returns the buffer capacity (in number of bytes).
- Returns
- int Buffer capacity in bytes
Definition at line 162 of file RingBuffer.hpp.
◆ Dequeue() [1/2]
template<typename T , size_t S>
Dequeues from the circular buffer and returns the data.
- Returns
- T Returns dequeued data.
Definition at line 86 of file RingBuffer.hpp.
◆ Dequeue() [2/2]
template<typename T , size_t S>
Dequeues from the circular buffer and writes the value to the data pointer.
- Parameters
-
buf | Buffer to contain the data |
- Returns
- int Returns 0 on success and -1 on error.
Definition at line 63 of file RingBuffer.hpp.
◆ Enqueue()
template<typename T , size_t S>
Writes a byte into the circular buffer.
- Parameters
-
val | Data to write to the buffer |
Definition at line 39 of file RingBuffer.hpp.
◆ Error()
template<typename T , size_t S>
Returns the ring buffer error code.
- Returns
- int Error code
Definition at line 172 of file RingBuffer.hpp.
◆ IsEmpty()
template<typename T , size_t S>
Query whether the circular buffer is empty.
- Returns
- true The buffer is empty
-
false The buffer is not empty
Definition at line 131 of file RingBuffer.hpp.
◆ IsFull()
template<typename T , size_t S>
Query whether the circular buffer is full.
- Returns
- true The buffer is full
-
false The buffer is not full
Definition at line 142 of file RingBuffer.hpp.
◆ Length()
template<typename T , size_t S>
Returns the number of items (bytes) in the buffer.
- Returns
- int Number of bytes available for reading.
Definition at line 152 of file RingBuffer.hpp.
◆ Peek()
template<typename T , size_t S>
Grab the latest bytes of data from the buffer without removing it.
- Parameters
-
buf | Buffer to contain the data |
- Returns
- int Returns 0 on success and -1 on error.
Definition at line 109 of file RingBuffer.hpp.
◆ data
template<typename T , size_t S>
◆ error
template<typename T , size_t S>
◆ head
template<typename T , size_t S>
◆ length
template<typename T , size_t S>
◆ tail
template<typename T , size_t S>
The documentation for this class was generated from the following file: