7 #include "appXml/Plugin.hpp" 9 #include <fwRuntime/utils/GenericExecutableFactoryRegistrar.hpp> 11 #include <fwServices/registry/AppConfig.hpp> 12 #include <fwServices/registry/AppConfigParameters.hpp> 17 static ::fwRuntime::utils::GenericExecutableFactoryRegistrar<Plugin> registrar(
"::appXml::Plugin");
22 m_configurationName(""),
37 SLM_FATAL_IF(
"Bundle appXml, missing param config in profile", !this->
getBundle()->hasParameter(
"config"));
38 m_configurationName = this->
getBundle()->getParameterValue(
"config");
39 if( this->
getBundle()->hasParameter(
"parameters") )
41 m_parametersName = this->
getBundle()->getParameterValue(
"parameters");
49 SLM_ASSERT(
"The OSR is already initialized.", !m_appConfigMng );
50 SLM_ASSERT(
"The configuration name parameter is not initialized.", !m_configurationName.empty());
54 if( m_parametersName.empty() )
56 const ::fwServices::registry::FieldAdaptorType fields;
57 m_appConfigMng->setConfig( m_configurationName, fields );
61 const ::fwServices::registry::FieldAdaptorType& fields =
63 m_appConfigMng->setConfig( m_configurationName, fields );
66 m_appConfigMng->launch();
79 SLM_ASSERT(
"The OSR is not initialized.", m_appConfigMng );
80 m_appConfigMng->stopAndDestroy();
81 m_appConfigMng.reset();
APPXML_API Plugin() noexcept
Constructor.
APPXML_API void stop() noexcept
Overrides stop method. Do nothing.
The bundle appXml allows to parse xml configuration of an application. See AppConfig for more details...
APPXML_API void initialize()
Notifies the plugin about its initialisation.
APPXML_API void uninitialize() noexcept
Notifies the plugin about its uninitialisation.
APPXML_API ~Plugin() noexcept
Destructor. Do nothing.
APPXML_API void start()
Overrides start method. .
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
static FWSERVICES_API AppConfigParameters::sptr getDefault()
Return the default global instance of AppConfigParameters.
#define SLM_FATAL_IF(message, cond)
FWRUNTIME_API std::shared_ptr< Bundle > getBundle() const noexcept override
Retrieves the bundle the executable originates from.
static FWSERVICES_API std::shared_ptr< IAppConfigManager > New()