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.
 
virtual 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.
 
virtual void deactivate (WorkerObject::DeactivatingMode mode=WorkerObject::FlushSignals)
 
bool optimalWorkerCountReached () const
 
virtual void schedule ()
 The corresponding methods of all added worker objects will be called.
 
void setPriority (QThread::Priority priority)
 
virtual 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
 
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 also
ParallelAdapter for guidance how to use it.

Member Function Documentation

◆ asQObject()

virtual QObject * Digikam::ParallelWorkers::asQObject ( )
protectedpure virtual
Returns
the target QObject (double inheritance)

Implemented in Digikam::ParallelAdapter< A >.

◆ connect()

bool Digikam::ParallelWorkers::connect ( const char *  signal,
const QObject *  receiver,
const char *  method,
Qt::ConnectionType  type = Qt::AutoConnection 
) const
virtual

Reimplemented in Digikam::ParallelAdapter< A >.

◆ mocMetaObject()

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

◆ optimalWorkerCountReached()

bool Digikam::ParallelWorkers::optimalWorkerCountReached ( ) const
Returns
true if the current number of added workers has reached the optimalWorkerCount()

◆ schedule()

void Digikam::ParallelWorkers::schedule ( )
virtual

Reimplemented in Digikam::ParallelAdapter< A >.

◆ WorkerObjectQtMetacall()

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