7 #ifndef __FWSERVICES_REGISTRY_ACTIVEWORKERS_HPP__ 8 #define __FWSERVICES_REGISTRY_ACTIVEWORKERS_HPP__ 10 #include "fwServices/config.hpp" 12 #include <fwCore/mt/types.hpp> 14 #include <fwThread/Worker.hpp> 31 std::make_shared< ActiveWorkers >);
33 typedef std::string WorkerKeyType;
35 typedef std::map< WorkerKeyType, ::fwThread::Worker::sptr > WorkerMapType;
50 FWSERVICES_API ::fwThread::Worker::sptr getWorker(
const WorkerKeyType& key )
const;
53 FWSERVICES_API
static void setDefaultWorker( ::fwThread::Worker::sptr worker );
59 static FWSERVICES_API ::fwThread::Worker::sptr getDefaultWorker();
65 FWSERVICES_API
void addWorker(
const WorkerKeyType& key, ::fwThread::Worker::sptr worker );
71 FWSERVICES_API
void initRegistry();
77 FWSERVICES_API
void clearRegistry();
80 FWSERVICES_API
static ActiveWorkers::sptr getDefault();
98 #endif // __FWSERVICES_REGISTRY_ACTIVEWORKERS_HPP__ static ActiveWorkers::sptr s_currentActiveWorkers
The global instance of the active referenced workers.
Contains fwAtomsFilter::registry details.
WorkerMapType m_workers
Association key <=> worker.
Base class for all FW4SPL's classes.
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
This class to register active worker in the system, creates a default worker.
static FWSERVICES_API const std::string s_DEFAULT_WORKER
Key of default worker in registry, created and registered by initRegistry method. ...
mutable::fwCore::mt::ReadWriteMutex m_registryMutex
Used to protect the registry access.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.