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::ResourceSetDisableAND {
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;
105 std::vector<const dunedaq::appmodel::CTBHLT*> m_HLTs;
108
109
110 public:
111
112 // relationship names
113
114 inline static const std::string s_sockets = "sockets";
115 inline static const std::string s_beam = "beam";
116 inline static const std::string s_CRT = "CRT";
117 inline static const std::string s_pds = "pds";
118 inline static const std::string s_geo_id = "geo_id";
119 inline static const std::string s_misc = "misc";
120 inline static const std::string s_HLTs = "HLTs";
121 inline static const std::string s_CRT_LLTs = "CRT_LLTs";
122 inline static const std::string s_beam_LLTs = "beam_LLTs";
123
124 static const std::string& __get_sockets_str() noexcept { return s_sockets; }
125 static const std::string& __get_beam_str() noexcept { return s_beam; }
126 static const std::string& __get_CRT_str() noexcept { return s_CRT; }
127 static const std::string& __get_pds_str() noexcept { return s_pds; }
128 static const std::string& __get_geo_id_str() noexcept { return s_geo_id; }
129 static const std::string& __get_misc_str() noexcept { return s_misc; }
130 static const std::string& __get_HLTs_str() noexcept { return s_HLTs; }
131 static const std::string& __get_CRT_LLTs_str() noexcept { return s_CRT_LLTs; }
132 static const std::string& __get_beam_LLTs_str() noexcept { return s_beam_LLTs; }
133
134
143 {
144 std::lock_guard scoped_lock(m_mutex);
145 check();
146 check_init();
147 if (!m_sockets)
148 {
149 std::ostringstream text;
150 text << "relationship \"" << s_sockets << "\" of object " << this << " is not set";
151 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
152 }
153 return m_sockets;
154 }
155
156
163 void
165
173 get_beam() const
174 {
175 std::lock_guard scoped_lock(m_mutex);
176 check();
177 check_init();
178 if (!m_beam)
179 {
180 std::ostringstream text;
181 text << "relationship \"" << s_beam << "\" of object " << this << " is not set";
182 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
183 }
184 return m_beam;
185 }
186
187
194 void
196
204 get_CRT() const
205 {
206 std::lock_guard scoped_lock(m_mutex);
207 check();
208 check_init();
209 if (!m_CRT)
210 {
211 std::ostringstream text;
212 text << "relationship \"" << s_CRT << "\" of object " << this << " is not set";
213 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
214 }
215 return m_CRT;
216 }
217
218
225 void
227
235 get_pds() const
236 {
237 std::lock_guard scoped_lock(m_mutex);
238 check();
239 check_init();
240 if (!m_pds)
241 {
242 std::ostringstream text;
243 text << "relationship \"" << s_pds << "\" of object " << this << " is not set";
244 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
245 }
246 return m_pds;
247 }
248
249
256 void
258
267 {
268 std::lock_guard scoped_lock(m_mutex);
269 check();
270 check_init();
271 if (!m_geo_id)
272 {
273 std::ostringstream text;
274 text << "relationship \"" << s_geo_id << "\" of object " << this << " is not set";
275 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
276 }
277 return m_geo_id;
278 }
279
280
287 void
289
297 get_misc() const
298 {
299 std::lock_guard scoped_lock(m_mutex);
300 check();
301 check_init();
302 if (!m_misc)
303 {
304 std::ostringstream text;
305 text << "relationship \"" << s_misc << "\" of object " << this << " is not set";
306 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
307 }
308 return m_misc;
309 }
310
311
318 void
320
327 const std::vector<const dunedaq::appmodel::CTBHLT*>&
328 get_HLTs() const
329 {
330 std::lock_guard scoped_lock(m_mutex);
331 check();
332 check_init();
333 return m_HLTs;
334 }
335
336
343 void
344 set_HLTs(const std::vector<const dunedaq::appmodel::CTBHLT*>& value);
345
352 const std::vector<const dunedaq::appmodel::CTBCountLLT*>&
354 {
355 std::lock_guard scoped_lock(m_mutex);
356 check();
357 check_init();
358 return m_CRT_LLTs;
359 }
360
361
368 void
369 set_CRT_LLTs(const std::vector<const dunedaq::appmodel::CTBCountLLT*>& value);
370
377 const std::vector<const dunedaq::appmodel::CTBLLT*>&
379 {
380 std::lock_guard scoped_lock(m_mutex);
381 check();
382 check_init();
383 return m_beam_LLTs;
384 }
385
386
393 void
394 set_beam_LLTs(const std::vector<const dunedaq::appmodel::CTBLLT*>& value);
395
396
397 public:
398
399 // user-defined algorithms
400
405 nlohmann::json get_ctb_json(const dunedaq::confmodel::Session& session, std::optional<std::string> socket_host = std::nullopt ) const;
406
407
408 virtual std::vector<const Resource*> contained_resources() const override;
409 };
410
411 // out stream operator
412
413 inline std::ostream& operator<<(std::ostream& s, const CTBoardConf& obj)
414 {
415 return obj.print_object(s);
416 }
417
418 typedef std::vector<const CTBoardConf*>::const_iterator CTBoardConfIterator;
419
420 }
421}
422
423#endif
#define ERS_HERE
std::vector< const dunedaq::appmodel::CTBCountLLT * > m_CRT_LLTs
static const std::string s_misc
static const std::string & __get_CRT_str() noexcept
const dunedaq::appmodel::CTBSubsystem * m_beam
static const std::string & __get_beam_LLTs_str() noexcept
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
static const std::string s_HLTs
const dunedaq::appmodel::CTBMisc * get_misc() const
Get "misc" relationship value.
void set_CRT(const dunedaq::appmodel::CTBCRTSubsystem *value)
Set "CRT" relationship value.
void set_HLTs(const std::vector< const dunedaq::appmodel::CTBHLT * > &value)
Set "HLTs" relationship value.
static const std::string & __get_CRT_LLTs_str() noexcept
const dunedaq::appmodel::CTBPDSSubsystem * m_pds
void set_pds(const dunedaq::appmodel::CTBPDSSubsystem *value)
Set "pds" relationship value.
const std::vector< const dunedaq::appmodel::CTBHLT * > & get_HLTs() const
Get "HLTs" relationship value.
void set_CRT_LLTs(const std::vector< const dunedaq::appmodel::CTBCountLLT * > &value)
Set "CRT_LLTs" relationship value.
static const std::string s_beam_LLTs
const dunedaq::appmodel::CTBSubsystem * get_beam() const
Get "beam" relationship value.
const dunedaq::appmodel::CTBMisc * m_misc
const dunedaq::appmodel::CTBCRTSubsystem * get_CRT() const
Get "CRT" relationship value.
std::vector< const dunedaq::appmodel::CTBLLT * > m_beam_LLTs
void set_beam(const dunedaq::appmodel::CTBSubsystem *value)
Set "beam" relationship value.
friend class conffwk::DalFactory
static const std::string s_CRT_LLTs
static const std::string & __get_beam_str() noexcept
const dunedaq::appmodel::CTBSockets * get_sockets() const
Get "sockets" relationship value.
virtual std::vector< const Resource * > contained_resources() const override
static const std::string & __get_misc_str() noexcept
static const std::string s_CRT
void set_beam_LLTs(const std::vector< const dunedaq::appmodel::CTBLLT * > &value)
Set "beam_LLTs" relationship value.
const dunedaq::confmodel::GeoId * m_geo_id
static const std::string & __get_pds_str() noexcept
friend class conffwk::DalObject
static const std::string & __get_HLTs_str() noexcept
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...
void set_misc(const dunedaq::appmodel::CTBMisc *value)
Set "misc" relationship value.
const dunedaq::appmodel::CTBSockets * m_sockets
std::vector< const dunedaq::appmodel::CTBHLT * > m_HLTs
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.
static const std::string & __get_geo_id_str() noexcept
const std::vector< const dunedaq::appmodel::CTBCountLLT * > & get_CRT_LLTs() const
Get "CRT_LLTs" relationship value.
virtual void init(bool init_children)
static const std::string s_beam
const std::vector< const dunedaq::appmodel::CTBLLT * > & get_beam_LLTs() const
Get "beam_LLTs" relationship value.
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
The DUNE-DAQ namespace.
Definition DataStore.hpp:57
msgpack::object obj