|
join 1.0
lightweight network framework library
|
queue base class. More...
#include <queue.hpp>
Public Types | |
| using | ValueType = Type |
Public Member Functions | |
| template<typename... Args> | |
| BasicQueue (uint64_t capacity, Args &&... args) | |
| create instance. | |
| BasicQueue (const BasicQueue &other)=delete | |
| copy constructor. | |
| BasicQueue & | operator= (const BasicQueue &other)=delete |
| copy assignment operator. | |
| BasicQueue (BasicQueue &&other)=delete | |
| move constructor. | |
| BasicQueue & | operator= (BasicQueue &&other)=delete |
| move assignment operator. | |
| ~BasicQueue () noexcept=default | |
| destroy queue instance. | |
| int | tryPush (const Type &element) noexcept |
| try to push element into ring buffer. | |
| int | push (const Type &element) noexcept |
| push element into the ring buffer. | |
| int | tryPop (Type &element) noexcept |
| try to pop element from the ring buffer. | |
| int | pop (Type &element) noexcept |
| pop element from the ring buffer. | |
| uint64_t | pending () const noexcept |
| get the number of pending elements for reading. | |
| uint64_t | available () const noexcept |
| get the number of available slots for writing. | |
| bool | full () const noexcept |
| check if the ring buffer is full. | |
| bool | empty () const noexcept |
| check if the ring buffer is empty. | |
| int | mbind (int numa) const noexcept |
| bind memory to a NUMA node. | |
| int | mlock () const noexcept |
| lock memory in RAM. | |
Static Protected Member Functions | |
| static uint64_t | roundPow2 (uint64_t v) noexcept |
| round up to next power of 2. | |
Protected Attributes | |
| uint64_t | _capacity = 0 |
| memory segment capacity. | |
| uint64_t | _elementSize = 0 |
| memory segment element size. | |
| uint64_t | _totalSize = 0 |
| total memory size. | |
| Backend | _backend |
| memory segment backend. | |
| SyncPolicy | _policy |
| memory segment sync policy. | |
| QueueSegment< Type > * | _segment = nullptr |
| shared memory segment. | |
queue base class.
| using join::BasicQueue< Type, Backend, SyncPolicy >::ValueType = Type |
|
inline |
create instance.
| capacity | queue capacity. |
| args | backend args. |
|
delete |
copy constructor.
| other | other object to copy. |
|
delete |
move constructor.
| other | other object to move. |
|
defaultnoexcept |
destroy queue instance.
|
inlinenoexcept |
get the number of available slots for writing.
|
inlinenoexcept |
check if the ring buffer is empty.
|
inlinenoexcept |
check if the ring buffer is full.
|
inlinenoexcept |
bind memory to a NUMA node.
| numa | NUMA node ID. |
|
inlinenoexcept |
lock memory in RAM.
|
delete |
move assignment operator.
| other | other object to move. |
|
delete |
copy assignment operator.
| other | other object to copy. |
|
inlinenoexcept |
get the number of pending elements for reading.
|
inlinenoexcept |
pop element from the ring buffer.
| element | output element. |
|
inlinenoexcept |
push element into the ring buffer.
| element | element to push. |
|
inlinestaticprotectednoexcept |
round up to next power of 2.
| v | input value. |
|
inlinenoexcept |
try to pop element from the ring buffer.
| element | output element. |
|
inlinenoexcept |
try to push element into ring buffer.
| element | element to push. |
|
protected |
memory segment backend.
|
protected |
memory segment capacity.
|
protected |
memory segment element size.
|
protected |
memory segment sync policy.
|
protected |
shared memory segment.
|
protected |
total memory size.