DiscordCoreAPI
A Discord bot library written in C++, with custom asynchronous coroutines.
Loading...
Searching...
No Matches
discord_core_api::discord_core_internal::ring_buffer< value_type_new, slice_count > Class Template Reference

A template implementation of a ring buffer using ring_buffer_interface. More...

#include <RingBuffer.hpp>

Inheritance diagram for discord_core_api::discord_core_internal::ring_buffer< value_type_new, slice_count >:
[legend]

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.
 

Member Function Documentation

◆ readData()

template<typename value_type_new , uint64_t slice_count>
jsonifier::string_view_base< std::unwrap_ref_decay_t< value_type > > discord_core_api::discord_core_internal::ring_buffer< value_type_new, slice_count >::readData ( )
inline
Returns
a string view containing the read data.

Definition at line 163 of file RingBuffer.hpp.

Here is the call graph for this function:

◆ writeData()

template<typename value_type_new , uint64_t slice_count>
template<typename value_type_newer >
void discord_core_api::discord_core_internal::ring_buffer< value_type_new, slice_count >::writeData ( value_type_newer *  data,
size_type  sizeNew 
)
inline
Template Parameters
value_type_newthe type of data to be written.
Parameters
datapointer to the data.
sizeNewsize of the data.

Definition at line 150 of file RingBuffer.hpp.

Here is the call graph for this function:

The documentation for this class was generated from the following file: