DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
|
A template implementation of a ring buffer using ring_buffer_interface. More...
#include <RingBuffer.hpp>
Public Member Functions | |
jsonifier::string_view_base< std::unwrap_ref_decay_t< value_type > > | readData () |
Read data from the buffer. More... | |
ring_buffer () noexcept=default | |
Default constructor. initializes the buffer size. | |
template<typename value_type_newer > | |
void | writeData (value_type_newer *data, size_type sizeNew) |
Write data into the buffer. More... | |
Public Member Functions inherited from discord_core_api::discord_core_internal::ring_buffer_interface< ring_buffer_interface< std::unwrap_ref_decay_t< value_type_new >, 1024 *16 >, slice_count > | |
void | clear () |
Clear the buffer by resetting positions. | |
pointer | getCurrentHead () |
Get a pointer to the current head position. More... | |
pointer | getCurrentTail () |
Get a pointer to the current tail position. More... | |
size_type | getUsedSpace () |
Get the used space in the buffer. More... | |
bool | isItEmpty () |
Check if the buffer is empty. More... | |
bool | isItFull () |
Check if the buffer is full. More... | |
void | modifyReadOrWritePosition (ring_buffer_access_type type, size_type sizeNew) |
Modify the read or write position of the buffer. More... | |
ring_buffer_interface () | |
Constructor. initializes the buffer size. | |
|
inline |
Definition at line 163 of file RingBuffer.hpp.
|
inline |
value_type_new | the type of data to be written. |
data | pointer to the data. |
sizeNew | size of the data. |
Definition at line 150 of file RingBuffer.hpp.