1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: Config_PropManager.h
4 // Created: 13 Aug 2014
5 // Author: Vitaly SMETANNIKOV
7 #ifndef Config_PropManager_H
8 #define Config_PropManager_H
10 #include "Config_def.h"
11 #include "Config_Prop.h"
17 //! Class wihich let to register properties
18 class Config_PropManager
23 * Registers property parameters
24 * \param theOwnerId - name of owner (name of plugin for example)
25 * \param theSection - name of section (domain of using) of the property.
26 * \param theName - name (title) of the value.
27 * \param theType - type of the value.
28 * \param theDefValue - default and initial value of the property
29 * Returns True if the property succesfully registered
31 CONFIG_EXPORT static Config_Prop* registerProp(const std::string& theSection, const std::string& theName,
32 const std::string& theTitle, Config_Prop::PropType theType, const std::string& theDefValue = "");
34 CONFIG_EXPORT static Config_Prop* findProp(
35 const std::string& theSection, const std::string& theName);
37 CONFIG_EXPORT static Config_Properties getProperties();
39 //! Returns list of registered section names.
40 CONFIG_EXPORT static std::list<std::string> getSections();
42 //! Returns list of properties by its owner and section.
43 CONFIG_EXPORT static Config_Properties getProperties(const std::string& theSection);
45 //! Returns value of the property by its owner, section, and name
46 CONFIG_EXPORT static std::string string(
47 const std::string& theSection, const std::string& theName, const std::string& theDefault);
49 CONFIG_EXPORT static std::vector<int> color(
50 const std::string& theSection, const std::string& theName, const std::string& theDefault);
52 CONFIG_EXPORT static int integer(
53 const std::string& theSection, const std::string& theName, const std::string& theDefault);
55 CONFIG_EXPORT static double real(
56 const std::string& theSection, const std::string& theName, const std::string& theDefault);
59 CONFIG_EXPORT static Config_Properties myProps;