digiKam
|
Public Member Functions | |
bool | connect (const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoConnection) const |
Connects signals outbound from all workers to a given receiver. More... | |
void | deactivate (WorkerObject::DeactivatingMode mode=WorkerObject::FlushSignals) |
bool | optimalWorkerCountReached () const |
ParallelWorkers () | |
void | schedule () |
void | setPriority (QThread::Priority priority) |
void | wait () |
virtual | ~ParallelWorkers () |
Static Public Member Functions | |
static int | optimalWorkerCount () |
Protected Types | |
typedef void(* | StaticMetacallFunction) (QObject *, QMetaObject::Call, int, void **) |
Protected Member Functions | |
void | add (WorkerObject *const worker) |
virtual QObject * | asQObject ()=0 |
virtual const QMetaObject * | mocMetaObject () const =0 |
const QMetaObject * | replacementMetaObject () const |
int | replacementQtMetacall (QMetaObject::Call _c, int _id, void **_a) |
int | replacementStaticQtMetacall (QMetaObject::Call _c, int _id, void **_a) |
virtual StaticMetacallFunction | staticMetacallPointer ()=0 |
virtual int | WorkerObjectQtMetacall (QMetaObject::Call _c, int _id, void **_a)=0 |
Protected Attributes | |
int | m_currentIndex |
StaticMetacallFunction | m_originalStaticMetacall |
QMetaObject * | m_replacementMetaObject |
QList< WorkerObject * > | m_workers |
|
protected |
|
explicit |
ParallelWorkers is a helper class to distribute work over several identical workers objects. See ParallelAdapter for guidance how to use it.
|
virtual |
References m_replacementMetaObject, and m_workers.
|
protected |
References m_workers.
Referenced by Digikam::ParallelAdapter< A >::add().
|
protectedpure virtual |
Return the target QObject (double inheritance)
Implemented in Digikam::ParallelAdapter< A >, and Digikam::ParallelAdapter< Digikam::FileWorkerInterface >.
Referenced by replacementStaticQtMetacall().
bool Digikam::ParallelWorkers::connect | ( | const char * | signal, |
const QObject * | receiver, | ||
const char * | method, | ||
Qt::ConnectionType | type = Qt::AutoConnection |
||
) | const |
Connects signals outbound from all workers to a given receiver.
References m_workers.
Referenced by Digikam::ParallelAdapter< A >::connect().
void Digikam::ParallelWorkers::deactivate | ( | WorkerObject::DeactivatingMode | mode = WorkerObject::FlushSignals | ) |
References m_workers.
Referenced by Digikam::ParallelAdapter< A >::deactivate().
|
protectedpure virtual |
The moc-generated metaObject of the target object
Implemented in Digikam::ParallelAdapter< A >, and Digikam::ParallelAdapter< Digikam::FileWorkerInterface >.
Referenced by replacementMetaObject(), and replacementStaticQtMetacall().
|
static |
Regarding the number of logical CPUs on the current machine, returns the optimal count of concurrent workers
Referenced by Digikam::ItemInfoTaskSplitter::ItemInfoTaskSplitter(), and optimalWorkerCountReached().
bool Digikam::ParallelWorkers::optimalWorkerCountReached | ( | ) | const |
Returns true if the current number of added workers has reached the optimalWorkerCount()
References m_workers, and optimalWorkerCount().
|
protected |
References m_originalStaticMetacall, m_replacementMetaObject, mocMetaObject(), and staticMetacallPointer().
Referenced by Digikam::ParallelAdapter< A >::metaObject().
|
protected |
Replaces slot call distribution of the target QObject
References replacementStaticQtMetacall(), and WorkerObjectQtMetacall().
Referenced by Digikam::ParallelAdapter< A >::qt_metacall().
|
protected |
References asQObject(), m_currentIndex, m_originalStaticMetacall, m_workers, mocMetaObject(), and Digikam::WorkerObject::schedule().
Referenced by Digikam::ParallelAdapter< A >::qt_static_metacall(), and replacementQtMetacall().
void Digikam::ParallelWorkers::schedule | ( | ) |
The corresponding methods of all added worker objects will be called
References m_workers.
Referenced by Digikam::ParallelAdapter< A >::schedule().
void Digikam::ParallelWorkers::setPriority | ( | QThread::Priority | priority | ) |
References m_workers.
|
protectedpure virtual |
Implemented in Digikam::ParallelAdapter< A >, and Digikam::ParallelAdapter< Digikam::FileWorkerInterface >.
Referenced by replacementMetaObject().
void Digikam::ParallelWorkers::wait | ( | ) |
References m_workers.
Referenced by Digikam::ParallelAdapter< A >::wait().
|
protectedpure virtual |
The qt_metacall of WorkerObject, one level above the target QObject
Implemented in Digikam::ParallelAdapter< A >, and Digikam::ParallelAdapter< Digikam::FileWorkerInterface >.
Referenced by replacementQtMetacall().
|
protected |
Referenced by replacementStaticQtMetacall().
|
protected |
Referenced by replacementMetaObject(), and replacementStaticQtMetacall().
|
protected |
Referenced by replacementMetaObject(), and ~ParallelWorkers().
|
protected |
Referenced by add(), connect(), deactivate(), optimalWorkerCountReached(), replacementStaticQtMetacall(), schedule(), setPriority(), wait(), and ~ParallelWorkers().