otsdaq  v2_05_02_indev
DatabaseConfigurationInterface.h
1 #ifndef _ots_DatabaseConfigurationInterface_h_
2 #define _ots_DatabaseConfigurationInterface_h_
3 
4 #include "otsdaq/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 
28  // write configuration to database
29  void saveActiveVersion(const TableBase* /*configuration*/, bool overwrite = false) const;
30 
31  // find the latest configuration version by configuration type
32  TableVersion findLatestVersion(const TableBase* /*configuration*/) const noexcept;
33 
34  // returns a list of all configuration names
35  std::set<std::string /*name*/> getAllTableNames() const;
36  // find all configuration versions by configuration type
37  std::set<TableVersion> getVersions(const TableBase* /*configuration*/) const noexcept;
38 
39  // find all configuration groups in database
40  std::set<std::string /*name+version*/> getAllTableGroupNames(std::string const& filterString = "") const;
41  std::set<TableGroupKey> getKeys(const std::string& groupName) const;
42  TableGroupKey findLatestGroupKey(const std::string& groupName) const noexcept;
43 
44  // return the contents of a configuration group
45  config_version_map_t getTableGroupMembers(std::string const& /*configurationGroup*/, bool includeMetaDataTable = false) const;
46 
47  // create a new configuration group from the contents map
48  void saveTableGroup(config_version_map_t const& /*configurationMap*/, std::string const& /*configurationGroup*/) const;
49 
50  private:
51 };
52 } // namespace ots
53 
54 #endif