![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
Queue for verifications that have to be performed. More...
#include <checkqueue.h>
Public Member Functions | |
CCheckQueue (unsigned int nBatchSizeIn) | |
void | Thread () |
bool | Wait () |
void | Add (std::vector< T > &vChecks) |
~CCheckQueue () | |
Private Member Functions | |
bool | Loop (bool fMaster=false) |
Private Attributes | |
boost::mutex | mutex |
boost::condition_variable | condWorker |
boost::condition_variable | condMaster |
std::vector< T > | queue |
int | nIdle |
int | nTotal |
bool | fAllOk |
unsigned int | nTodo |
bool | fQuit |
unsigned int | nBatchSize |
Friends | |
class | CCheckQueueControl< T > |
Queue for verifications that have to be performed.
The verifications are represented by a type T, which must provide an operator(), returning a bool.
One thread (the master) is assumed to push batches of verifications onto the queue, where they are processed by N-1 worker threads. When the master is done adding work, it temporarily joins the worker pool as an N'th worker, until all jobs are done.
Definition at line 27 of file checkqueue.h.
|
inline |
Definition at line 124 of file checkqueue.h.
|
inline |
Definition at line 151 of file checkqueue.h.
|
inline |
Definition at line 138 of file checkqueue.h.
Referenced by CCheckQueueControl< T >::Add().
|
inlineprivate |
Definition at line 63 of file checkqueue.h.
References CCheckQueue< T >::condWorker, and CCheckQueue< T >::fAllOk.
Referenced by CCheckQueue< T >::Thread(), and CCheckQueue< T >::Wait().
|
inline |
Definition at line 128 of file checkqueue.h.
References CCheckQueue< T >::Loop().
|
inline |
Definition at line 133 of file checkqueue.h.
References CCheckQueue< T >::Loop().
Referenced by CCheckQueueControl< T >::Wait().
|
friend |
Definition at line 154 of file checkqueue.h.
|
private |
Definition at line 36 of file checkqueue.h.
|
private |
Definition at line 33 of file checkqueue.h.
Referenced by CCheckQueue< T >::Loop().
|
private |
Definition at line 49 of file checkqueue.h.
Referenced by CCheckQueueControl< T >::CCheckQueueControl(), and CCheckQueue< T >::Loop().
|
private |
Definition at line 57 of file checkqueue.h.
|
private |
Definition at line 30 of file checkqueue.h.
|
private |
Definition at line 60 of file checkqueue.h.
|
private |
Definition at line 43 of file checkqueue.h.
Referenced by CCheckQueueControl< T >::CCheckQueueControl().
|
private |
Definition at line 54 of file checkqueue.h.
Referenced by CCheckQueueControl< T >::CCheckQueueControl().
|
private |
Definition at line 46 of file checkqueue.h.
Referenced by CCheckQueueControl< T >::CCheckQueueControl().
|
private |
Definition at line 40 of file checkqueue.h.