DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
GeoId.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _GeoId_0_dunedaq__confmodel_0_confmodel_H_
4#define _GeoId_0_dunedaq__confmodel_0_confmodel_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
17namespace dunedaq {
18 namespace confmodel {
19
24 class GeoId : public virtual dunedaq::conffwk::DalObject {
25
27 friend class conffwk::DalObject;
28 friend class conffwk::DalFactory;
30
31 protected:
32
33 GeoId(conffwk::DalRegistry& db, const conffwk::ConfigObject& obj) noexcept;
34 virtual ~GeoId() noexcept;
35 virtual void init(bool init_children);
36
37 public:
38
41 static const std::string& s_class_name;
42
43
53 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
54
55
65 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
66
67
68 protected:
69
70 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
71
72
73 private:
74
75 uint32_t m_detector_id;
76 uint32_t m_crate_id;
77 uint32_t m_slot_id;
78 uint32_t m_stream_id;
79
80
81 public:
82
83 // attribute names
84
85 inline static const std::string s_detector_id = "detector_id";
86 inline static const std::string s_crate_id = "crate_id";
87 inline static const std::string s_slot_id = "slot_id";
88 inline static const std::string s_stream_id = "stream_id";
89
90 static const std::string& __get_detector_id_str() noexcept { return s_detector_id; }
91 static const std::string& __get_crate_id_str() noexcept { return s_crate_id; }
92 static const std::string& __get_slot_id_str() noexcept { return s_slot_id; }
93 static const std::string& __get_stream_id_str() noexcept { return s_stream_id; }
94
95
102 uint32_t
104 {
105 std::lock_guard scoped_lock(m_mutex);
106 check();
107 check_init();
108 return m_detector_id;
109 }
110
117 void
118 set_detector_id(uint32_t value)
119 {
120 std::lock_guard scoped_lock(m_mutex);
121 check();
122 clear();
124 }
125
126
133 uint32_t
135 {
136 std::lock_guard scoped_lock(m_mutex);
137 check();
138 check_init();
139 return m_crate_id;
140 }
141
148 void
149 set_crate_id(uint32_t value)
150 {
151 std::lock_guard scoped_lock(m_mutex);
152 check();
153 clear();
155 }
156
157
164 uint32_t
166 {
167 std::lock_guard scoped_lock(m_mutex);
168 check();
169 check_init();
170 return m_slot_id;
171 }
172
179 void
180 set_slot_id(uint32_t value)
181 {
182 std::lock_guard scoped_lock(m_mutex);
183 check();
184 clear();
185 p_obj.set_by_val(s_slot_id, value);
186 }
187
188
195 uint32_t
197 {
198 std::lock_guard scoped_lock(m_mutex);
199 check();
200 check_init();
201 return m_stream_id;
202 }
203
210 void
211 set_stream_id(uint32_t value)
212 {
213 std::lock_guard scoped_lock(m_mutex);
214 check();
215 clear();
217 }
218
219
220 };
221
222 // out stream operator
223
224 inline std::ostream& operator<<(std::ostream& s, const GeoId& obj)
225 {
226 return obj.print_object(s);
227 }
228
229 typedef std::vector<const GeoId*>::const_iterator GeoIdIterator;
230
231 }
232}
233
234#endif
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...
static const std::string & s_class_name
Definition GeoId.hpp:41
static const std::string & __get_slot_id_str() noexcept
Definition GeoId.hpp:92
GeoId(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
Definition GeoId.cpp:26
static const std::string s_stream_id
Definition GeoId.hpp:88
void set_detector_id(uint32_t value)
Set "detector_id" attribute value.
Definition GeoId.hpp:118
uint32_t get_stream_id() const
Get "stream_id" attribute value.
Definition GeoId.hpp:196
static const std::string & __get_stream_id_str() noexcept
Definition GeoId.hpp:93
virtual void init(bool init_children)
Definition GeoId.cpp:57
static const std::string s_slot_id
Definition GeoId.hpp:87
friend class conffwk::DalFactory
Definition GeoId.hpp:28
static const std::string & __get_crate_id_str() noexcept
Definition GeoId.hpp:91
void set_stream_id(uint32_t value)
Set "stream_id" attribute value.
Definition GeoId.hpp:211
static const std::string s_detector_id
Definition GeoId.hpp:85
uint32_t get_slot_id() const
Get "slot_id" attribute value.
Definition GeoId.hpp:165
friend class conffwk::DalObject
Definition GeoId.hpp:27
void set_crate_id(uint32_t value)
Set "crate_id" attribute value.
Definition GeoId.hpp:149
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 GeoId.cpp:78
virtual ~GeoId() noexcept
Definition GeoId.cpp:74
void set_slot_id(uint32_t value)
Set "slot_id" attribute value.
Definition GeoId.hpp:180
uint32_t get_detector_id() const
Get "detector_id" attribute value.
Definition GeoId.hpp:103
uint32_t get_crate_id() const
Get "crate_id" attribute value.
Definition GeoId.hpp:134
static const std::string & __get_detector_id_str() noexcept
Definition GeoId.hpp:90
static const std::string s_crate_id
Definition GeoId.hpp:86
conffwk entry point
double offset
std::vector< constGeoId * >::const_iterator GeoIdIterator
Definition GeoId.hpp:229
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.