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;
91
92
93 public:
94
95 // attribute names
96
97 inline static const std::string s_template_for = "template_for";
98 inline static const std::string s_input_data_type = "input_data_type";
99 inline static const std::string s_generate_timesync = "generate_timesync";
100 inline static const std::string s_post_processing_delay_ticks = "post_processing_delay_ticks";
101 inline static const std::string s_post_processing_delay_min_wait = "post_processing_delay_min_wait";
102 inline static const std::string s_post_processing_delay_max_wait = "post_processing_delay_max_wait";
103
104 static const std::string& __get_template_for_str() noexcept { return s_template_for; }
105 static const std::string& __get_input_data_type_str() noexcept { return s_input_data_type; }
106 static const std::string& __get_generate_timesync_str() noexcept { return s_generate_timesync; }
107 static const std::string& __get_post_processing_delay_ticks_str() noexcept { return s_post_processing_delay_ticks; }
108 static const std::string& __get_post_processing_delay_min_wait_str() noexcept { return s_post_processing_delay_min_wait; }
109 static const std::string& __get_post_processing_delay_max_wait_str() noexcept { return s_post_processing_delay_max_wait; }
110
111
118 const std::string&
120 {
121 std::lock_guard scoped_lock(m_mutex);
122 check();
123 check_init();
124 return m_template_for;
125 }
126
133 void
134 set_template_for(const std::string& value)
135 {
136 std::lock_guard scoped_lock(m_mutex);
137 check();
138 clear();
140 }
141
142
150 const std::string&
152 {
153 std::lock_guard scoped_lock(m_mutex);
154 check();
155 check_init();
156 return m_input_data_type;
157 }
158
166 void
167 set_input_data_type(const std::string& value)
168 {
169 std::lock_guard scoped_lock(m_mutex);
170 check();
171 clear();
173 }
174
175
182 bool
184 {
185 std::lock_guard scoped_lock(m_mutex);
186 check();
187 check_init();
188 return m_generate_timesync;
189 }
190
197 void
199 {
200 std::lock_guard scoped_lock(m_mutex);
201 check();
202 clear();
204 }
205
206
214 uint64_t
216 {
217 std::lock_guard scoped_lock(m_mutex);
218 check();
219 check_init();
221 }
222
230 void
232 {
233 std::lock_guard scoped_lock(m_mutex);
234 check();
235 clear();
237 }
238
239
247 uint64_t
249 {
250 std::lock_guard scoped_lock(m_mutex);
251 check();
252 check_init();
254 }
255
263 void
265 {
266 std::lock_guard scoped_lock(m_mutex);
267 check();
268 clear();
270 }
271
272
280 uint64_t
282 {
283 std::lock_guard scoped_lock(m_mutex);
284 check();
285 check_init();
287 }
288
296 void
298 {
299 std::lock_guard scoped_lock(m_mutex);
300 check();
301 clear();
303 }
304
305
306 // relationship names
307
308 inline static const std::string s_request_handler = "request_handler";
309 inline static const std::string s_latency_buffer = "latency_buffer";
310 inline static const std::string s_data_processor = "data_processor";
311
312 static const std::string& __get_request_handler_str() noexcept { return s_request_handler; }
313 static const std::string& __get_latency_buffer_str() noexcept { return s_latency_buffer; }
314 static const std::string& __get_data_processor_str() noexcept { return s_data_processor; }
315
316
325 {
326 std::lock_guard scoped_lock(m_mutex);
327 check();
328 check_init();
330 {
331 std::ostringstream text;
332 text << "relationship \"" << s_request_handler << "\" of object " << this << " is not set";
333 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
334 }
335 return m_request_handler;
336 }
337
338
345 void
347
356 {
357 std::lock_guard scoped_lock(m_mutex);
358 check();
359 check_init();
360 if (!m_latency_buffer)
361 {
362 std::ostringstream text;
363 text << "relationship \"" << s_latency_buffer << "\" of object " << this << " is not set";
364 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
365 }
366 return m_latency_buffer;
367 }
368
369
376 void
378
387 {
388 std::lock_guard scoped_lock(m_mutex);
389 check();
390 check_init();
391 if (!m_data_processor)
392 {
393 std::ostringstream text;
394 text << "relationship \"" << s_data_processor << "\" of object " << this << " is not set";
395 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
396 }
397 return m_data_processor;
398 }
399
400
407 void
409
410 };
411
412 // out stream operator
413
414 inline std::ostream& operator<<(std::ostream& s, const DataHandlerConf& obj)
415 {
416 return obj.print_object(s);
417 }
418
419 typedef std::vector<const DataHandlerConf*>::const_iterator DataHandlerConfIterator;
420
421 }
422}
423
424#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.
uint64_t get_post_processing_delay_max_wait() const
Get "post_processing_delay_max_wait" attribute value. Maximum wait time (ms) before post processing c...
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
uint64_t get_post_processing_delay_min_wait() const
Get "post_processing_delay_min_wait" attribute value. Minimum time (ms) between consecutive post proc...
static const std::string & __get_post_processing_delay_ticks_str() noexcept
const dunedaq::appmodel::DataProcessor * m_data_processor
static const std::string s_post_processing_delay_max_wait
static const std::string & __get_post_processing_delay_min_wait_str() noexcept
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
void set_post_processing_delay_max_wait(uint64_t value)
Set "post_processing_delay_max_wait" attribute value. Maximum wait time (ms) before post processing c...
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_post_processing_delay_min_wait(uint64_t value)
Set "post_processing_delay_min_wait" attribute value. Minimum time (ms) between consecutive post proc...
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.
static const std::string s_post_processing_delay_min_wait
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
static const std::string & __get_post_processing_delay_max_wait_str() 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)
The DUNE-DAQ namespace.
Definition DataStore.hpp:57
msgpack::object obj