DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ReadoutApplication.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _ReadoutApplication_0_dunedaq__appmodel_0_appmodel_H_
4#define _ReadoutApplication_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 // include files for classes used in inheritance hierarchy
17
20
21 // forward declaration for classes used in relationships and algorithms
22
23namespace dunedaq {
24 namespace appmodel {
25 class DataHandlerConf;
26 class DataReaderConf;
27 class DataRecorderConf;
28 class FragmentAggregatorConf;
29 class RoHwConfig;
30 class SourceIDConf;
31 }
32 namespace confmodel {
33 class DetectorToDaqConnection;
34 class Session;
35 }
36}
37
38
39namespace dunedaq {
40 namespace appmodel {
41
43
45 friend class conffwk::DalObject;
46 friend class conffwk::DalFactory;
48
49 protected:
50
52 virtual ~ReadoutApplication() noexcept;
53 virtual void init(bool init_children);
54
55 public:
56
59 static const std::string& s_class_name;
60
61
71 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
72
73
83 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
84
85
86 protected:
87
88 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
89
90
91 private:
92
96 std::vector<const dunedaq::appmodel::SourceIDConf*> m_tp_source_ids;
97 const dunedaq::appmodel::RoHwConfig* m_uses;
103 std::vector<const dunedaq::confmodel::DetectorToDaqConnection*> m_detector_connections;
104
105
106 public:
107
108 // attribute names
109
110 inline static const std::string s_application_name = "application_name";
111 inline static const std::string s_tp_generation_enabled = "tp_generation_enabled";
112 inline static const std::string s_ta_generation_enabled = "ta_generation_enabled";
113
114 static const std::string& __get_application_name_str() noexcept { return s_application_name; }
115 static const std::string& __get_tp_generation_enabled_str() noexcept { return s_tp_generation_enabled; }
116 static const std::string& __get_ta_generation_enabled_str() noexcept { return s_ta_generation_enabled; }
117
118
125 const std::string&
127 {
128 std::lock_guard scoped_lock(m_mutex);
129 check();
130 check_init();
131 return m_application_name;
132 }
133
140 void
141 set_application_name(const std::string& value)
142 {
143 std::lock_guard scoped_lock(m_mutex);
144 check();
145 clear();
147 }
148
149
156 bool
158 {
159 std::lock_guard scoped_lock(m_mutex);
160 check();
161 check_init();
163 }
164
171 void
173 {
174 std::lock_guard scoped_lock(m_mutex);
175 check();
176 clear();
178 }
179
180
187 bool
189 {
190 std::lock_guard scoped_lock(m_mutex);
191 check();
192 check_init();
194 }
195
202 void
204 {
205 std::lock_guard scoped_lock(m_mutex);
206 check();
207 clear();
209 }
210
211
212 // relationship names
213
214 inline static const std::string s_tp_source_ids = "tp_source_ids";
215 inline static const std::string s_uses = "uses";
216 inline static const std::string s_link_handler = "link_handler";
217 inline static const std::string s_tp_handler = "tp_handler";
218 inline static const std::string s_data_reader = "data_reader";
219 inline static const std::string s_data_recorder = "data_recorder";
220 inline static const std::string s_fragment_aggregator = "fragment_aggregator";
221 inline static const std::string s_detector_connections = "detector_connections";
222
223 static const std::string& __get_tp_source_ids_str() noexcept { return s_tp_source_ids; }
224 static const std::string& __get_uses_str() noexcept { return s_uses; }
225 static const std::string& __get_link_handler_str() noexcept { return s_link_handler; }
226 static const std::string& __get_tp_handler_str() noexcept { return s_tp_handler; }
227 static const std::string& __get_data_reader_str() noexcept { return s_data_reader; }
228 static const std::string& __get_data_recorder_str() noexcept { return s_data_recorder; }
229 static const std::string& __get_fragment_aggregator_str() noexcept { return s_fragment_aggregator; }
230 static const std::string& __get_detector_connections_str() noexcept { return s_detector_connections; }
231
232
239 const std::vector<const dunedaq::appmodel::SourceIDConf*>&
241 {
242 std::lock_guard scoped_lock(m_mutex);
243 check();
244 check_init();
245 return m_tp_source_ids;
246 }
247
248
255 void
256 set_tp_source_ids(const std::vector<const dunedaq::appmodel::SourceIDConf*>& value);
257
266 get_uses() const
267 {
268 std::lock_guard scoped_lock(m_mutex);
269 check();
270 check_init();
271 if (!m_uses)
272 {
273 std::ostringstream text;
274 text << "relationship \"" << s_uses << "\" of object " << this << " is not set";
275 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
276 }
277 return m_uses;
278 }
279
280
288 void
290
299 {
300 std::lock_guard scoped_lock(m_mutex);
301 check();
302 check_init();
303 if (!m_link_handler)
304 {
305 std::ostringstream text;
306 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
307 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
308 }
309 return m_link_handler;
310 }
311
312
319 void
321
330 {
331 std::lock_guard scoped_lock(m_mutex);
332 check();
333 check_init();
334 return m_tp_handler;
335 }
336
337
344 void
346
355 {
356 std::lock_guard scoped_lock(m_mutex);
357 check();
358 check_init();
359 if (!m_data_reader)
360 {
361 std::ostringstream text;
362 text << "relationship \"" << s_data_reader << "\" of object " << this << " is not set";
363 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
364 }
365 return m_data_reader;
366 }
367
368
375 void
377
386 {
387 std::lock_guard scoped_lock(m_mutex);
388 check();
389 check_init();
390 return m_data_recorder;
391 }
392
393
400 void
402
411 {
412 std::lock_guard scoped_lock(m_mutex);
413 check();
414 check_init();
416 {
417 std::ostringstream text;
418 text << "relationship \"" << s_fragment_aggregator << "\" of object " << this << " is not set";
419 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
420 }
422 }
423
424
431 void
433
441 const std::vector<const dunedaq::confmodel::DetectorToDaqConnection*>&
443 {
444 std::lock_guard scoped_lock(m_mutex);
445 check();
446 check_init();
448 }
449
450
458 void
459 set_detector_connections(const std::vector<const dunedaq::confmodel::DetectorToDaqConnection*>& value);
460
461
462 public:
463
464 // user-defined algorithms
465
470 void generate_modules(const confmodel::Session*) const override;
471
472
473 virtual std::vector<const Resource*> contained_resources() const override;
474 };
475
476 // out stream operator
477
478 inline std::ostream& operator<<(std::ostream& s, const ReadoutApplication& obj)
479 {
480 return obj.print_object(s);
481 }
482
483 typedef std::vector<const ReadoutApplication*>::const_iterator ReadoutApplicationIterator;
484
485 }
486}
487
488#endif
#define ERS_HERE
const dunedaq::appmodel::DataHandlerConf * get_tp_handler() const
Get "tp_handler" relationship value.
std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > m_detector_connections
const dunedaq::appmodel::RoHwConfig * m_uses
const dunedaq::appmodel::DataRecorderConf * get_data_recorder() const
Get "data_recorder" relationship value.
const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > & get_detector_connections() const
Get "detector_connections" relationship value. The list of detector channels to be read out by this r...
bool get_ta_generation_enabled() const
Get "ta_generation_enabled" attribute value.
const dunedaq::appmodel::FragmentAggregatorConf * get_fragment_aggregator() const
Get "fragment_aggregator" relationship value.
const dunedaq::appmodel::DataHandlerConf * m_tp_handler
static const std::string & __get_data_recorder_str() noexcept
ReadoutApplication(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
const std::vector< const dunedaq::appmodel::SourceIDConf * > & get_tp_source_ids() const
Get "tp_source_ids" relationship value.
const dunedaq::appmodel::DataHandlerConf * get_link_handler() const
Get "link_handler" relationship value.
void set_ta_generation_enabled(bool value)
Set "ta_generation_enabled" attribute value.
static const std::string s_detector_connections
virtual void init(bool init_children)
static const std::string & __get_link_handler_str() noexcept
void set_application_name(const std::string &value)
Set "application_name" attribute value.
static const std::string s_ta_generation_enabled
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_uses_str() noexcept
static const std::string & __get_tp_generation_enabled_str() noexcept
const dunedaq::appmodel::DataReaderConf * m_data_reader
const dunedaq::appmodel::DataReaderConf * get_data_reader() const
Get "data_reader" relationship value.
void set_data_reader(const dunedaq::appmodel::DataReaderConf *value)
Set "data_reader" relationship value.
void set_uses(const dunedaq::appmodel::RoHwConfig *value)
Set "uses" relationship value. Configuration of the host hardware resources used by this application.
void set_data_recorder(const dunedaq::appmodel::DataRecorderConf *value)
Set "data_recorder" relationship value.
void set_tp_handler(const dunedaq::appmodel::DataHandlerConf *value)
Set "tp_handler" relationship value.
static const std::string & __get_tp_source_ids_str() noexcept
void set_link_handler(const dunedaq::appmodel::DataHandlerConf *value)
Set "link_handler" relationship value.
virtual std::vector< const Resource * > contained_resources() const override
static const std::string & __get_ta_generation_enabled_str() noexcept
bool get_tp_generation_enabled() const
Get "tp_generation_enabled" attribute value.
void set_detector_connections(const std::vector< const dunedaq::confmodel::DetectorToDaqConnection * > &value)
Set "detector_connections" relationship value. The list of detector channels to be read out by this r...
const dunedaq::appmodel::FragmentAggregatorConf * m_fragment_aggregator
void set_tp_source_ids(const std::vector< const dunedaq::appmodel::SourceIDConf * > &value)
Set "tp_source_ids" relationship value.
const std::string & get_application_name() const
Get "application_name" attribute value.
static const std::string & __get_tp_handler_str() noexcept
void set_fragment_aggregator(const dunedaq::appmodel::FragmentAggregatorConf *value)
Set "fragment_aggregator" relationship value.
const dunedaq::appmodel::RoHwConfig * get_uses() const
Get "uses" relationship value. Configuration of the host hardware resources used by this application.
static const std::string s_tp_generation_enabled
static const std::string & __get_fragment_aggregator_str() noexcept
static const std::string & __get_data_reader_str() noexcept
std::vector< const dunedaq::appmodel::SourceIDConf * > m_tp_source_ids
void generate_modules(const confmodel::Session *) const override
static const std::string & __get_application_name_str() noexcept
static const std::string & __get_detector_connections_str() noexcept
const dunedaq::appmodel::DataRecorderConf * m_data_recorder
void set_tp_generation_enabled(bool value)
Set "tp_generation_enabled" attribute value.
const dunedaq::appmodel::DataHandlerConf * m_link_handler
void set_by_val(const std::string &name, T value)
Set attribute 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::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constReadoutApplication * >::const_iterator ReadoutApplicationIterator
The DUNE-DAQ namespace.
msgpack::object obj