Template Class RingBuffer

Inheritance Relationships

Base Type

  • public Sequencer

Class Documentation

template<typename T>
class RingBuffer : public Sequencer

this RingBuffer implementation is based on the disruptor::RingBuffer but it stores the data objects in a vector

Ring based store of reusable entries containing the data representing an event being exchanged between publisher and EventProcessors.

Param <T>

implementation storing the data for sharing during exchange or parallel coordination of an event.

Public Functions

inline RingBuffer(const T &prototype, int buffer_size, disruptor::ClaimStrategyOption claim_strategy_option, disruptor::WaitStrategyOption wait_strategy_option)

Construct a RingBuffer with the full option set.

Parameters
  • prototype – of data object to store in ringbuffer

  • buffer_size – of the RingBuffer, must be a power of 2.

  • claim_strategy_option – threading strategy for publishers claiming entries in the ring.

  • wait_strategy_option – waiting strategy employed by processors_to_track waiting in entries becoming available.

inline T *Get(const int64_t &sequence)

Get the event for a given sequence in the RingBuffer.

Parameters

sequence – for the event

Returns

event pointer at the specified sequence position.