fw4spl
fwServices::registry::ActiveWorkers Class Reference

This class to register active worker in the system, creates a default worker. More...

#include <ActiveWorkers.hpp>

+ Inheritance diagram for fwServices::registry::ActiveWorkers:
+ Collaboration diagram for fwServices::registry::ActiveWorkers:

Public Types

typedef std::string WorkerKeyType
 
typedef std::map< WorkerKeyType,::fwThread::Worker::sptr > WorkerMapType
 

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWSERVICES_API ActiveWorkers ()
 Constructor, does nothing.
 
virtual FWSERVICES_API ~ActiveWorkers ()
 Destructor, does nothing.
 
FWSERVICES_API::fwThread::Worker::sptr getWorker (const WorkerKeyType &key) const
 Get a worker registered with key, if the key does not exist a null sptr is returned. More...
 
FWSERVICES_API void addWorker (const WorkerKeyType &key,::fwThread::Worker::sptr worker)
 Registers a worker. More...
 
FWSERVICES_API void initRegistry ()
 Initializes registry, creates and registers the default worker. More...
 
FWSERVICES_API void clearRegistry ()
 Unregisters all registered workers, s_DEFAULT_WORKER also. More...
 
- Public Member Functions inherited from fwCore::BaseObject

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
static FWSERVICES_API void setDefaultWorker (::fwThread::Worker::sptr worker)
 Register the default active worker.
 
static FWSERVICES_API::fwThread::Worker::sptr getDefaultWorker ()
 Get the default registered worker. More...
 
static FWSERVICES_API ActiveWorkers::sptr getDefault ()
 Returns an instance of ActiveWorkers.
 
- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Static Public Attributes

static FWSERVICES_API const std::string s_DEFAULT_WORKER = "DEFAULT_WORKER"
 Key of default worker in registry, created and registered by initRegistry method.
 

Protected Attributes

WorkerMapType m_workers
 Association key <=> worker.
 
mutable::fwCore::mt::ReadWriteMutex m_registryMutex
 Used to protect the registry access.
 

Static Protected Attributes

static ActiveWorkers::sptr s_currentActiveWorkers
 The global instance of the active referenced workers.
 

Friends

template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Demangling methods

virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Detailed Description

This class to register active worker in the system, creates a default worker.

Definition at line 24 of file ActiveWorkers.hpp.

Member Function Documentation

void fwServices::registry::ActiveWorkers::addWorker ( const WorkerKeyType &  key,
::fwThread::Worker::sptr  worker 
)

Registers a worker.

Note
This method is thread safe.

Definition at line 72 of file ActiveWorkers.cpp.

References m_registryMutex, and m_workers.

Referenced by initRegistry().

+ Here is the caller graph for this function:

void fwServices::registry::ActiveWorkers::clearRegistry ( )

Unregisters all registered workers, s_DEFAULT_WORKER also.

Note
This method is thread safe.

Definition at line 87 of file ActiveWorkers.cpp.

References m_registryMutex, and m_workers.

fwThread::Worker::sptr fwServices::registry::ActiveWorkers::getDefaultWorker ( )
static

Get the default registered worker.

Note
This method is thread safe.

Definition at line 65 of file ActiveWorkers.cpp.

References getDefault(), and s_DEFAULT_WORKER.

Referenced by fwGui::IToolBarSrv::actionServiceSetActive(), fwGui::IMenuSrv::actionServiceSetActive(), fwGui::IToolBarSrv::actionServiceSetExecutable(), fwGui::IMenuSrv::actionServiceSetExecutable(), fwGui::IToolBarSrv::actionServiceSetVisible(), fwGui::IMenuSrv::actionServiceSetVisible(), fwGui::IToolBarSrv::actionServiceStarting(), fwGui::IMenuSrv::actionServiceStarting(), fwGui::IToolBarSrv::actionServiceStopping(), fwGui::IMenuSrv::actionServiceStopping(), fwGui::dialog::SelectorDialog::addCustomButton(), fwGui::dialog::MessageDialog::addCustomButton(), fwServices::AppConfigManager::AppConfigManager(), fwGui::dialog::SelectorDialog::create(), fwServices::registry::ServiceFactory::create(), fwGui::IMenuBarSrv::create(), fwGui::IToolBarSrv::create(), fwGui::IMenuSrv::create(), fwGui::IFrameSrv::create(), fwGui::IGuiContainerSrv::create(), fwGui::IMenuBarSrv::destroy(), fwGui::IToolBarSrv::destroy(), fwGui::IMenuSrv::destroy(), fwGui::IFrameSrv::destroy(), fwGui::IGuiContainerSrv::destroy(), fwGui::dialog::InputDialog::getInput(), fwGui::dialog::InputDialog::InputDialog(), fwGui::dialog::LocationDialog::LocationDialog(), fwGui::IMenuBarSrv::menuServiceStarting(), fwGui::IMenuBarSrv::menuServiceStopping(), fwGui::dialog::MessageDialog::MessageDialog(), fwGui::dialog::MultiSelectorDialog::MultiSelectorDialog(), fwGui::dialog::ProgressDialog::operator()(), fwGui::dialog::ProgressDialog::ProgressDialog(), fwGui::dialog::SelectorDialog::SelectorDialog(), fwGui::dialog::InputDialog::setInput(), fwGui::dialog::ProgressDialog::setMessage(), fwGui::dialog::MultiSelectorDialog::setMessage(), fwGui::dialog::MessageDialog::setMessage(), fwGui::dialog::SelectorDialog::setMessage(), fwGui::dialog::InputDialog::setMessage(), fwGui::dialog::MultiSelectorDialog::setSelections(), fwGui::dialog::SelectorDialog::setSelections(), fwGui::dialog::ProgressDialog::setTitle(), fwGui::dialog::MultiSelectorDialog::setTitle(), fwGui::dialog::SelectorDialog::setTitle(), fwGui::dialog::MessageDialog::setTitle(), fwGui::dialog::InputDialog::setTitle(), fwGui::dialog::LocationDialog::show(), fwGui::dialog::MultiSelectorDialog::show(), fwGui::dialog::PulseProgressDialog::show(), fwGui::dialog::SelectorDialog::show(), fwGui::dialog::MessageDialog::show(), fwGui::dialog::LoggerDialog::show(), and fwGdcmIO::helper::DicomSeriesDBWriter::write().

+ Here is the call graph for this function:

fwThread::Worker::sptr fwServices::registry::ActiveWorkers::getWorker ( const WorkerKeyType &  key) const

Get a worker registered with key, if the key does not exist a null sptr is returned.

Note
This method is thread safe.

Definition at line 41 of file ActiveWorkers.cpp.

References m_registryMutex, and m_workers.

void fwServices::registry::ActiveWorkers::initRegistry ( )

Initializes registry, creates and registers the default worker.

Note
This method is thread safe.

Definition at line 80 of file ActiveWorkers.cpp.

References addWorker(), and s_DEFAULT_WORKER.

+ Here is the call graph for this function:


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