IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ipsdk::core::ThreadManager Class Reference

Singleton class used to manage execution threads. More...

#include <ThreadManager.h>

Inheritance diagram for ipsdk::core::ThreadManager:

Public Member Functions

bool isInit () const
 retrieve object initialization flag
 
void init (ipUInt32 nbThreads)
 initialize object with a given number of execution threads
 
ipUInt32 getNbThreads () const
 retrieve number of threads associated to manager More...
 
BoolResult addProvider (const ActionProviderPtr &pActionProvider)
 push a new action provider on back of providers collection (with respect to its priority) More...
 
bool restartProvider (const Guid &providerGuid)
 method allowing to restart provider processing (provider is registred again to provider manager) More...
 
bool removeProvider (const Guid &providerGuid)
 remove provider from providers collection More...
 
ActionProviderPtr getProvider (const Guid &providerGuid) const
 retrieve provider from providers collection More...
 
void terminate ()
 terminate all threads and clear object data
 
ProviderManagerPtr getProviderManager () const
 retrieve the provider manager
 

Static Public Member Functions

static ThreadManagergetInstance ()
 retrieve single instance of object
 

Protected Member Functions

void threadFunction (ipUInt32 threadIdx)
 thread function used for actions execution
 
void notifyCompletion (const ActionProviderPtr &pActionProvider)
 callback used for provider completion notification
 
BoolResult addProvider (const ActionProviderPtr &pActionProvider, bool bPushBack)
 insert a new action provider into providers collection (with respect to its priority) More...
 
Constructors and destructors
 ThreadManager ()
 
 ~ThreadManager ()
 

Protected Attributes

ProviderMap _providerMap
 global collection of execution providers ordered by guid
 
ProviderManagerPtr _pProviderManager
 object used to manage provider execution priority
 
ThreadColl _threadColl
 collection of threads associated to object
 
bool volatile _bTerminateRequested
 flag indicating whether termination has been requested for threads
 
boost::mutex _mutex
 mutex allowing to protect concurrent accesses to object
 
bool _bInit
 object initialization flag
 

Friends

class processor::BaseAsyncProcessor
 

Detailed Description

Singleton class used to manage execution threads.

Author
E. Noirfalise
Date
2013/12/18

Member Function Documentation

◆ getNbThreads()

ipUInt32 ipsdk::core::ThreadManager::getNbThreads ( ) const

retrieve number of threads associated to manager

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false

◆ addProvider() [1/2]

BoolResult ipsdk::core::ThreadManager::addProvider ( const ActionProviderPtr pActionProvider)

push a new action provider on back of providers collection (with respect to its priority)

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false
ipsdk::core::IPSDKCoreExceptionif pActionProvider.get() == 0
ipsdk::core::IPSDKCoreExceptionif pActionProvider->isInit() == false
Returns
false in case of failure

◆ restartProvider()

bool ipsdk::core::ThreadManager::restartProvider ( const Guid providerGuid)

method allowing to restart provider processing (provider is registred again to provider manager)

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false
Returns
false in case of failure

◆ removeProvider()

bool ipsdk::core::ThreadManager::removeProvider ( const Guid providerGuid)

remove provider from providers collection

Warning
a termination request will be emitted to provider
Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false
Returns
false if provider associated to guid has not be found

◆ getProvider()

ActionProviderPtr ipsdk::core::ThreadManager::getProvider ( const Guid providerGuid) const

retrieve provider from providers collection

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false
Returns
an empty shared pointer in case of failure

◆ addProvider() [2/2]

BoolResult ipsdk::core::ThreadManager::addProvider ( const ActionProviderPtr pActionProvider,
bool  bPushBack 
)
protected

insert a new action provider into providers collection (with respect to its priority)

Exceptions
ipsdk::core::IPSDKCoreExceptionif isInit() == false
ipsdk::core::IPSDKCoreExceptionif pActionProvider.get() == 0
ipsdk::core::IPSDKCoreExceptionif pActionProvider->isInit() == false
Returns
false in case of failure

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