DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DaphneV2Channel.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DaphneV2Channel_0_dunedaq__appmodel_0_appmodel_H_
4#define _DaphneV2Channel_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
17namespace dunedaq {
18 namespace appmodel {
19
20 class DaphneV2Channel : public virtual dunedaq::conffwk::DalObject {
21
23 friend class conffwk::DalObject;
24 friend class conffwk::DalFactory;
26
27 protected:
28
30 virtual ~DaphneV2Channel() noexcept;
31 virtual void init(bool init_children);
32
33 public:
34
37 static const std::string& s_class_name;
38
39
49 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
50
51
61 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
62
63
64 protected:
65
66 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
67
68
69 private:
70
71 uint8_t m_gain;
72 uint16_t m_offset;
73 uint16_t m_trim;
74 uint8_t m_channel_id;
76
77
78 public:
79
80 // attribute names
81
82 inline static const std::string s_gain = "gain";
83 inline static const std::string s_offset = "offset";
84 inline static const std::string s_trim = "trim";
85 inline static const std::string s_channel_id = "channel_id";
86 inline static const std::string s_stream_id = "stream_id";
87
88 static const std::string& __get_gain_str() noexcept { return s_gain; }
89 static const std::string& __get_offset_str() noexcept { return s_offset; }
90 static const std::string& __get_trim_str() noexcept { return s_trim; }
91 static const std::string& __get_channel_id_str() noexcept { return s_channel_id; }
92 static const std::string& __get_stream_id_str() noexcept { return s_stream_id; }
93
94
102 uint8_t
103 get_gain() const
104 {
105 std::lock_guard scoped_lock(m_mutex);
106 check();
107 check_init();
108 return m_gain;
109 }
110
118 void
119 set_gain(uint8_t value)
120 {
121 std::lock_guard scoped_lock(m_mutex);
122 check();
123 clear();
124 p_obj.set_by_val(s_gain, value);
125 }
126
127
135 uint16_t
137 {
138 std::lock_guard scoped_lock(m_mutex);
139 check();
140 check_init();
141 return m_offset;
142 }
143
151 void
152 set_offset(uint16_t value)
153 {
154 std::lock_guard scoped_lock(m_mutex);
155 check();
156 clear();
157 p_obj.set_by_val(s_offset, value);
158 }
159
160
168 uint16_t
169 get_trim() const
170 {
171 std::lock_guard scoped_lock(m_mutex);
172 check();
173 check_init();
174 return m_trim;
175 }
176
184 void
185 set_trim(uint16_t value)
186 {
187 std::lock_guard scoped_lock(m_mutex);
188 check();
189 clear();
190 p_obj.set_by_val(s_trim, value);
191 }
192
193
200 uint8_t
202 {
203 std::lock_guard scoped_lock(m_mutex);
204 check();
205 check_init();
206 return m_channel_id;
207 }
208
215 void
216 set_channel_id(uint8_t value)
217 {
218 std::lock_guard scoped_lock(m_mutex);
219 check();
220 clear();
222 }
223
224
232 int8_t
234 {
235 std::lock_guard scoped_lock(m_mutex);
236 check();
237 check_init();
238 return m_stream_id;
239 }
240
248 void
249 set_stream_id(int8_t value)
250 {
251 std::lock_guard scoped_lock(m_mutex);
252 check();
253 clear();
255 }
256
257
258 };
259
260 // out stream operator
261
262 inline std::ostream& operator<<(std::ostream& s, const DaphneV2Channel& obj)
263 {
264 return obj.print_object(s);
265 }
266
267 typedef std::vector<const DaphneV2Channel*>::const_iterator DaphneV2ChannelIterator;
268
269 }
270}
271
272#endif
static const std::string & __get_stream_id_str() noexcept
static const std::string & s_class_name
virtual void init(bool init_children)
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...
static const std::string & __get_gain_str() noexcept
void set_stream_id(int8_t value)
Set "stream_id" attribute value. In Daphne v3 we might need to link a channel to a specific link ID,...
uint8_t get_gain() const
Get "gain" attribute value. gain.
uint16_t get_offset() const
Get "offset" attribute value. Pedestal for the channel.
static const std::string s_offset
static const std::string & __get_trim_str() noexcept
static const std::string s_channel_id
int8_t get_stream_id() const
Get "stream_id" attribute value. In Daphne v3 we might need to link a channel to a specific link ID,...
uint8_t get_channel_id() const
Get "channel_id" attribute value.
DaphneV2Channel(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string s_stream_id
uint16_t get_trim() const
Get "trim" attribute value. trim value for the channel.
void set_gain(uint8_t value)
Set "gain" attribute value. gain.
void set_offset(uint16_t value)
Set "offset" attribute value. Pedestal for the channel.
static const std::string & __get_offset_str() noexcept
static const std::string & __get_channel_id_str() noexcept
void set_trim(uint16_t value)
Set "trim" attribute value. trim value for the channel.
void set_channel_id(uint8_t value)
Set "channel_id" attribute 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...
conffwk entry point
double offset
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constDaphneV2Channel * >::const_iterator DaphneV2ChannelIterator
The DUNE-DAQ namespace.
msgpack::object obj
std::string trim(const std::string &s)
Definition oksdalgen.cxx:85