digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::ParallelWorkers Class Referenceabstract
+ Inheritance diagram for Digikam::ParallelWorkers:

Public Member Functions

 ParallelWorkers ()=default
 ParallelWorkers is a helper class to distribute work over several identical workers objects.
 
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.
 
void deactivate (WorkerObject::DeactivatingMode mode=WorkerObject::FlushSignals)
 
bool optimalWorkerCountReached () const
 Returns true if the current number of added workers has reached the optimalWorkerCount()
 
void schedule ()
 The corresponding methods of all added worker objects will be called.
 
void setPriority (QThread::Priority priority)
 
void wait ()
 

Static Public Member Functions

static int optimalWorkerCount ()
 Regarding the number of logical CPUs on the current machine, returns the optimal count of concurrent workers.
 

Protected Types

typedef void(* StaticMetacallFunction) (QObject *, QMetaObject::Call, int, void **)
 

Protected Member Functions

void add (WorkerObject *const worker)
 
virtual QObject * asQObject ()=0
 Return the target QObject (double inheritance)
 
virtual const QMetaObject * mocMetaObject () const =0
 The moc-generated metaObject of the target object.
 
const QMetaObject * replacementMetaObject () const
 
int replacementQtMetacall (QMetaObject::Call _c, int _id, void **_a)
 Replaces slot call distribution of the target QObject.
 
int replacementStaticQtMetacall (QMetaObject::Call _c, int _id, void **_a)
 
virtual StaticMetacallFunction staticMetacallPointer ()=0
 
virtual int WorkerObjectQtMetacall (QMetaObject::Call _c, int _id, void **_a)=0
 The qt_metacall of WorkerObject, one level above the target QObject.
 

Protected Attributes

int m_currentIndex = 0
 
StaticMetacallFunction m_originalStaticMetacall = nullptr
 
QMetaObject * m_replacementMetaObject = nullptr
 
QList< WorkerObject * > m_workers
 

Constructor & Destructor Documentation

◆ ParallelWorkers()

Digikam::ParallelWorkers::ParallelWorkers ( )
default

See ParallelAdapter for guidance how to use it.

Member Function Documentation

◆ asQObject()

virtual QObject * Digikam::ParallelWorkers::asQObject ( )
protectedpure virtual

◆ mocMetaObject()

virtual const QMetaObject * Digikam::ParallelWorkers::mocMetaObject ( ) const
protectedpure virtual

◆ WorkerObjectQtMetacall()

virtual int Digikam::ParallelWorkers::WorkerObjectQtMetacall ( QMetaObject::Call  _c,
int  _id,
void **  _a 
)
protectedpure virtual