DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DataHandlerConf.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DataHandlerConf_0_dunedaq__appmodel_0_appmodel_H_
4#define _DataHandlerConf_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
17 // forward declaration for classes used in relationships and algorithms
18
19namespace dunedaq {
20 namespace appmodel {
21 class DataProcessor;
22 class LatencyBuffer;
23 class RequestHandler;
24 }
25}
26
27
28namespace dunedaq {
29 namespace appmodel {
30
32
33 friend class conffwk::Configuration;
34 friend class conffwk::DalObject;
35 friend class conffwk::DalFactory;
36 friend class conffwk::DalRegistry;
37
38 protected:
39
41 virtual ~DataHandlerConf() noexcept;
42 virtual void init(bool init_children);
43
44 public:
45
48 static const std::string& s_class_name;
49
50
60 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
61
62
72 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
73
74
75 protected:
76
77 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
78
79
80 private:
81
82 std::string m_template_for;
83 std::string m_input_data_type;
89
90
91 public:
92
93 // attribute names
94
95 inline static const std::string s_template_for = "template_for";
96 inline static const std::string s_input_data_type = "input_data_type";
97 inline static const std::string s_generate_timesync = "generate_timesync";
98 inline static const std::string s_post_processing_delay_ticks = "post_processing_delay_ticks";
99
100 static const std::string& __get_template_for_str() noexcept { return s_template_for; }
101 static const std::string& __get_input_data_type_str() noexcept { return s_input_data_type; }
102 static const std::string& __get_generate_timesync_str() noexcept { return s_generate_timesync; }
103 static const std::string& __get_post_processing_delay_ticks_str() noexcept { return s_post_processing_delay_ticks; }
104
105
112 const std::string&
114 {
115 std::lock_guard scoped_lock(m_mutex);
116 check();
117 check_init();
118 return m_template_for;
119 }
120
127 void
128 set_template_for(const std::string& value)
129 {
130 std::lock_guard scoped_lock(m_mutex);
131 check();
132 clear();
134 }
135
136
144 const std::string&
146 {
147 std::lock_guard scoped_lock(m_mutex);
148 check();
149 check_init();
150 return m_input_data_type;
151 }
152
160 void
161 set_input_data_type(const std::string& value)
162 {
163 std::lock_guard scoped_lock(m_mutex);
164 check();
165 clear();
167 }
168
169
176 bool
178 {
179 std::lock_guard scoped_lock(m_mutex);
180 check();
181 check_init();
182 return m_generate_timesync;
183 }
184
191 void
193 {
194 std::lock_guard scoped_lock(m_mutex);
195 check();
196 clear();
198 }
199
200
208 uint64_t
210 {
211 std::lock_guard scoped_lock(m_mutex);
212 check();
213 check_init();
215 }
216
224 void
226 {
227 std::lock_guard scoped_lock(m_mutex);
228 check();
229 clear();
231 }
232
233
234 // relationship names
235
236 inline static const std::string s_request_handler = "request_handler";
237 inline static const std::string s_latency_buffer = "latency_buffer";
238 inline static const std::string s_data_processor = "data_processor";
239
240 static const std::string& __get_request_handler_str() noexcept { return s_request_handler; }
241 static const std::string& __get_latency_buffer_str() noexcept { return s_latency_buffer; }
242 static const std::string& __get_data_processor_str() noexcept { return s_data_processor; }
243
244
253 {
254 std::lock_guard scoped_lock(m_mutex);
255 check();
256 check_init();
258 {
259 std::ostringstream text;
260 text << "relationship \"" << s_request_handler << "\" of object " << this << " is not set";
261 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
262 }
263 return m_request_handler;
264 }
265
266
273 void
275
284 {
285 std::lock_guard scoped_lock(m_mutex);
286 check();
287 check_init();
288 if (!m_latency_buffer)
289 {
290 std::ostringstream text;
291 text << "relationship \"" << s_latency_buffer << "\" of object " << this << " is not set";
292 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
293 }
294 return m_latency_buffer;
295 }
296
297
304 void
306
315 {
316 std::lock_guard scoped_lock(m_mutex);
317 check();
318 check_init();
319 if (!m_data_processor)
320 {
321 std::ostringstream text;
322 text << "relationship \"" << s_data_processor << "\" of object " << this << " is not set";
323 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
324 }
325 return m_data_processor;
326 }
327
328
335 void
337
338 };
339
340 // out stream operator
341
342 inline std::ostream& operator<<(std::ostream& s, const DataHandlerConf& obj)
343 {
344 return obj.print_object(s);
345 }
346
347 typedef std::vector<const DataHandlerConf*>::const_iterator DataHandlerConfIterator;
348
349 }
350}
351
352#endif
#define ERS_HERE
void set_template_for(const std::string &value)
Set "template_for" attribute value.
static const std::string s_generate_timesync
virtual ~DataHandlerConf() noexcept
static const std::string s_latency_buffer
void set_post_processing_delay_ticks(uint64_t value)
Set "post_processing_delay_ticks" attribute value. Number of clock tick by which post processing of i...
static const std::string & __get_template_for_str() noexcept
const std::string & get_input_data_type() const
Get "input_data_type" attribute value. Type of data received by this readout module.
const std::string & get_template_for() const
Get "template_for" attribute value.
const dunedaq::appmodel::LatencyBuffer * get_latency_buffer() const
Get "latency_buffer" relationship value.
virtual void init(bool init_children)
uint64_t get_post_processing_delay_ticks() const
Get "post_processing_delay_ticks" attribute value. Number of clock tick by which post processing of i...
void set_data_processor(const dunedaq::appmodel::DataProcessor *value)
Set "data_processor" relationship value.
static const std::string s_request_handler
static const std::string s_data_processor
const dunedaq::appmodel::DataProcessor * get_data_processor() const
Get "data_processor" relationship value.
static const std::string & s_class_name
void set_request_handler(const dunedaq::appmodel::RequestHandler *value)
Set "request_handler" relationship value.
static const std::string s_post_processing_delay_ticks
static const std::string s_template_for
void set_generate_timesync(bool value)
Set "generate_timesync" attribute value.
static const std::string s_input_data_type
static const std::string & __get_generate_timesync_str() noexcept
static const std::string & __get_post_processing_delay_ticks_str() noexcept
const dunedaq::appmodel::DataProcessor * m_data_processor
static const std::string & __get_request_handler_str() noexcept
const dunedaq::appmodel::RequestHandler * get_request_handler() const
Get "request_handler" relationship value.
const dunedaq::appmodel::RequestHandler * m_request_handler
static const std::string & __get_input_data_type_str() noexcept
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...
void set_input_data_type(const std::string &value)
Set "input_data_type" attribute value. Type of data received by this readout module.
static const std::string & __get_data_processor_str() noexcept
void set_latency_buffer(const dunedaq::appmodel::LatencyBuffer *value)
Set "latency_buffer" relationship value.
const dunedaq::appmodel::LatencyBuffer * m_latency_buffer
static const std::string & __get_latency_buffer_str() noexcept
bool get_generate_timesync() const
Get "generate_timesync" attribute value.
DataHandlerConf(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
void set_by_val(const std::string &name, T value)
Set attribute value.
void set_class(const std::string &name, const std::string &value)
Set attribute class value.
void set_by_ref(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::vector< constDataHandlerConf * >::const_iterator DataHandlerConfIterator
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
Including Qt Headers.