join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::Spsc< Type, Backend > Struct Template Reference

single producer single consumer ring buffer. More...

#include <queue.hpp>

Public Types

using Queue = BasicQueue<Type, Backend, Spsc>
 

Static Public Member Functions

static int tryPush (QueueSegment< Type > *segment, const Type &element) noexcept
 try to push element into the ring buffer.
 
static int tryPop (QueueSegment< Type > *segment, Type &element) noexcept
 try to pop element from the ring buffer.
 

Detailed Description

template<typename Type, typename Backend>
struct join::Spsc< Type, Backend >

single producer single consumer ring buffer.

Member Typedef Documentation

◆ Queue

template<typename Type , typename Backend >
using join::Spsc< Type, Backend >::Queue = BasicQueue<Type, Backend, Spsc>

Member Function Documentation

◆ tryPop()

template<typename Type , typename Backend >
static int join::Spsc< Type, Backend >::tryPop ( QueueSegment< Type > * segment,
Type & element )
inlinestaticnoexcept

try to pop element from the ring buffer.

Parameters
segmentshared memory segment.
elementoutput element.
Returns
0 on success, -1 otherwise.

◆ tryPush()

template<typename Type , typename Backend >
static int join::Spsc< Type, Backend >::tryPush ( QueueSegment< Type > * segment,
const Type & element )
inlinestaticnoexcept

try to push element into the ring buffer.

Parameters
segmentshared memory segment.
elementelement to push.
Returns
0 on success, -1 otherwise.

The documentation for this struct was generated from the following files: