digiKam
Digikam::ParallelAdapter< A > Class Template Reference
+ Inheritance diagram for Digikam::ParallelAdapter< A >:

Public Member Functions

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
 
void deactivate (WorkerObject::DeactivatingMode mode=WorkerObject::FlushSignals)
 
const QMetaObject * metaObject () const override
 
const QMetaObject * mocMetaObject () const override
 
bool optimalWorkerCountReached () const
 
 ParallelAdapter ()
 
int qt_metacall (QMetaObject::Call _c, int _id, void **_a) override
 
void schedule ()
 
void setPriority (QThread::Priority priority)
 
StaticMetacallFunction staticMetacallPointer () override
 
void wait ()
 
int WorkerObjectQtMetacall (QMetaObject::Call _c, int _id, void **_a) override
 
 ~ParallelAdapter () override
 

Static Public Member Functions

static int optimalWorkerCount ()
 
static void qt_static_metacall (QObject *o, QMetaObject::Call _c, int _id, void **_a)
 

Protected Types

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

Protected Member Functions

void add (WorkerObject *const worker)
 
const QMetaObject * replacementMetaObject () const
 
int replacementQtMetacall (QMetaObject::Call _c, int _id, void **_a)
 
int replacementStaticQtMetacall (QMetaObject::Call _c, int _id, void **_a)
 

Protected Attributes

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

Member Typedef Documentation

◆ StaticMetacallFunction

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

Constructor & Destructor Documentation

◆ ParallelAdapter()

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

Instead of using a single WorkerObject, create a ParallelAdapter for your worker object subclass, and add() individual WorkerObjects. 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.

◆ ~ParallelAdapter()

template<class A >
Digikam::ParallelAdapter< A >::~ParallelAdapter ( )
inlineoverride

Member Function Documentation

◆ add() [1/2]

template<class A >
void Digikam::ParallelAdapter< A >::add ( A *const  worker)
inline

◆ add() [2/2]

void Digikam::ParallelWorkers::add ( WorkerObject *const  worker)
protectedinherited

◆ asQObject()

template<class A >
QObject* Digikam::ParallelAdapter< A >::asQObject ( )
inlineoverridevirtual

Return 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
inline

◆ deactivate()

◆ metaObject()

template<class A >
const QMetaObject* Digikam::ParallelAdapter< A >::metaObject ( ) const
inlineoverride

◆ mocMetaObject()

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

The moc-generated metaObject of the target object

Implements Digikam::ParallelWorkers.

◆ optimalWorkerCount()

int Digikam::ParallelWorkers::optimalWorkerCount ( )
staticinherited

Regarding the number of logical CPUs on the current machine, returns the optimal count of concurrent workers

Referenced by Digikam::ItemInfoTaskSplitter::ItemInfoTaskSplitter(), and Digikam::ParallelWorkers::optimalWorkerCountReached().

◆ optimalWorkerCountReached()

bool Digikam::ParallelWorkers::optimalWorkerCountReached ( ) const
inherited

Returns true if the current number of added workers has reached the optimalWorkerCount()

References Digikam::ParallelWorkers::m_workers, and Digikam::ParallelWorkers::optimalWorkerCount().

◆ qt_metacall()

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

◆ qt_static_metacall()

template<class A >
static void Digikam::ParallelAdapter< A >::qt_static_metacall ( QObject *  o,
QMetaObject::Call  _c,
int  _id,
void **  _a 
)
inlinestatic

◆ replacementMetaObject()

◆ replacementQtMetacall()

int Digikam::ParallelWorkers::replacementQtMetacall ( QMetaObject::Call  _c,
int  _id,
void **  _a 
)
protectedinherited

◆ replacementStaticQtMetacall()

◆ schedule()

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

◆ setPriority()

void Digikam::ParallelWorkers::setPriority ( QThread::Priority  priority)
inherited

◆ staticMetacallPointer()

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

◆ wait()

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

◆ WorkerObjectQtMetacall()

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

The qt_metacall of WorkerObject, one level above the target QObject

Implements Digikam::ParallelWorkers.

Member Data Documentation

◆ m_currentIndex

int Digikam::ParallelWorkers::m_currentIndex
protectedinherited

◆ m_originalStaticMetacall

StaticMetacallFunction Digikam::ParallelWorkers::m_originalStaticMetacall
protectedinherited

◆ m_replacementMetaObject

QMetaObject* Digikam::ParallelWorkers::m_replacementMetaObject
protectedinherited

◆ m_workers


The documentation for this class was generated from the following file: