Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
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 > | |
T | 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_pool & | workerPool |
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
typedef std::function<void(const T& agg)> Aggregator< T >::DoneCallback |
Definition at line 148 of file bls_worker.cpp.
◆ ElementType
typedef T Aggregator< T >::ElementType |
Definition at line 131 of file bls_worker.cpp.
Constructor & Destructor Documentation
◆ Aggregator()
|
inline |
Definition at line 153 of file bls_worker.cpp.
References count, Aggregator< T >::inputVec, and Aggregator< T >::pointer().
Member Function Documentation
◆ AsyncAggregateAndPushAggQueue()
|
inline |
Definition at line 256 of file bls_worker.cpp.
References count, Aggregator< T >::IncWait(), Aggregator< T >::PushWork(), and Aggregator< T >::SyncAggregateAndPushAggQueue().
Referenced by Aggregator< T >::PushAggQueue(), and Aggregator< T >::Start().
◆ CheckDone()
|
inline |
Definition at line 217 of file bls_worker.cpp.
References Aggregator< T >::Finish(), and Aggregator< T >::waitCount.
Referenced by Aggregator< T >::Start(), and Aggregator< T >::SyncAggregateAndPushAggQueue().
◆ Finish()
|
inline |
Definition at line 224 of file bls_worker.cpp.
References Aggregator< T >::aggQueue, Aggregator< T >::aggQueueSize, Aggregator< T >::doneCallback, and Aggregator< T >::SyncAggregate().
Referenced by Aggregator< T >::CheckDone().
◆ IncWait()
|
inline |
Definition at line 212 of file bls_worker.cpp.
References Aggregator< T >::waitCount.
Referenced by Aggregator< T >::AsyncAggregateAndPushAggQueue(), and Aggregator< T >::Start().
◆ pointer() [1/2]
|
inline |
Definition at line 169 of file bls_worker.cpp.
Referenced by Aggregator< T >::Aggregator().
◆ pointer() [2/2]
|
inline |
Definition at line 170 of file bls_worker.cpp.
◆ PushAggQueue()
|
inline |
Definition at line 274 of file bls_worker.cpp.
References Aggregator< T >::aggQueue, Aggregator< T >::aggQueueSize, Aggregator< T >::AsyncAggregateAndPushAggQueue(), Aggregator< T >::batchSize, and Aggregator< T >::m.
Referenced by Aggregator< T >::SyncAggregateAndPushAggQueue().
◆ PushWork()
|
inline |
Definition at line 315 of file bls_worker.cpp.
References ctpl::thread_pool::push(), and Aggregator< T >::workerPool.
Referenced by Aggregator< T >::AsyncAggregateAndPushAggQueue(), and Aggregator< T >::Start().
◆ Start()
|
inline |
Definition at line 174 of file bls_worker.cpp.
References Aggregator< T >::AsyncAggregateAndPushAggQueue(), Aggregator< T >::batchSize, Aggregator< T >::CheckDone(), count, Aggregator< T >::doneCallback, Aggregator< T >::IncWait(), Aggregator< T >::inputVec, Aggregator< T >::parallel, Aggregator< T >::PushWork(), and Aggregator< T >::SyncAggregate().
Referenced by ContributionVerifier::AsyncAggregate(), and AsyncAggregateHelper().
◆ SyncAggregate()
|
inline |
Definition at line 305 of file bls_worker.cpp.
References count.
Referenced by Aggregator< T >::Finish(), Aggregator< T >::Start(), and Aggregator< T >::SyncAggregateAndPushAggQueue().
◆ SyncAggregateAndPushAggQueue()
|
inline |
Definition at line 262 of file bls_worker.cpp.
References Aggregator< T >::CheckDone(), count, Aggregator< T >::PushAggQueue(), and Aggregator< T >::SyncAggregate().
Referenced by Aggregator< T >::AsyncAggregateAndPushAggQueue().
Member Data Documentation
◆ aggQueue
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
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
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
DoneCallback Aggregator< T >::doneCallback |
Definition at line 149 of file bls_worker.cpp.
Referenced by Aggregator< T >::Finish(), and Aggregator< T >::Start().
◆ inputVec
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
std::mutex Aggregator< T >::m |
Definition at line 139 of file bls_worker.cpp.
Referenced by Aggregator< T >::PushAggQueue().
◆ parallel
bool Aggregator< T >::parallel |
Definition at line 136 of file bls_worker.cpp.
Referenced by Aggregator< T >::Start().
◆ waitCount
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
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:
- src/bls/bls_worker.cpp