DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
RequestHandler.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _RequestHandler_0_dunedaq__appmodel_0_appmodel_H_
4#define _RequestHandler_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 DataRecorderConf;
22 }
23}
24
25
26namespace dunedaq {
27 namespace appmodel {
28
30
31 friend class conffwk::Configuration;
32 friend class conffwk::DalObject;
33 friend class conffwk::DalFactory;
34 friend class conffwk::DalRegistry;
35
36 protected:
37
39 virtual ~RequestHandler() noexcept;
40 virtual void init(bool init_children);
41
42 public:
43
46 static const std::string& s_class_name;
47
48
58 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
59
60
70 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
71
72
73 protected:
74
75 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
76
77
78 private:
79
80 uint16_t m_handler_threads;
81 uint32_t m_request_timeout;
82 float m_pop_limit_pct;
83 float m_pop_size_pct;
88
89
90 public:
91
92 // attribute names
93
94 inline static const std::string s_handler_threads = "handler_threads";
95 inline static const std::string s_request_timeout = "request_timeout";
96 inline static const std::string s_pop_limit_pct = "pop_limit_pct";
97 inline static const std::string s_pop_size_pct = "pop_size_pct";
98 inline static const std::string s_warn_on_timeout = "warn_on_timeout";
99 inline static const std::string s_warn_on_empty_buffer = "warn_on_empty_buffer";
100 inline static const std::string s_periodic_data_transmission_ms = "periodic_data_transmission_ms";
101
102 static const std::string& __get_handler_threads_str() noexcept { return s_handler_threads; }
103 static const std::string& __get_request_timeout_str() noexcept { return s_request_timeout; }
104 static const std::string& __get_pop_limit_pct_str() noexcept { return s_pop_limit_pct; }
105 static const std::string& __get_pop_size_pct_str() noexcept { return s_pop_size_pct; }
106 static const std::string& __get_warn_on_timeout_str() noexcept { return s_warn_on_timeout; }
107 static const std::string& __get_warn_on_empty_buffer_str() noexcept { return s_warn_on_empty_buffer; }
108 static const std::string& __get_periodic_data_transmission_ms_str() noexcept { return s_periodic_data_transmission_ms; }
109
110
118 uint16_t
120 {
121 std::lock_guard scoped_lock(m_mutex);
122 check();
123 check_init();
124 return m_handler_threads;
125 }
126
134 void
135 set_handler_threads(uint16_t value)
136 {
137 std::lock_guard scoped_lock(m_mutex);
138 check();
139 clear();
141 }
142
143
151 uint32_t
153 {
154 std::lock_guard scoped_lock(m_mutex);
155 check();
156 check_init();
157 return m_request_timeout;
158 }
159
167 void
168 set_request_timeout(uint32_t value)
169 {
170 std::lock_guard scoped_lock(m_mutex);
171 check();
172 clear();
174 }
175
176
184 float
186 {
187 std::lock_guard scoped_lock(m_mutex);
188 check();
189 check_init();
190 return m_pop_limit_pct;
191 }
192
200 void
201 set_pop_limit_pct(float value)
202 {
203 std::lock_guard scoped_lock(m_mutex);
204 check();
205 clear();
207 }
208
209
217 float
219 {
220 std::lock_guard scoped_lock(m_mutex);
221 check();
222 check_init();
223 return m_pop_size_pct;
224 }
225
233 void
234 set_pop_size_pct(float value)
235 {
236 std::lock_guard scoped_lock(m_mutex);
237 check();
238 clear();
240 }
241
242
249 bool
251 {
252 std::lock_guard scoped_lock(m_mutex);
253 check();
254 check_init();
255 return m_warn_on_timeout;
256 }
257
264 void
266 {
267 std::lock_guard scoped_lock(m_mutex);
268 check();
269 clear();
271 }
272
273
280 bool
282 {
283 std::lock_guard scoped_lock(m_mutex);
284 check();
285 check_init();
287 }
288
295 void
297 {
298 std::lock_guard scoped_lock(m_mutex);
299 check();
300 clear();
302 }
303
304
312 uint32_t
314 {
315 std::lock_guard scoped_lock(m_mutex);
316 check();
317 check_init();
319 }
320
328 void
330 {
331 std::lock_guard scoped_lock(m_mutex);
332 check();
333 clear();
335 }
336
337
338 // relationship names
339
340 inline static const std::string s_data_recorder = "data_recorder";
341
342 static const std::string& __get_data_recorder_str() noexcept { return s_data_recorder; }
343
344
353 {
354 std::lock_guard scoped_lock(m_mutex);
355 check();
356 check_init();
357 return m_data_recorder;
358 }
359
360
367 void
369
370 };
371
372 // out stream operator
373
374 inline std::ostream& operator<<(std::ostream& s, const RequestHandler& obj)
375 {
376 return obj.print_object(s);
377 }
378
379 typedef std::vector<const RequestHandler*>::const_iterator RequestHandlerIterator;
380
381 }
382}
383
384#endif
static const std::string & __get_warn_on_empty_buffer_str() noexcept
static const std::string s_periodic_data_transmission_ms
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...
float get_pop_limit_pct() const
Get "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.
void set_request_timeout(uint32_t value)
Set "request_timeout" attribute value. Request timeout in milliseconds.
virtual ~RequestHandler() noexcept
uint32_t get_periodic_data_transmission_ms() const
Get "periodic_data_transmission_ms" attribute value. Period at which data are sent out,...
bool get_warn_on_timeout() const
Get "warn_on_timeout" attribute value.
void set_data_recorder(const dunedaq::appmodel::DataRecorderConf *value)
Set "data_recorder" relationship value.
static const std::string & __get_warn_on_timeout_str() noexcept
static const std::string & __get_data_recorder_str() noexcept
float get_pop_size_pct() const
Get "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.
void set_warn_on_empty_buffer(bool value)
Set "warn_on_empty_buffer" attribute value.
static const std::string & __get_request_timeout_str() noexcept
void set_warn_on_timeout(bool value)
Set "warn_on_timeout" attribute value.
static const std::string s_request_timeout
RequestHandler(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string s_handler_threads
static const std::string s_warn_on_timeout
uint16_t get_handler_threads() const
Get "handler_threads" attribute value. Number of threads tohandle this link.
static const std::string & s_class_name
static const std::string s_data_recorder
static const std::string & __get_pop_limit_pct_str() noexcept
void set_pop_size_pct(float value)
Set "pop_size_pct" attribute value. Percentage of current occupancy to pop from the latency buffer.
static const std::string s_pop_size_pct
static const std::string & __get_periodic_data_transmission_ms_str() noexcept
void set_handler_threads(uint16_t value)
Set "handler_threads" attribute value. Number of threads tohandle this link.
void set_pop_limit_pct(float value)
Set "pop_limit_pct" attribute value. Latency buffer occupancy percentage to issue an auto-pop.
void set_periodic_data_transmission_ms(uint32_t value)
Set "periodic_data_transmission_ms" attribute value. Period at which data are sent out,...
static const std::string s_warn_on_empty_buffer
uint32_t get_request_timeout() const
Get "request_timeout" attribute value. Request timeout in milliseconds.
virtual void init(bool init_children)
bool get_warn_on_empty_buffer() const
Get "warn_on_empty_buffer" attribute value.
const dunedaq::appmodel::DataRecorderConf * get_data_recorder() const
Get "data_recorder" relationship value.
static const std::string & __get_pop_size_pct_str() noexcept
static const std::string s_pop_limit_pct
static const std::string & __get_handler_threads_str() noexcept
const dunedaq::appmodel::DataRecorderConf * m_data_recorder
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< constRequestHandler * >::const_iterator RequestHandlerIterator
Including Qt Headers.