6#include <blockingconcurrentqueue.h>
7#include <concurrentqueue.h>
41 using Token = std::pair<moodycamel::ProducerToken, moodycamel::ConsumerToken>;
auto get_config() const -> const auto &
Getter of the config object.
void register_report(AppReport &report)
auto size() const -> auto
Get the current size in the valid buffer queue.
std::atomic< std::size_t > n_trash_recycle_empty_failures_
std::atomic< std::size_t > n_trash_recycle_full_failures_
auto enqueue(LargeBuffer &element, Token &token) -> bool
Try to first push a buffer into the valid buffer queue and then replace it with a buffer from the tra...
std::atomic< std::size_t > n_valid_buffer_full_failures_
std::pair< moodycamel::ProducerToken, moodycamel::ConsumerToken > Token
A queue token type used for enqueue and dequeue action. The token type consists of one producer token...
moodycamel::BlockingConcurrentQueue< LargeBuffer > valid_buffer_queue_
auto capacity() const -> auto
Get the current capacity of the buffer queue.
auto get_producer_token() -> Token
Get a queue token for a producer. The first value is the producer token for the valid_buffer_queue_ a...
moodycamel::ConcurrentQueue< LargeBuffer > trash_buffer_queue_
BufferQueue(const Config &config)
Default constructor.
void dequeue(LargeBuffer &element, Token &token)
Blocking the current thread by first pushing the element to the trash buffer queue and then replacing...
void print_memory_pre_allocation()
auto get_consumer_token() -> Token
Get a queue token for a consumer. The first value is the producer token for the trash_buffer_queue_ a...
moodycamel::ProducerToken internal_trash_buffer_token_
moodycamel::ProducerToken internal_valid_buffer_token_
void enqueue_empty(std::size_t bulk_size)
Abort the blocking operation from BufferQueue::pop().
Class for buffer for storing large data.
constexpr auto LARGE_READ_MSG_BUFFER_SIZE
size of the data array for reading a UDP package
Configuration for the buffer queue class.
std::size_t buffer_size
< The size of each buffer in the buffer queue.
std::size_t reserve_size
The number of buffers to be preallocated in the trash buffer queue.
std::size_t queue_capacity
The maximum number of buffers in both buffer queues.