PIVX Core  5.6.99
P2P Digital Currency
Public Types | Public Member Functions | Public Attributes | List of all members
Aggregator< T > Struct Template Reference
Inheritance diagram for Aggregator< T >:
[legend]
Collaboration diagram for Aggregator< T >:
[legend]

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 Tpointer (const T &v)
 
const Tpointer (const T *v)
 
void Start ()
 
void IncWait ()
 
void CheckDone ()
 
void Finish ()
 
void AsyncAggregateAndPushAggQueue (const std::shared_ptr< std::vector< const T * >> &vec, size_t start, size_t count, bool del)
 
void SyncAggregateAndPushAggQueue (const 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}
 
ctpl::thread_poolworkerPool
 
bool parallel
 
std::shared_ptr< std::vector< const T * > > inputVec
 
std::mutex m
 
ctpl::detail::Queue< T * > aggQueue
 
std::atomic< size_t > aggQueueSize {0}
 
DoneCallback doneCallback
 
std::atomic< size_t > waitCount {0}
 

Detailed Description

template<typename T>
struct Aggregator< T >

Definition at line 132 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 147 of file bls_worker.cpp.

◆ ElementType

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

Definition at line 133 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 155 of file bls_worker.cpp.

Member Function Documentation

◆ AsyncAggregateAndPushAggQueue()

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

Definition at line 255 of file bls_worker.cpp.

Here is the caller graph for this function:

◆ CheckDone()

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

Definition at line 218 of file bls_worker.cpp.

Here is the call graph for this function:

◆ Finish()

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

Definition at line 225 of file bls_worker.cpp.

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

◆ IncWait()

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

Definition at line 213 of file bls_worker.cpp.

Here is the caller graph for this function:

◆ pointer() [1/2]

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

Definition at line 170 of file bls_worker.cpp.

◆ pointer() [2/2]

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

Definition at line 171 of file bls_worker.cpp.

◆ PushAggQueue()

template<typename T >
void Aggregator< T >::PushAggQueue ( const T v)
inline

Definition at line 276 of file bls_worker.cpp.

Here is the call graph for this function:

◆ PushWork()

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

Definition at line 323 of file bls_worker.cpp.

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

◆ Start()

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

Definition at line 175 of file bls_worker.cpp.

Here is the call graph for this function:

◆ SyncAggregate()

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

Definition at line 313 of file bls_worker.cpp.

Here is the caller graph for this function:

◆ SyncAggregateAndPushAggQueue()

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

Definition at line 264 of file bls_worker.cpp.

Member Data Documentation

◆ aggQueue

template<typename T >
ctpl::detail::Queue<T*> Aggregator< T >::aggQueue

Definition at line 144 of file bls_worker.cpp.

◆ aggQueueSize

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

Definition at line 145 of file bls_worker.cpp.

◆ batchSize

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

Definition at line 135 of file bls_worker.cpp.

◆ doneCallback

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

Definition at line 148 of file bls_worker.cpp.

◆ inputVec

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

Definition at line 139 of file bls_worker.cpp.

◆ m

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

Definition at line 141 of file bls_worker.cpp.

◆ parallel

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

Definition at line 137 of file bls_worker.cpp.

◆ waitCount

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

Definition at line 151 of file bls_worker.cpp.

◆ workerPool

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

Definition at line 136 of file bls_worker.cpp.


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