9 #ifndef CPPLOGGING_PROCESSORS_ASYNC_WAIT_FREE_QUEUE_H
10 #define CPPLOGGING_PROCESSORS_ASYNC_WAIT_FREE_QUEUE_H
51 explicit operator bool() const noexcept {
return !
empty(); }
54 bool empty() const noexcept {
return (
size() == 0); }
56 size_t capacity() const noexcept {
return _capacity; }
58 size_t size() const noexcept;
77 std::atomic<size_t> sequence;
81 typedef char cache_line_pad[128];
84 const size_t _capacity;
89 std::atomic<size_t> _head;
91 std::atomic<size_t> _tail;
Asynchronous wait-free logging ring queue inline implementation.
Asynchronous wait-free logging ring queue.
AsyncWaitFreeQueue & operator=(AsyncWaitFreeQueue &&)=delete
AsyncWaitFreeQueue(size_t capacity)
Default class constructor.
AsyncWaitFreeQueue(const AsyncWaitFreeQueue &)=delete
size_t size() const noexcept
Get ring queue size.
bool Enqueue(Record &record)
Enqueue and swap the logging record into the ring queue (multiple producers threads method)
bool empty() const noexcept
Is ring queue empty?
AsyncWaitFreeQueue & operator=(const AsyncWaitFreeQueue &)=delete
AsyncWaitFreeQueue(AsyncWaitFreeQueue &&)=delete
bool Dequeue(Record &record)
Dequeue and swap the logging record from the ring queue (multiple consumers threads method)
size_t capacity() const noexcept
Get ring queue capacity.
C++ Logging project definitions.
Logging record definition.