otsdaq  v2_03_00
DatabaseConfigurationInterface.h
1 #ifndef _ots_DatabaseConfigurationInterface_h_
2 #define _ots_DatabaseConfigurationInterface_h_
3 
4 #include "otsdaq-core/ConfigurationInterface/ConfigurationInterface.h"
5 
6 //#include "ConfigurationInterface.h"
7 
8 #include <list>
9 #include <map>
10 #include <set>
11 #include <stdexcept>
12 
13 namespace ots
14 {
15 class TableBase;
16 
18 {
19  public:
20  using config_version_map_t = std::map<std::string /*name*/, TableVersion /*version*/>;
21 
24 
25  // read configuration from database
26  void fill(TableBase* /*configuration*/, TableVersion /*version*/) const
27  throw(std::runtime_error);
28 
29  // write configuration to database
30  void saveActiveVersion(const TableBase* /*configuration*/,
31  bool overwrite = false) const throw(std::runtime_error);
32 
33  // find the latest configuration version by configuration type
34  TableVersion findLatestVersion(const TableBase* /*configuration*/) const noexcept;
35 
36  // returns a list of all configuration names
37  std::set<std::string /*name*/> getAllTableNames() const throw(std::runtime_error);
38  // find all configuration versions by configuration type
39  std::set<TableVersion> getVersions(const TableBase* /*configuration*/) const noexcept;
40 
41  // find all configuration groups in database
42  std::set<std::string /*name+version*/> getAllTableGroupNames(
43  const std::string& filterString = "") const throw(std::runtime_error);
44  std::set<TableGroupKey> getKeys(const std::string& groupName) const;
45  TableGroupKey findLatestGroupKey(const std::string& groupName) const noexcept;
46 
47  // return the contents of a configuration group
48  config_version_map_t getTableGroupMembers(std::string const& /*configurationGroup*/,
49  bool includeMetaDataTable = false) const
50  throw(std::runtime_error);
51 
52  // create a new configuration group from the contents map
53  void saveTableGroup(config_version_map_t const& /*configurationMap*/,
54  std::string const& /*configurationGroup*/) const
55  throw(std::runtime_error);
56 
57  private:
58 };
59 } // namespace ots
60 
61 #endif