CppLogging
1.0.4.0
C++ Logging Library
|
Asynchronous wait-free logging ring queue. More...
#include <async_wait_free_queue.h>
Public Member Functions | |
AsyncWaitFreeQueue (size_t capacity) | |
Default class constructor. More... | |
AsyncWaitFreeQueue (const AsyncWaitFreeQueue &)=delete | |
AsyncWaitFreeQueue (AsyncWaitFreeQueue &&)=delete | |
~AsyncWaitFreeQueue () | |
AsyncWaitFreeQueue & | operator= (const AsyncWaitFreeQueue &)=delete |
AsyncWaitFreeQueue & | operator= (AsyncWaitFreeQueue &&)=delete |
operator bool () const noexcept | |
Check if the queue is not empty. More... | |
bool | empty () const noexcept |
Is ring queue empty? More... | |
size_t | capacity () const noexcept |
Get ring queue capacity. More... | |
size_t | size () const noexcept |
Get ring queue size. More... | |
bool | Enqueue (Record &record) |
Enqueue and swap the logging record into the ring queue (multiple producers threads method) More... | |
bool | Dequeue (Record &record) |
Dequeue and swap the logging record from the ring queue (multiple consumers threads method) More... | |
Asynchronous wait-free logging ring queue.
Multiple producers / multiple consumers wait-free ring queue use only atomic operations to provide thread-safe enqueue and dequeue operations. Ring queue size is limited to the capacity provided in the constructor.
FIFO order is guaranteed!
Thread-safe.
C++ implementation of Dmitry Vyukov's non-intrusive lock free unbound MPSC queue http://www.1024cores.net/home/lock-free-algorithms/queues/non-intrusive-mpsc-node-based-queue
Definition at line 35 of file async_wait_free_queue.h.
|
inlineexplicit |
Default class constructor.
capacity | - Ring queue capacity (must be a power of two) |
Definition at line 17 of file async_wait_free_queue.inl.
|
delete |
|
delete |
|
inline |
Definition at line 45 of file async_wait_free_queue.h.
|
inlinenoexcept |
Get ring queue capacity.
Definition at line 56 of file async_wait_free_queue.h.
|
inline |
Dequeue and swap the logging record from the ring queue (multiple consumers threads method)
record | - Logging record to dequeue and swap |
Definition at line 87 of file async_wait_free_queue.inl.
|
inlinenoexcept |
Is ring queue empty?
Definition at line 54 of file async_wait_free_queue.h.
|
inline |
Enqueue and swap the logging record into the ring queue (multiple producers threads method)
record | - Logging record to enqueue and swap |
Definition at line 42 of file async_wait_free_queue.inl.
|
inlineexplicitnoexcept |
Check if the queue is not empty.
Definition at line 51 of file async_wait_free_queue.h.
|
delete |
|
delete |
|
inlinenoexcept |
Get ring queue size.
Definition at line 33 of file async_wait_free_queue.inl.