gatb.core-API-0.0.0
IThreadFactory Class Referenceabstract

Factory that creates IThread instances. More...

#include <IThread.hpp>

Inheritance diagram for IThreadFactory:
Inheritance graph

Public Member Functions

virtual IThreadnewThread (void *(*mainloop)(void *), void *data)=0
 
virtual ISynchronizernewSynchronizer (void)=0
 
virtual IThread::Id getThreadSelf ()=0
 
virtual u_int64_t getProcess ()=0
 
virtual ~IThreadFactory ()
 

Detailed Description

Factory that creates IThread instances.

Thread creation needs merely the main loop function that will be called.

Note the method that can return the number of cores in case a multi-cores architecture is used. This is useful for automatically configure tools for using the maximum number of available cores for speeding up the algorithm.

Constructor & Destructor Documentation

virtual ~IThreadFactory ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual u_int64_t getProcess ( )
pure virtual

Return the id of the current process.

Implemented in ThreadFactoryLinux, and ThreadFactoryMacos.

virtual IThread::Id getThreadSelf ( )
pure virtual

Return the id of the calling thread.

Implemented in ThreadFactoryLinux, and ThreadFactoryMacos.

virtual ISynchronizer* newSynchronizer ( void  )
pure virtual

Creates a new synchronization object.

Returns
the created ISynchronizer instance

Implemented in ThreadFactoryLinux, and ThreadFactoryMacos.

virtual IThread* newThread ( void *(*)(void *)  mainloop,
void *  data 
)
pure virtual

Creates a new thread.

Parameters
[in]mainloop: the function the thread shall execute
[in]data: data provided to the mainloop when launched
Returns
the created thread.

Implemented in ThreadFactoryLinux, and ThreadFactoryMacos.


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