digiKam Developer Documentation
Professional Photo Management with the Power of Open Source
Loading...
Searching...
No Matches
Digikam::ParallelAdapter< A > Class Template Reference
+ Inheritance diagram for Digikam::ParallelAdapter< A >:

Public Member Functions

 ParallelAdapter ()=default
 Instead of using a single WorkerObject, create a ParallelAdapter for your worker object subclass, and add() individual WorkerObjects.
 
void add (A *const worker)
 
QObject * asQObject () override
 
bool connect (const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoConnection) const override
 Connects signals outbound from all workers to a given receiver.
 
void deactivate (WorkerObject::DeactivatingMode mode=WorkerObject::FlushSignals) override
 
const QMetaObject * metaObject () const override
 
const QMetaObject * mocMetaObject () const override
 The moc-generated metaObject of the target object.
 
int qt_metacall (QMetaObject::Call _c, int _id, void **_a) override
 
void schedule () override
 The corresponding methods of all added worker objects will be called.
 
StaticMetacallFunction staticMetacallPointer () override
 
void wait () override
 
int WorkerObjectQtMetacall (QMetaObject::Call _c, int _id, void **_a) override
 The qt_metacall of WorkerObject, one level above the target QObject.
 
- Public Member Functions inherited from Digikam::ParallelWorkers
 ParallelWorkers ()=default
 ParallelWorkers is a helper class to distribute work over several identical workers objects.
 
bool optimalWorkerCountReached () const
 
void setPriority (QThread::Priority priority)
 

Static Public Member Functions

static void qt_static_metacall (QObject *o, QMetaObject::Call _c, int _id, void **_a)
 
- Static Public Member Functions inherited from Digikam::ParallelWorkers
static int optimalWorkerCount ()
 Regarding the number of logical CPUs on the current machine, returns the optimal count of concurrent workers.
 

Additional Inherited Members

- Protected Types inherited from Digikam::ParallelWorkers
typedef void(* StaticMetacallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Protected Member Functions inherited from Digikam::ParallelWorkers
void add (WorkerObject *const worker)
 
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)
 
- Protected Attributes inherited from Digikam::ParallelWorkers
int m_currentIndex = 0
 
StaticMetacallFunction m_originalStaticMetacall = nullptr
 
QMetaObject * m_replacementMetaObject = nullptr
 
QList< WorkerObject * > m_workers
 

Constructor & Destructor Documentation

◆ ParallelAdapter()

template<class A >
Digikam::ParallelAdapter< A >::ParallelAdapter ( )
default

The load will be evenly distributed.

Note
Unlike with WorkerObject directly, there is no need to call schedule(). For inbound connections (signals connected to a WorkerObject's slot, to be processed, use a Qt::DirectConnection on the adapter. For outbound connections (signals emitted from the WorkerObject), use ParallelAdapter's connect to have a connection from all added WorkerObjects.

Member Function Documentation

◆ asQObject()

template<class A >
QObject * Digikam::ParallelAdapter< A >::asQObject ( )
inlineoverridevirtual
Returns
the target QObject (double inheritance)

Implements Digikam::ParallelWorkers.

◆ connect()

template<class A >
bool Digikam::ParallelAdapter< A >::connect ( const char *  signal,
const QObject *  receiver,
const char *  method,
Qt::ConnectionType  type = Qt::AutoConnection 
) const
inlineoverridevirtual

Reimplemented from Digikam::ParallelWorkers.

◆ deactivate()

template<class A >
void Digikam::ParallelAdapter< A >::deactivate ( WorkerObject::DeactivatingMode  mode = WorkerObject::FlushSignals)
inlineoverridevirtual

Reimplemented from Digikam::ParallelWorkers.

◆ mocMetaObject()

template<class A >
const QMetaObject * Digikam::ParallelAdapter< A >::mocMetaObject ( ) const
inlineoverridevirtual

◆ schedule()

template<class A >
void Digikam::ParallelAdapter< A >::schedule ( )
inlineoverridevirtual

Reimplemented from Digikam::ParallelWorkers.

◆ staticMetacallPointer()

template<class A >
StaticMetacallFunction Digikam::ParallelAdapter< A >::staticMetacallPointer ( )
inlineoverridevirtual

◆ wait()

template<class A >
void Digikam::ParallelAdapter< A >::wait ( )
inlineoverridevirtual

Reimplemented from Digikam::ParallelWorkers.

◆ WorkerObjectQtMetacall()

template<class A >
int Digikam::ParallelAdapter< A >::WorkerObjectQtMetacall ( QMetaObject::Call  _c,
int  _id,
void **  _a 
)
inlineoverridevirtual