DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbcontroller.hpp
Go to the documentation of this file.
1// DUNE DAQ modification notice:
2// This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3// Fork baseline commit: dbe-02-12-17 (2022-05-12).
4// Renamed since fork: yes (from dbe/dbcontroller.h to include/dbe/dbcontroller.hpp).
5
6#ifndef DBE_DBCONTROLLER_H_
7#define DBE_DBCONTROLLER_H_
8
9#include "dbe/tref.hpp"
10
14
16
17#include <iostream>
18#include <memory>
19#include <mutex>
20#include <string>
21#include <unordered_map>
22#include <vector>
23
24namespace dbe {
25namespace inner {
26//------------------------------------------------------------------------------------------
28{
29public:
37 static configobject::tref get(dbe::cokey const& desc);
38
45 static std::vector<configobject::tref> gets(std::string const& cname, std::string const& query = "");
46
54
61 template<typename T>
63
71 template<typename T>
73
74 template<typename T>
77
82 template<typename T>
84
85 template<typename T>
88
98 static configobject::tref move_object_request(configobject::tref objref, std::string const& destfile);
99
109 static configobject::tref rename_object_request(configobject::tref objref, std::string const& newname);
110
115 static void flush();
116
117private:
119 typedef std::shared_ptr<configobject::oref> t_object_handle;
120 typedef std::unordered_map<t_object_key, t_object_handle, configobject::refhasher> t_object_map;
121
126 static dbcontroller& ref();
127
135
145
152 configobject::tref rename(configobject::tref objref, std::string const& aname);
153
162 template<typename T>
164
173 std::vector<configobject::tref> referenced_by(configobject::tref objref,
174 std::string const& name = "*",
175 bool check_composite_only = true);
176
178
179 typedef std::recursive_mutex t_mutex;
180 typedef std::lock_guard<t_mutex> locker;
182
184 dbcontroller(dbcontroller const&) = delete;
186
187 friend class configobject::tref;
188};
189
190} // namespace inner
191
192} // end namespace dbe
193//------------------------------------------------------------------------------------------
194
195#endif /* DBE_DBCONTROLLER_H_ */
std::unordered_map< t_object_key, t_object_handle, configobject::refhasher > t_object_map
configobject::tref rename(configobject::tref objref, std::string const &aname)
static dbcontroller & ref()
configobject::gref< T > remove(dbe::tref ref)
static configobject::gref< T > delete_object_request(configobject::tref const &obj)
std::lock_guard< t_mutex > locker
static std::vector< configobject::tref > gets(std::string const &cname, std::string const &query="")
dbcontroller & operator=(dbcontroller const &)=delete
configobject::tref insert(dunedaq::conffwk::ConfigObject const &)
std::vector< configobject::tref > referenced_by(configobject::tref objref, std::string const &name="*", bool check_composite_only=true)
std::recursive_mutex t_mutex
static configobject::tref move_object_request(configobject::tref objref, std::string const &destfile)
configobject::tref lookup(dbe::cokey const &desc)
std::shared_ptr< configobject::oref > t_object_handle
static configobject::tref get(dbe::cokey const &desc)
static configobject::tref rename_object_request(configobject::tref objref, std::string const &newname)
static configobject::tref create_object_request(dbe::t_config_object_preimage const &rep)
dbcontroller(dbcontroller const &)=delete
Represents database objects.
Include QT Headers.
inner::configobject::tref tref
Definition tref.hpp:36
config_object_preimage< std::string > t_config_object_preimage
config_object_key cokey