DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CTBoardConf.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _CTBoardConf_0_dunedaq__appmodel_0_appmodel_H_
4#define _CTBoardConf_0_dunedaq__appmodel_0_appmodel_H_
5
6#include <stdint.h> // to define 64 bits types
7#include <iostream>
8#include <sstream>
9#include <string>
10#include <map>
11#include <vector>
12
14#include "conffwk/DalObject.hpp"
15
16 // include files for classes used in inheritance hierarchy
17
19
20 // forward declaration for classes used in relationships and algorithms
21
22namespace dunedaq {
23 namespace appmodel {
24 class CTBCRTSubsystem;
25 class CTBCountLLT;
26 class CTBHLT;
27 class CTBLLT;
28 class CTBMisc;
29 class CTBPDSSubsystem;
30 class CTBSockets;
31 class CTBSubsystem;
32 }
33 namespace confmodel {
34 class GeoId;
35 class Session;
36 }
37}
38
39
40 // prologue of method CTBoardConf::get_ctb_json()
41
42#include "nlohmann/json.hpp"
43#include <optional>
44
45namespace dunedaq {
46 namespace appmodel {
47
48 class CTBoardConf : public dunedaq::confmodel::ResourceSetAND {
49
51 friend class conffwk::DalObject;
52 friend class conffwk::DalFactory;
54
55 protected:
56
58 virtual ~CTBoardConf() noexcept;
59 virtual void init(bool init_children);
60
61 public:
62
65 static const std::string& s_class_name;
66
67
77 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
78
79
89 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
90
91
92 protected:
93
94 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
95
96
97 private:
98
103 const dunedaq::confmodel::GeoId* m_geo_id;
104
105
106 public:
107
108 // relationship names
109
110 inline static const std::string s_sockets = "sockets";
111 inline static const std::string s_beam = "beam";
112 inline static const std::string s_CRT = "CRT";
113 inline static const std::string s_pds = "pds";
114 inline static const std::string s_geo_id = "geo_id";
115
116 static const std::string& __get_sockets_str() noexcept { return s_sockets; }
117 static const std::string& __get_beam_str() noexcept { return s_beam; }
118 static const std::string& __get_CRT_str() noexcept { return s_CRT; }
119 static const std::string& __get_pds_str() noexcept { return s_pds; }
120 static const std::string& __get_geo_id_str() noexcept { return s_geo_id; }
121
122
131 {
132 std::lock_guard scoped_lock(m_mutex);
133 check();
134 check_init();
135 if (!m_sockets)
136 {
137 std::ostringstream text;
138 text << "relationship \"" << s_sockets << "\" of object " << this << " is not set";
139 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
140 }
141 return m_sockets;
142 }
143
144
151 void
153
161 get_beam() const
162 {
163 std::lock_guard scoped_lock(m_mutex);
164 check();
165 check_init();
166 if (!m_beam)
167 {
168 std::ostringstream text;
169 text << "relationship \"" << s_beam << "\" of object " << this << " is not set";
170 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
171 }
172 return m_beam;
173 }
174
175
182 void
184
192 get_CRT() const
193 {
194 std::lock_guard scoped_lock(m_mutex);
195 check();
196 check_init();
197 if (!m_CRT)
198 {
199 std::ostringstream text;
200 text << "relationship \"" << s_CRT << "\" of object " << this << " is not set";
201 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
202 }
203 return m_CRT;
204 }
205
206
213 void
215
223 get_pds() const
224 {
225 std::lock_guard scoped_lock(m_mutex);
226 check();
227 check_init();
228 if (!m_pds)
229 {
230 std::ostringstream text;
231 text << "relationship \"" << s_pds << "\" of object " << this << " is not set";
232 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
233 }
234 return m_pds;
235 }
236
237
244 void
246
255 {
256 std::lock_guard scoped_lock(m_mutex);
257 check();
258 check_init();
259 if (!m_geo_id)
260 {
261 std::ostringstream text;
262 text << "relationship \"" << s_geo_id << "\" of object " << this << " is not set";
263 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
264 }
265 return m_geo_id;
266 }
267
268
275 void
277
278
279 public:
280
281 // user-defined algorithms
282
287 nlohmann::json get_ctb_json(const dunedaq::confmodel::Session& session, std::optional<std::string> socket_host = std::nullopt ) const;
288
289
290 std::vector<const CTBHLT*> get_HLTs() const;
291
292
293 std::vector<const CTBCountLLT*> get_CRT_LLTs() const;
294
295
296 std::vector<const CTBLLT*> get_beam_LLTs() const;
297
298
299 const CTBMisc & get_misc() const;
300 };
301
302 // out stream operator
303
304 inline std::ostream& operator<<(std::ostream& s, const CTBoardConf& obj)
305 {
306 return obj.print_object(s);
307 }
308
309 typedef std::vector<const CTBoardConf*>::const_iterator CTBoardConfIterator;
310
311 }
312}
313
314#endif
#define ERS_HERE
std::vector< const CTBLLT * > get_beam_LLTs() const
static const std::string & __get_CRT_str() noexcept
const dunedaq::appmodel::CTBSubsystem * m_beam
const dunedaq::appmodel::CTBCRTSubsystem * m_CRT
static const std::string & __get_sockets_str() noexcept
static const std::string s_sockets
nlohmann::json get_ctb_json(const dunedaq::confmodel::Session &session, std::optional< std::string > socket_host=std::nullopt) const
static const std::string s_pds
virtual ~CTBoardConf() noexcept
void set_CRT(const dunedaq::appmodel::CTBCRTSubsystem *value)
Set "CRT" relationship value.
const dunedaq::appmodel::CTBPDSSubsystem * m_pds
void set_pds(const dunedaq::appmodel::CTBPDSSubsystem *value)
Set "pds" relationship value.
const dunedaq::appmodel::CTBSubsystem * get_beam() const
Get "beam" relationship value.
const dunedaq::appmodel::CTBCRTSubsystem * get_CRT() const
Get "CRT" relationship value.
void set_beam(const dunedaq::appmodel::CTBSubsystem *value)
Set "beam" relationship value.
friend class conffwk::DalFactory
static const std::string & __get_beam_str() noexcept
const dunedaq::appmodel::CTBSockets * get_sockets() const
Get "sockets" relationship value.
std::vector< const CTBCountLLT * > get_CRT_LLTs() const
static const std::string s_CRT
const dunedaq::confmodel::GeoId * m_geo_id
static const std::string & __get_pds_str() noexcept
friend class conffwk::DalObject
static const std::string s_geo_id
const dunedaq::confmodel::GeoId * get_geo_id() const
Get "geo_id" relationship value.
virtual std::vector< const dunedaq::conffwk::DalObject * > get(const std::string &name, bool upcast_unregistered=true) const
Get values of relationships and results of some algorithms as a vector of dunedaq::conffwk::DalObject...
std::vector< const CTBHLT * > get_HLTs() const
const dunedaq::appmodel::CTBSockets * m_sockets
void set_geo_id(const dunedaq::confmodel::GeoId *value)
Set "geo_id" relationship value.
static const std::string & s_class_name
void set_sockets(const dunedaq::appmodel::CTBSockets *value)
Set "sockets" relationship value.
CTBoardConf(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
const dunedaq::appmodel::CTBPDSSubsystem * get_pds() const
Get "pds" relationship value.
const CTBMisc & get_misc() const
static const std::string & __get_geo_id_str() noexcept
virtual void init(bool init_children)
static const std::string s_beam
The base class for any generated DAL object.
Definition DalObject.hpp:45
std::mutex m_mutex
Used to protect changes of DAL object.
void check_init() const
Check and initialize object if necessary.
DalRegistry: A registry of DalObjects It provides a single interface to create, cache and manage DalO...
Generic configuration exception.
conffwk entry point
double offset
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constCTBoardConf * >::const_iterator CTBoardConfIterator
Including Qt Headers.