Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

Aggregator< T > Struct Template Reference
+ Collaboration diagram for Aggregator< T >:

Public Types

typedef T ElementType
 
typedef std::function< void(const T &agg)> DoneCallback
 

Public Member Functions

template<typename TP >
 Aggregator (const std::vector< TP > &_inputVec, size_t start, size_t count, bool _parallel, ctpl::thread_pool &_workerPool, DoneCallback _doneCallback)
 
const T * pointer (const T &v)
 
const T * pointer (const T *v)
 
void Start ()
 
void IncWait ()
 
void CheckDone ()
 
void Finish ()
 
void AsyncAggregateAndPushAggQueue (std::shared_ptr< std::vector< const T *> > &vec, size_t start, size_t count, bool del)
 
void SyncAggregateAndPushAggQueue (std::shared_ptr< std::vector< const T *> > &vec, size_t start, size_t count, bool del)
 
void PushAggQueue (const T &v)
 
template<typename TP >
SyncAggregate (const std::vector< TP > &vec, size_t start, size_t count)
 
template<typename Callable >
void PushWork (Callable &&f)
 

Public Attributes

size_t batchSize {16}
 
std::shared_ptr< std::vector< const T * > > inputVec
 
bool parallel
 
ctpl::thread_poolworkerPool
 
std::mutex m
 
boost::lockfree::queue< T * > aggQueue
 
std::atomic< size_t > aggQueueSize {0}
 
std::atomic< size_t > waitCount {0}
 
DoneCallback doneCallback
 

Detailed Description

template<typename T>
struct Aggregator< T >

Definition at line 130 of file bls_worker.cpp.

Member Typedef Documentation

◆ DoneCallback

template<typename T>
typedef std::function<void(const T& agg)> Aggregator< T >::DoneCallback

Definition at line 148 of file bls_worker.cpp.

◆ ElementType

template<typename T>
typedef T Aggregator< T >::ElementType

Definition at line 131 of file bls_worker.cpp.

Constructor & Destructor Documentation

◆ Aggregator()

template<typename T>
template<typename TP >
Aggregator< T >::Aggregator ( const std::vector< TP > &  _inputVec,
size_t  start,
size_t  count,
bool  _parallel,
ctpl::thread_pool _workerPool,
DoneCallback  _doneCallback 
)
inline

Definition at line 153 of file bls_worker.cpp.

References count, Aggregator< T >::inputVec, and Aggregator< T >::pointer().

Member Function Documentation

◆ AsyncAggregateAndPushAggQueue()

template<typename T>
void Aggregator< T >::AsyncAggregateAndPushAggQueue ( std::shared_ptr< std::vector< const T *> > &  vec,
size_t  start,
size_t  count,
bool  del 
)
inline

◆ CheckDone()

template<typename T>
void Aggregator< T >::CheckDone ( )
inline

◆ Finish()

template<typename T>
void Aggregator< T >::Finish ( )
inline

◆ IncWait()

template<typename T>
void Aggregator< T >::IncWait ( )
inline

◆ pointer() [1/2]

template<typename T>
const T* Aggregator< T >::pointer ( const T &  v)
inline

Definition at line 169 of file bls_worker.cpp.

Referenced by Aggregator< T >::Aggregator().

◆ pointer() [2/2]

template<typename T>
const T* Aggregator< T >::pointer ( const T *  v)
inline

Definition at line 170 of file bls_worker.cpp.

◆ PushAggQueue()

◆ PushWork()

template<typename T>
template<typename Callable >
void Aggregator< T >::PushWork ( Callable &&  f)
inline

◆ Start()

◆ SyncAggregate()

template<typename T>
template<typename TP >
T Aggregator< T >::SyncAggregate ( const std::vector< TP > &  vec,
size_t  start,
size_t  count 
)
inline

◆ SyncAggregateAndPushAggQueue()

template<typename T>
void Aggregator< T >::SyncAggregateAndPushAggQueue ( std::shared_ptr< std::vector< const T *> > &  vec,
size_t  start,
size_t  count,
bool  del 
)
inline

Member Data Documentation

◆ aggQueue

template<typename T>
boost::lockfree::queue<T*> Aggregator< T >::aggQueue

Definition at line 142 of file bls_worker.cpp.

Referenced by Aggregator< T >::Finish(), and Aggregator< T >::PushAggQueue().

◆ aggQueueSize

template<typename T>
std::atomic<size_t> Aggregator< T >::aggQueueSize {0}

Definition at line 143 of file bls_worker.cpp.

Referenced by Aggregator< T >::Finish(), and Aggregator< T >::PushAggQueue().

◆ batchSize

template<typename T>
size_t Aggregator< T >::batchSize {16}

Definition at line 133 of file bls_worker.cpp.

Referenced by Aggregator< T >::PushAggQueue(), and Aggregator< T >::Start().

◆ doneCallback

template<typename T>
DoneCallback Aggregator< T >::doneCallback

Definition at line 149 of file bls_worker.cpp.

Referenced by Aggregator< T >::Finish(), and Aggregator< T >::Start().

◆ inputVec

template<typename T>
std::shared_ptr<std::vector<const T*> > Aggregator< T >::inputVec

Definition at line 134 of file bls_worker.cpp.

Referenced by Aggregator< T >::Aggregator(), and Aggregator< T >::Start().

◆ m

template<typename T>
std::mutex Aggregator< T >::m

Definition at line 139 of file bls_worker.cpp.

Referenced by Aggregator< T >::PushAggQueue().

◆ parallel

template<typename T>
bool Aggregator< T >::parallel

Definition at line 136 of file bls_worker.cpp.

Referenced by Aggregator< T >::Start().

◆ waitCount

template<typename T>
std::atomic<size_t> Aggregator< T >::waitCount {0}

Definition at line 146 of file bls_worker.cpp.

Referenced by Aggregator< T >::CheckDone(), and Aggregator< T >::IncWait().

◆ workerPool

template<typename T>
ctpl::thread_pool& Aggregator< T >::workerPool

Definition at line 137 of file bls_worker.cpp.

Referenced by Aggregator< T >::PushWork().


The documentation for this struct was generated from the following file:
Released under the MIT license