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
41 class CTBMisc : public dunedaq::confmodel::ResourceSetAND {
42
44 friend class conffwk::DalObject;
45 friend class conffwk::DalFactory;
47
48 protected:
49
50 CTBMisc(conffwk::DalRegistry& db, const conffwk::ConfigObject& obj) noexcept;
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
95
96
97 public:
98
99 // attribute names
100
101 inline static const std::string s_ch_status = "ch_status";
102
103 static const std::string& __get_ch_status_str() noexcept { return s_ch_status; }
104
105
112 bool
114 {
115 std::lock_guard scoped_lock(m_mutex);
116 check();
117 check_init();
118 return m_ch_status;
119 }
120
127 void
128 set_ch_status(bool value)
129 {
130 std::lock_guard scoped_lock(m_mutex);
131 check();
132 clear();
134 }
135
136
137 // relationship names
138
139 inline static const std::string s_pulser = "pulser";
140 inline static const std::string s_timing = "timing";
141
142 static const std::string& __get_pulser_str() noexcept { return s_pulser; }
143 static const std::string& __get_timing_str() noexcept { return s_timing; }
144
145
154 {
155 std::lock_guard scoped_lock(m_mutex);
156 check();
157 check_init();
158 if (!m_pulser)
159 {
160 std::ostringstream text;
161 text << "relationship \"" << s_pulser << "\" of object " << this << " is not set";
162 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
163 }
164 return m_pulser;
165 }
166
167
174 void
176
185 {
186 std::lock_guard scoped_lock(m_mutex);
187 check();
188 check_init();
189 if (!m_timing)
190 {
191 std::ostringstream text;
192 text << "relationship \"" << s_timing << "\" of object " << this << " is not set";
193 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
194 }
195 return m_timing;
196 }
197
198
205 void
207
208
209 public:
210
211 // user-defined algorithms
212
213 nlohmann::json get_ctb_json(const dunedaq::confmodel::Session& session) const;
214
215
217
218
220 };
221
222 // out stream operator
223
224 inline std::ostream& operator<<(std::ostream& s, const CTBMisc& obj)
225 {
226 return obj.print_object(s);
227 }
228
229 typedef std::vector<const CTBMisc*>::const_iterator CTBMiscIterator;
230
231 }
232}
233
234#endif
#define ERS_HERE
const dunedaq::appmodel::CTBTiming * m_timing
Definition CTBMisc.hpp:94
static const std::string s_pulser
Definition CTBMisc.hpp:139
static const std::string & __get_pulser_str() noexcept
Definition CTBMisc.hpp:142
const CTBRandomTrigger & get_randomtrigger_1() const
static const std::string s_timing
Definition CTBMisc.hpp:140
virtual void init(bool init_children)
Definition CTBMisc.cpp:75
const CTBRandomTrigger & get_randomtrigger_2() const
static const std::string & s_class_name
Definition CTBMisc.hpp:58
static const std::string & __get_timing_str() noexcept
Definition CTBMisc.hpp:143
nlohmann::json get_ctb_json(const dunedaq::confmodel::Session &session) const
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:95
const dunedaq::appmodel::CTBTiming * get_timing() const
Get "timing" relationship value.
Definition CTBMisc.hpp:184
static const std::string & __get_ch_status_str() noexcept
Definition CTBMisc.hpp:103
bool get_ch_status() const
Get "ch_status" attribute value.
Definition CTBMisc.hpp:113
friend class conffwk::DalFactory
Definition CTBMisc.hpp:45
void set_ch_status(bool value)
Set "ch_status" attribute value.
Definition CTBMisc.hpp:128
virtual ~CTBMisc() noexcept
Definition CTBMisc.cpp:91
void set_timing(const dunedaq::appmodel::CTBTiming *value)
Set "timing" relationship value.
Definition CTBMisc.cpp:131
friend class conffwk::DalObject
Definition CTBMisc.hpp:44
CTBMisc(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
Definition CTBMisc.cpp:32
static const std::string s_ch_status
Definition CTBMisc.hpp:101
const dunedaq::appmodel::CTBPulser * get_pulser() const
Get "pulser" relationship value.
Definition CTBMisc.hpp:153
void set_pulser(const dunedaq::appmodel::CTBPulser *value)
Set "pulser" relationship value.
Definition CTBMisc.cpp:126
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:229
Including Qt Headers.