|
join 1.0
lightweight network framework library
|
single producer single consumer ring buffer policy. More...
#include <shared.hpp>

Public Types | |
| using | Producer = BasicProducer <Spsc> |
| using | Consumer = BasicConsumer <Spsc> |
| using | Endpoint = BasicEndpoint <Spsc, Spsc> |
Public Member Functions | |
| constexpr | Spsc () noexcept=default |
| construct the single producer single consumer ring buffer policy by default. | |
| virtual int | tryPush (SharedSegment *segment, const void *element) const noexcept |
| try to push element into the ring buffer. | |
| int | push (SharedSegment *segment, const void *element) const noexcept |
| push element into the ring buffer. | |
| template<class Rep , class Period > | |
| int | timedPush (SharedSegment *segment, const void *element, std::chrono::duration< Rep, Period > timeout) const noexcept |
| try to push element into the ring buffer until timeout expire. | |
| virtual int | tryPop (SharedSegment *segment, void *element) const noexcept |
| try to pop element from the ring buffer. | |
| int | pop (SharedSegment *segment, void *element) const noexcept |
| pop element from the ring buffer. | |
| template<class Rep , class Period > | |
| int | timedPop (SharedSegment *segment, void *element, std::chrono::duration< Rep, Period > timeout) const noexcept |
| try to pop element from the ring buffer until timeout expire. | |
| uint64_t | pending (SharedSegment *segment) const noexcept |
| get the number of pending elements for reading. | |
| uint64_t | available (SharedSegment *segment) const noexcept |
| get the number of available slots for writing. | |
| bool | full (SharedSegment *segment) const noexcept |
| check if the ring buffer is full. | |
| bool | empty (SharedSegment *segment) const noexcept |
| check if the ring buffer is empty. | |
single producer single consumer ring buffer policy.
| using join::Spsc::Consumer = BasicConsumer <Spsc> |
| using join::Spsc::Endpoint = BasicEndpoint <Spsc, Spsc> |
| using join::Spsc::Producer = BasicProducer <Spsc> |
|
constexprdefaultnoexcept |
construct the single producer single consumer ring buffer policy by default.
|
inlinenoexcept |
get the number of available slots for writing.
| segment | shared memory segment. |
|
inlinenoexcept |
check if the ring buffer is empty.
| segment | shared memory segment. |
|
inlinenoexcept |
check if the ring buffer is full.
| segment | shared memory segment. |
|
inlinenoexcept |
get the number of pending elements for reading.
| segment | shared memory segment. |
|
inlinenoexcept |
pop element from the ring buffer.
| segment | shared memory segment. |
| element | pointer to output element. |
|
inlinenoexcept |
push element into the ring buffer.
| segment | shared memory segment. |
| element | pointer to element to push. |
|
inlinenoexcept |
try to pop element from the ring buffer until timeout expire.
| segment | shared memory segment. |
| element | pointer to output element. |
| timeout | timeout. |
|
inlinenoexcept |
try to push element into the ring buffer until timeout expire.
| segment | shared memory segment. |
| element | pointer to element to push. |
| timeout | timeout. |
|
inlinevirtualnoexcept |
try to pop element from the ring buffer.
| segment | shared memory segment. |
| element | pointer to output element. |
Reimplemented in join::Mpmc.
|
inlinevirtualnoexcept |
try to push element into the ring buffer.
| segment | shared memory segment. |
| element | pointer to element to push. |
Reimplemented in join::Mpsc.