DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CTBMisc.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _CTBMisc_0_dunedaq__appmodel_0_appmodel_H_
4#define _CTBMisc_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 CTBPulser;
25 class CTBRandomTrigger;
26 class CTBTiming;
27 }
28 namespace confmodel {
29 class Session;
30 }
31}
32
33
34 // prologue of method CTBMisc::get_ctb_json()
35
36#include "nlohmann/json.hpp"
37
38namespace dunedaq {
39 namespace appmodel {
40
42
43 friend class conffwk::Configuration;
44 friend class conffwk::DalObject;
45 friend class conffwk::DalFactory;
46 friend class conffwk::DalRegistry;
47
48 protected:
49
51 virtual ~CTBMisc() noexcept;
52 virtual void init(bool init_children);
53
54 public:
55
58 static const std::string& s_class_name;
59
60
70 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
71
72
82 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
83
84
85 protected:
86
87 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
88
89
90 private:
91
92 bool m_ch_status;
97
98
99 public:
100
101 // attribute names
102
103 inline static const std::string s_ch_status = "ch_status";
104
105 static const std::string& __get_ch_status_str() noexcept { return s_ch_status; }
106
107
114 bool
116 {
117 std::lock_guard scoped_lock(m_mutex);
118 check();
119 check_init();
120 return m_ch_status;
121 }
122
129 void
130 set_ch_status(bool value)
131 {
132 std::lock_guard scoped_lock(m_mutex);
133 check();
134 clear();
136 }
137
138
139 // relationship names
140
141 inline static const std::string s_pulser = "pulser";
142 inline static const std::string s_timing = "timing";
143 inline static const std::string s_randomtrigger_1 = "randomtrigger_1";
144 inline static const std::string s_randomtrigger_2 = "randomtrigger_2";
145
146 static const std::string& __get_pulser_str() noexcept { return s_pulser; }
147 static const std::string& __get_timing_str() noexcept { return s_timing; }
148 static const std::string& __get_randomtrigger_1_str() noexcept { return s_randomtrigger_1; }
149 static const std::string& __get_randomtrigger_2_str() noexcept { return s_randomtrigger_2; }
150
151
160 {
161 std::lock_guard scoped_lock(m_mutex);
162 check();
163 check_init();
164 if (!m_pulser)
165 {
166 std::ostringstream text;
167 text << "relationship \"" << s_pulser << "\" of object " << this << " is not set";
168 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
169 }
170 return m_pulser;
171 }
172
173
180 void
182
191 {
192 std::lock_guard scoped_lock(m_mutex);
193 check();
194 check_init();
195 if (!m_timing)
196 {
197 std::ostringstream text;
198 text << "relationship \"" << s_timing << "\" of object " << this << " is not set";
199 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
200 }
201 return m_timing;
202 }
203
204
211 void
213
222 {
223 std::lock_guard scoped_lock(m_mutex);
224 check();
225 check_init();
227 {
228 std::ostringstream text;
229 text << "relationship \"" << s_randomtrigger_1 << "\" of object " << this << " is not set";
230 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
231 }
232 return m_randomtrigger_1;
233 }
234
235
242 void
244
253 {
254 std::lock_guard scoped_lock(m_mutex);
255 check();
256 check_init();
258 {
259 std::ostringstream text;
260 text << "relationship \"" << s_randomtrigger_2 << "\" of object " << this << " is not set";
261 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
262 }
263 return m_randomtrigger_2;
264 }
265
266
273 void
275
276
277 public:
278
279 // user-defined algorithms
280
282
283
284 virtual std::vector<const Resource*> contained_resources() const override;
285 };
286
287 // out stream operator
288
289 inline std::ostream& operator<<(std::ostream& s, const CTBMisc& obj)
290 {
291 return obj.print_object(s);
292 }
293
294 typedef std::vector<const CTBMisc*>::const_iterator CTBMiscIterator;
295
296 }
297}
298
299#endif
#define ERS_HERE
const dunedaq::appmodel::CTBTiming * m_timing
Definition CTBMisc.hpp:94
static const std::string s_pulser
Definition CTBMisc.hpp:141
static const std::string & __get_pulser_str() noexcept
Definition CTBMisc.hpp:146
static const std::string s_timing
Definition CTBMisc.hpp:142
virtual void init(bool init_children)
Definition CTBMisc.cpp:80
static const std::string s_randomtrigger_1
Definition CTBMisc.hpp:143
static const std::string & s_class_name
Definition CTBMisc.hpp:58
static const std::string & __get_randomtrigger_1_str() noexcept
Definition CTBMisc.hpp:148
static const std::string & __get_randomtrigger_2_str() noexcept
Definition CTBMisc.hpp:149
void set_randomtrigger_2(const dunedaq::appmodel::CTBRandomTrigger *value)
Set "randomtrigger_2" relationship value.
virtual ~CTBMisc() noexcept
static const std::string & __get_timing_str() noexcept
Definition CTBMisc.hpp:147
const dunedaq::appmodel::CTBPulser * m_pulser
Definition CTBMisc.hpp:93
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...
Definition CTBMisc.cpp:102
const dunedaq::appmodel::CTBTiming * get_timing() const
Get "timing" relationship value.
Definition CTBMisc.hpp:190
static const std::string & __get_ch_status_str() noexcept
Definition CTBMisc.hpp:105
bool get_ch_status() const
Get "ch_status" attribute value.
Definition CTBMisc.hpp:115
friend class conffwk::DalFactory
Definition CTBMisc.hpp:45
void set_ch_status(bool value)
Set "ch_status" attribute value.
Definition CTBMisc.hpp:130
const dunedaq::appmodel::CTBRandomTrigger * m_randomtrigger_2
Definition CTBMisc.hpp:96
virtual std::vector< const Resource * > contained_resources() const override
const dunedaq::appmodel::CTBRandomTrigger * get_randomtrigger_2() const
Get "randomtrigger_2" relationship value.
Definition CTBMisc.hpp:252
void set_timing(const dunedaq::appmodel::CTBTiming *value)
Set "timing" relationship value.
nlohmann::json get_ctb_json(const dunedaq::confmodel::Session &session) const
const dunedaq::appmodel::CTBRandomTrigger * get_randomtrigger_1() const
Get "randomtrigger_1" relationship value.
Definition CTBMisc.hpp:221
const dunedaq::appmodel::CTBRandomTrigger * m_randomtrigger_1
Definition CTBMisc.hpp:95
friend class conffwk::DalObject
Definition CTBMisc.hpp:44
static const std::string s_randomtrigger_2
Definition CTBMisc.hpp:144
CTBMisc(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string s_ch_status
Definition CTBMisc.hpp:103
const dunedaq::appmodel::CTBPulser * get_pulser() const
Get "pulser" relationship value.
Definition CTBMisc.hpp:159
void set_randomtrigger_1(const dunedaq::appmodel::CTBRandomTrigger *value)
Set "randomtrigger_1" relationship value.
void set_pulser(const dunedaq::appmodel::CTBPulser *value)
Set "pulser" relationship value.
void set_by_val(const std::string &name, T value)
Set attribute value.
The base class for any generated DAL object.
Definition DalObject.hpp:45
std::mutex m_mutex
Used to protect changes of DAL object.
ConfigObject p_obj
Config object used by given template 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< constCTBMisc * >::const_iterator CTBMiscIterator
Definition CTBMisc.hpp:294
The DUNE-DAQ namespace.
Definition DataStore.hpp:57
msgpack::object obj