fw4spl
fwServices::AppConfigManager Class Reference

This class provides an API to manage config template. More...

#include <AppConfigManager.hpp>

+ Inheritance diagram for fwServices::AppConfigManager:
+ Collaboration diagram for fwServices::AppConfigManager:

Public Member Functions

virtual bool isA (const std::string &type) const override
 
FWSERVICES_API AppConfigManager ()
 Constructor. Do nothing.
 
virtual FWSERVICES_API ~AppConfigManager ()
 Destructor. Do nothing.
 
virtual FWSERVICES_API void startBundle ()
 Starts the bundle associated to the config. More...
 
FWSERVICES_API void setIsUnitTest (bool isUnitTest)
 Set it to true if we are testing the class.
 
Overrides
virtual FWSERVICES_API void setConfig (const std::string &configId, const FieldAdaptorType &replaceFields=FieldAdaptorType()) override
 Set configuration. More...
 
virtual FWSERVICES_API void setConfig (const std::string &configId, const ::fwData::Composite::csptr &replaceFields) override
 Set configuration. More...
 
virtual FWSERVICES_API::fwData::Object::sptr getConfigRoot () const override
 Get config root.
 
virtual FWSERVICES_API void launch () override
 Calls methods : create, start then update.
 
virtual FWSERVICES_API void stopAndDestroy () override
 Stops and destroys services specified in config, then resets the configRoot sptr.
 
virtual FWSERVICES_API void create () override
 Creates objects and services from config.
 
virtual FWSERVICES_API void start () override
 Starts services specified in config.
 
virtual FWSERVICES_API void update () override
 Updates services specified in config.
 
virtual FWSERVICES_API void stop () override
 Stops services specified in config.
 
virtual FWSERVICES_API void destroy () override
 Destroys services specified in config.
 
- Public Member Functions inherited from fwServices::IAppConfigManager
FWSERVICES_API IAppConfigManager ()
 Constructor. Do nothing.
 
virtual FWSERVICES_API ~IAppConfigManager ()
 Destructor. Do nothing.
 
bool isCreated () const
 Return state.
 
bool isStarted () const
 
bool isStopped () const
 
bool isDestroyed () const
 
void setConfig (::fwRuntime::ConfigurationElement::csptr cfgElem)
 Set config param.
 
- Public Member Functions inherited from fwTools::Object
- Public Member Functions inherited from fwCore::BaseObject
- Public Member Functions inherited from fwCom::HasSlots
std::shared_ptr< SlotBaseslot (const Slots::SlotKeyType &key) const
 
template<typename SlotType >
std::shared_ptr< SlotType > slot (const Slots::SlotKeyType &key) const
 
template<typename F , typename A >
std::shared_ptr< Slot< typename::fwCom::util::convert_function_type< F >::type > > newSlot (const Slots::SlotKeyType &key, F f, A a)
 

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwServices::IAppConfigManager
static bool isTypeOf (const std::string &type)
 
static FWSERVICES_API std::shared_ptr< IAppConfigManagerNew ()
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- Static Public Member Functions inherited from fwTools::Object
static bool isTypeOf (const std::string &type)
 
static const std::string & classname ()
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
- 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
 

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
 

Additional Inherited Members

- Public Types inherited from fwServices::IAppConfigManager
typedef registry::FieldAdaptorType FieldAdaptorType
 
- Public Types inherited from fwCom::HasSlots
typedef std::shared_ptr< HasSlotssptr
 
typedef std::shared_ptr< const HasSlotscsptr
 
- Protected Types inherited from fwServices::IAppConfigManager
enum  ConfigState { STATE_CREATED, STATE_STARTED, STATE_STOPPED, STATE_DESTROYED }
 
- Protected Types inherited from fwTools::fwID
enum  Policy { EMPTY = 1, GENERATE, MUST_EXIST }
 
typedef std::string IDType
 
- Protected Member Functions inherited from fwTools::fwID
FWTOOLS_API bool hasID () const
 Return true if the object has an id set. More...
 
FWTOOLS_API IDType getID (Policy policy=GENERATE) const
 Returns the id of the object. If it is not set and the policy value is. More...
 
virtual FWTOOLS_API void setID (IDType newID)
 Set a newID for the object, (newID must not exist in fwID), the oldest one is released. More...
 
FWTOOLS_API void resetID ()
 Release the id for the object. More...
 
 fwID ()
 Constructor : does nothing.
 
- Protected Member Functions inherited from fwCom::HasSlots
 HasSlots (const HasSlots &)
 Copy constructor forbidden.
 
HasSlotsoperator= (const HasSlots &)
 Copy operator forbidden.
 
- Static Protected Member Functions inherited from fwTools::fwID
static bool isTypeOf (const std::string &type)
 
static FWTOOLS_API bool exist (IDType _id)
 
static FWTOOLS_API std::shared_ptr< ::fwTools::ObjectgetObject (IDType requestID)
 Retrieve the object attached to the given id. Return a null sptr if no correspondence exist. More...
 
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
 
- Protected Attributes inherited from fwServices::IAppConfigManager
::fwRuntime::ConfigurationElement::csptr m_cfgElem
 XML Configuration tree.
 
ConfigState m_state
 Running state of the app config manager.
 
- Protected Attributes inherited from fwTools::Object
std::shared_ptr< ::fwTools::UUIDm_uuid
 UUID used to identify the object, notably for serialization.
 
- Protected Attributes inherited from fwCom::HasSlots
Slots m_slots
 

Detailed Description

This class provides an API to manage config template.

Definition at line 35 of file AppConfigManager.hpp.

Member Function Documentation

void fwServices::AppConfigManager::setConfig ( const std::string &  configId,
const FieldAdaptorType &  replaceFields = FieldAdaptorType() 
)
overridevirtual

Set configuration.

Parameters
configIdthe identifier of the requested config.
replaceFieldsthe associations between the value and the pattern to replace in the config.

Implements fwServices::IAppConfigManager.

Definition at line 62 of file AppConfigManager.cpp.

References fwServices::registry::AppConfig::getDefault(), and fwServices::IAppConfigManager::m_cfgElem.

+ Here is the call graph for this function:

void fwServices::AppConfigManager::setConfig ( const std::string &  configId,
const ::fwData::Composite::csptr &  replaceFields 
)
overridevirtual

Set configuration.

Parameters
configIdthe identifier of the requested config.
replaceFieldscomposite of association between the value and the pattern to replace in the config.

Implements fwServices::IAppConfigManager.

Definition at line 70 of file AppConfigManager.cpp.

References fwServices::registry::AppConfig::getDefault(), and fwServices::IAppConfigManager::m_cfgElem.

+ Here is the call graph for this function:

void fwServices::AppConfigManager::startBundle ( )
virtual

Starts the bundle associated to the config.

Note
Does nothing if the bundle is already started or if the config id is not specified (ie. if config is set with setConfig(::fwRuntime::ConfigurationElement::csptr cfgElem) ).

Definition at line 98 of file AppConfigManager.cpp.

References fwServices::registry::AppConfig::getDefault(), SLM_ERROR_IF, and SLM_INFO_IF.

Referenced by launch().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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