CatapultServer  v0.5.0.1 (Elephant)
catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange > Class Template Reference

Batches entity ranges for processing by a ConsumerDispatcher. More...

Collaboration diagram for catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >:

Classes

struct  RangeGroupKey
 
struct  RangeGroupKeyHasher
 

Public Member Functions

 BatchRangeDispatcher (ConsumerDispatcher &dispatcher)
 Creates a batch range dispatcher around dispatcher. More...
 
void queue (TAnnotatedEntityRange &&range, InputSource source)
 Queues processing of range from source. More...
 
void dispatch ()
 Dispatches all queued elements to the underlying dispatcher. More...
 
bool empty () const
 Returns true if no ranges are currently queued. More...
 

Private Types

using EntityRange = decltype(TAnnotatedEntityRange::Range)
 
using GroupedRangesMap = std::unordered_map< RangeGroupKey, std::vector< EntityRange >, RangeGroupKeyHasher >
 

Private Attributes

ConsumerDispatcherm_dispatcher
 
GroupedRangesMap m_rangesMap
 
utils::SpinLock m_lock
 

Detailed Description

template<typename TAnnotatedEntityRange>
class catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >

Batches entity ranges for processing by a ConsumerDispatcher.

Member Typedef Documentation

◆ EntityRange

template<typename TAnnotatedEntityRange >
using catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >::EntityRange = decltype(TAnnotatedEntityRange::Range)
private

◆ GroupedRangesMap

template<typename TAnnotatedEntityRange >
using catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >::GroupedRangesMap = std::unordered_map<RangeGroupKey, std::vector<EntityRange>, RangeGroupKeyHasher>
private

Constructor & Destructor Documentation

◆ BatchRangeDispatcher()

template<typename TAnnotatedEntityRange >
catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >::BatchRangeDispatcher ( ConsumerDispatcher dispatcher)
inlineexplicit

Creates a batch range dispatcher around dispatcher.

Member Function Documentation

◆ dispatch()

template<typename TAnnotatedEntityRange >
void catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >::dispatch ( )
inline

Dispatches all queued elements to the underlying dispatcher.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ empty()

template<typename TAnnotatedEntityRange >
bool catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >::empty ( ) const
inline

Returns true if no ranges are currently queued.

◆ queue()

template<typename TAnnotatedEntityRange >
void catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >::queue ( TAnnotatedEntityRange &&  range,
InputSource  source 
)
inline

Queues processing of range from source.

Member Data Documentation

◆ m_dispatcher

template<typename TAnnotatedEntityRange >
ConsumerDispatcher& catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >::m_dispatcher
private

◆ m_lock

template<typename TAnnotatedEntityRange >
utils::SpinLock catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >::m_lock
mutableprivate

◆ m_rangesMap

template<typename TAnnotatedEntityRange >
GroupedRangesMap catapult::disruptor::BatchRangeDispatcher< TAnnotatedEntityRange >::m_rangesMap
private

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