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
21
22 friend class conffwk::Configuration;
23 friend class conffwk::DalObject;
24 friend class conffwk::DalFactory;
25 friend class conffwk::DalRegistry;
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;
75
76
77 public:
78
79 // attribute names
80
81 inline static const std::string s_gain = "gain";
82 inline static const std::string s_offset = "offset";
83 inline static const std::string s_trim = "trim";
84 inline static const std::string s_channel_id = "channel_id";
85
86 static const std::string& __get_gain_str() noexcept { return s_gain; }
87 static const std::string& __get_offset_str() noexcept { return s_offset; }
88 static const std::string& __get_trim_str() noexcept { return s_trim; }
89 static const std::string& __get_channel_id_str() noexcept { return s_channel_id; }
90
91
99 uint8_t
100 get_gain() const
101 {
102 std::lock_guard scoped_lock(m_mutex);
103 check();
104 check_init();
105 return m_gain;
106 }
107
115 void
116 set_gain(uint8_t value)
117 {
118 std::lock_guard scoped_lock(m_mutex);
119 check();
120 clear();
121 p_obj.set_by_val(s_gain, value);
122 }
123
124
132 uint16_t
134 {
135 std::lock_guard scoped_lock(m_mutex);
136 check();
137 check_init();
138 return m_offset;
139 }
140
148 void
149 set_offset(uint16_t value)
150 {
151 std::lock_guard scoped_lock(m_mutex);
152 check();
153 clear();
154 p_obj.set_by_val(s_offset, value);
155 }
156
157
165 uint16_t
166 get_trim() const
167 {
168 std::lock_guard scoped_lock(m_mutex);
169 check();
170 check_init();
171 return m_trim;
172 }
173
181 void
182 set_trim(uint16_t value)
183 {
184 std::lock_guard scoped_lock(m_mutex);
185 check();
186 clear();
187 p_obj.set_by_val(s_trim, value);
188 }
189
190
197 uint8_t
199 {
200 std::lock_guard scoped_lock(m_mutex);
201 check();
202 check_init();
203 return m_channel_id;
204 }
205
212 void
213 set_channel_id(uint8_t value)
214 {
215 std::lock_guard scoped_lock(m_mutex);
216 check();
217 clear();
219 }
220
221
222 };
223
224 // out stream operator
225
226 inline std::ostream& operator<<(std::ostream& s, const DaphneV2Channel& obj)
227 {
228 return obj.print_object(s);
229 }
230
231 typedef std::vector<const DaphneV2Channel*>::const_iterator DaphneV2ChannelIterator;
232
233 }
234}
235
236#endif
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
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
uint8_t get_channel_id() const
Get "channel_id" attribute value.
DaphneV2Channel(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
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
virtual ~DaphneV2Channel() 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
Including Qt Headers.
std::string trim(const std::string &s)
Definition oksdalgen.cxx:85