Go to the documentation of this file.
5 #ifndef CCF_COMMON_SETUPBASE_HPP_H_
6 #define CCF_COMMON_SETUPBASE_HPP_H_
8 #include <ctd/file/Yaml.hpp>
38 ctd::param::ParameterSet&
GetSetup();
42 void GetPar(
const std::string& name,
43 ctd::param::Parameter& par)
const;
47 bool HasPar(
const std::string& name,
48 ctd::param::Parameter& par)
const;
56 if (m_staging_setup.HasPar(name, value)) {
58 }
else if (m_setup.HasPar(name, value)) {
71 if (m_staging_setup.HasPar(name, value)) {
80 ctd::param::Parameter& par)
const;
87 if (m_staging_setup.HasPar(name, tmp_value)) {
89 }
else if (m_setup.HasPar(name, tmp_value)) {
92 CCFTHROW(
"Setup parameter requested not defined: " + name);
97 void Load(
const std::string& filename);
109 ctd::file::Yaml m_staging_setup;
112 ctd::file::Yaml m_setup;
121 #endif // CCF_COMMON_SETUPBASE_HPP_H_
#define CCFTHROW(msg)
Throw a "rad::Exception()". The location ("CCFLOC") for the throw statement is added to the message.
Definition: base.hpp:410
void Load(const std::string &filename)
Load a Setup File into the Staging Setup object (New Setup).
Definition: setupBase.cpp:53
~SetupBase()
Definition: setupBase.cpp:25
ctd::param::ParameterSet & GetStagingSetup()
Definition: setupBase.cpp:29
void AcceptSetup()
Merge the parameters in the Staging Setup (object) into the Installed Setup.
Definition: setupBase.cpp:94
Class to be used as parent all CCF classes.
Definition: base.hpp:93
bool HasPar(const std::string &name, ctd::param::Parameter &par) const
Check if the given parameter is defined in 1) The Staging Setup, 2) the Installed Setup....
Definition: setupBase.cpp:72
void GetPar(const std::string &name, ctd::param::Parameter &par) const
Definition: setupBase.cpp:39
static SetupBase * s_instance
Singleton instance.
Definition: setupBase.hpp:21
ctd::param::ParameterSet & GetSetup()
Definition: setupBase.cpp:34
static SetupBase & Instance()
Return reference to unique instance of the application class.
Definition: setupBase.cpp:13
TYPE GetValue(const std::string &name) const
Get a parameter value from the configuration.
Definition: setupBase.hpp:84
Global setup class for CCF applications.
Definition: setupBase.hpp:17
bool HasPar(const std::string &name, TYPE &value) const
Definition: setupBase.hpp:53
bool HasStagingPar(const std::string &name, TYPE &value) const
Definition: setupBase.hpp:68
Definition: appBase.cpp:8
#define CCFTRACE
TRACE log macro. Includes the location ("CCFLOC") in the log message.
Definition: base.hpp:403
SetupBase & GetSetup()
Definition: setupBase.hpp:115