7 #include "fwServices/registry/AppConfigParameters.hpp" 9 #include <fwData/Composite.hpp> 10 #include <fwData/Composite.hpp> 11 #include <fwData/String.hpp> 12 #include <fwRuntime/ConfigurationElement.hpp> 13 #include <fwRuntime/helper.hpp> 14 #include <fwRuntime/Runtime.hpp> 16 #include <boost/regex.hpp> 42 std::vector< std::shared_ptr< ::fwRuntime::Extension > > extensions = ::fwRuntime::getAllExtensionsForPoint(
43 "::fwServices::registry::AppConfigParameters");
44 for( std::shared_ptr< ::fwRuntime::Extension > ext : extensions )
47 std::string extensionId = ext->findConfigurationElement(
"id")->getValue();
52 ::fwRuntime::ConfigurationElement::csptr parametersConfig = ext->findConfigurationElement(
"parameters");
54 for( ::fwRuntime::ConfigurationElement::sptr paramConfig : elements )
56 std::string name = paramConfig->getExistingAttributeValue(
"name");
57 std::string val = paramConfig->getExistingAttributeValue(
"value");
58 parameters[name] = val;
61 Registry::const_iterator iter =
m_reg.find( extensionId );
63 <<
" already exists in the application configuration parameter registry",
65 m_reg[extensionId] = parameters;
88 Registry::const_iterator iter =
m_reg.find( extensionId );
89 SLM_ASSERT(
"The id " << extensionId <<
" is not found in the application configuration parameter registry",
Contains fwAtomsFilter::registry details.
FWSERVICES_API const FieldAdaptorType & getParameters(const std::string &extensionId) const
Get the parameters associated to extension id.
Namespace fwServices is dedicated to (mimic) the dynamic affectation of methods to (pure data) object...
FWSERVICES_API void parseBundleInformation()
Parse bundle information to retrieve config parameters declaration.
std::vector< std::shared_ptr< ConfigurationElement > > Container
Defines the configuration element container type.
::boost::unique_lock< ReadWriteMutex > WriteLock
Defines a lock of write type for read/write mutex.
mutable::fwCore::mt::ReadWriteMutex m_registryMutex
Used to protect the registry access.
std::map< std::string, std::string > FieldAdaptorType
Associations of <pattern, value>.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
FWSERVICES_API void clearRegistry()
Clear the registry.
FWSERVICES_API AppConfigParameters()
Constructor.
static FWSERVICES_API AppConfigParameters::sptr getDefault()
Return the default global instance of AppConfigParameters.
::boost::shared_lock< ReadWriteMutex > ReadLock
Defines a lock of read type for read/write mutex.
Registry m_reg
Container of parameter information.
virtual FWSERVICES_API ~AppConfigParameters()
Destructor.
static AppConfigParameters::sptr s_appConfigParameters
The global instance of the app config parameters.