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

A template interface for a ring buffer. More...

#include <RingBuffer.hpp>

Inheritance diagram for discord_core_api::discord_core_internal::ring_buffer_interface< value_type_new, size >:
[legend]

Public Member Functions

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

◆ getCurrentHead()

template<typename value_type_new , uint64_t size>
pointer discord_core_api::discord_core_internal::ring_buffer_interface< value_type_new, size >::getCurrentHead ( )
inline
Returns
a pointer to the current head position.

Definition at line 99 of file RingBuffer.hpp.

◆ getCurrentTail()

template<typename value_type_new , uint64_t size>
pointer discord_core_api::discord_core_internal::ring_buffer_interface< value_type_new, size >::getCurrentTail ( )
inline
Returns
a pointer to the current tail position.

Definition at line 93 of file RingBuffer.hpp.

Here is the caller graph for this function:

◆ getUsedSpace()

template<typename value_type_new , uint64_t size>
size_type discord_core_api::discord_core_internal::ring_buffer_interface< value_type_new, size >::getUsedSpace ( )
inline
Returns
the used space in the buffer.

Definition at line 87 of file RingBuffer.hpp.

Here is the caller graph for this function:

◆ isItEmpty()

template<typename value_type_new , uint64_t size>
bool discord_core_api::discord_core_internal::ring_buffer_interface< value_type_new, size >::isItEmpty ( )
inline
Returns
true if the buffer is empty, otherwise false.

Definition at line 105 of file RingBuffer.hpp.

◆ isItFull()

template<typename value_type_new , uint64_t size>
bool discord_core_api::discord_core_internal::ring_buffer_interface< value_type_new, size >::isItFull ( )
inline
Returns
true if the buffer is full, otherwise false.

Definition at line 111 of file RingBuffer.hpp.

Here is the call graph for this function:

◆ modifyReadOrWritePosition()

template<typename value_type_new , uint64_t size>
void discord_core_api::discord_core_internal::ring_buffer_interface< value_type_new, size >::modifyReadOrWritePosition ( ring_buffer_access_type  type,
size_type  sizeNew 
)
inline
Parameters
typethe access type (read or write).
sizeNewthe size by which to modify the position.

Definition at line 77 of file RingBuffer.hpp.

Here is the caller graph for this function:

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