Tervel  1.0.0
A collection of wait-free containers and algorithms.
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
tervel::containers::wf::RingBuffer< T >::Value Class Reference

RingBuffer value class, values stored in the class must extend it. More...

#include <ring_buffer.h>

Inheritance diagram for tervel::containers::wf::RingBuffer< T >::Value:
TestClass< Key, Value >::WrapperType

Public Member Functions

 Value ()
 Empty constructor. More...
 

Public Attributes

friend RingBuffer
 

Private Member Functions

int64_t func_seqid ()
 Returns the items seqid. More...
 
void func_seqid (int64_t s)
 Sets the items seqid. More...
 
void atomic_change_seqid (int64_t e, int64_t n)
 Conditionally updates the seqid. More...
 

Private Attributes

int64_t seqid_ {-1}
 

Detailed Description

template<typename T>
class tervel::containers::wf::RingBuffer< T >::Value

RingBuffer value class, values stored in the class must extend it.

This class is necessary to provide the FIFO property. It adds a sequence identifier to each value stored. Using this identifier, we are apply generate FIFO valid sequential history from a concurrent history.

Constructor & Destructor Documentation

template<typename T>
tervel::containers::wf::RingBuffer< T >::Value::Value ( )
inline

Empty constructor.

Empty Constructor

Member Function Documentation

template<typename T>
void tervel::containers::wf::RingBuffer< T >::Value::atomic_change_seqid ( int64_t  e,
int64_t  n 
)
inlineprivate

Conditionally updates the seqid.

This function is used when multiple threads maybe enqueueing the same value

Parameters
eexpected seqid (address of the oprec * -1).
nnew seqid
template<typename T>
int64_t tervel::containers::wf::RingBuffer< T >::Value::func_seqid ( )
inlineprivate

Returns the items seqid.

Returns the items seqid

Returns
Returns the items seqid
template<typename T>
void tervel::containers::wf::RingBuffer< T >::Value::func_seqid ( int64_t  s)
inlineprivate

Sets the items seqid.

Sets the items seqid

Returns
Sets the items seqid

Member Data Documentation

template<typename T>
friend tervel::containers::wf::RingBuffer< T >::Value::RingBuffer
template<typename T>
int64_t tervel::containers::wf::RingBuffer< T >::Value::seqid_ {-1}
private

The documentation for this class was generated from the following file: