ifw-daq  2.1.0-pre1
IFW Data Acquisition modules
configManager.hpp
Go to the documentation of this file.
1 /**
2  * @file
3  * @ingroup daq_dpm_server
4  * @copyright (c) Copyright ESO 2022
5  * All Rights Reserved
6  * ESO (eso.org) is an Intergovernmental Organisation, and therefore special legal conditions apply.
7  *
8  * @brief DPM server config
9  */
10 #ifndef DAQ_DPM_SERVER_CONFIGMANAGER_HPP
11 #define DAQ_DPM_SERVER_CONFIGMANAGER_HPP
12 
13 #include <daq/config/manager.hpp>
14 
15 #include <daq/dpm/config.hpp>
16 
17 namespace daq::dpm {
18 
19 /**
20  * DPM Server specific configuration manager.
21  *
22  * Main responsibilities:
23  * - Update configuration from various sources.
24  * - Publish updates to OLDB.
25  */
27 public:
28  ConfigManager(log4cplus::Logger logger);
29 
30  Configuration const& GetConfig() const {
31  return m_config;
32  }
33  /**
34  * Parse configuration from command line arguments.
35  *
36  * @param[in] argc Number of command line options.
37  * @param[in] argv Pointer to the array of command line options.
38  * @return false if the help option has been invoked, true otherwise.
39  */
40  bool ParseArguments(int argc, char* argv[]);
41 
42  /**
43  * Load configuration file and update configuration.
44  */
45  void LoadConfig();
46 
47 private:
48  log4cplus::Logger m_logger;
49  Configuration m_config;
51 };
52 
53 } // namespace daq::dpm
54 #endif // DAQ_DPM_SERVER_CONFIGMANAGER_HPP
daq::dpm::Configuration
Represents active configuration.
Definition: config.hpp:27
daq::dpm::ConfigManager::ParseArguments
bool ParseArguments(int argc, char *argv[])
Parse configuration from command line arguments.
Definition: configManager.cpp:59
daq::dpm::ConfigManager::GetConfig
Configuration const & GetConfig() const
Definition: configManager.hpp:30
config.hpp
DPM server config.
daq::dpm::ConfigManager::LoadConfig
void LoadConfig()
Load configuration file and update configuration.
Definition: configManager.cpp:156
manager.hpp
daq::config::Manager and associated types.
daq::dpm
Definition: testDpSpec.cpp:16
daq::config::Manager
Maintains the associativity of configuration attributes with metadata and value origin/priority.
Definition: manager.hpp:105
daq::dpm::ConfigManager::ConfigManager
ConfigManager(log4cplus::Logger logger)
Definition: configManager.cpp:25
daq::dpm::ConfigManager
DPM Server specific configuration manager.
Definition: configManager.hpp:26