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 DataMoveCallbackDescriptor;
27 class DataReaderConf;
28 class DataRecorderConf;
29 class FragmentAggregatorConf;
30 class RoHwConfig;
31 class SourceIDConf;
32 }
33 namespace confmodel {
34 class DetectorToDaqConnection;
35 }
36}
37
38
39namespace dunedaq {
40 namespace appmodel {
41
43
44 friend class conffwk::Configuration;
45 friend class conffwk::DalObject;
46 friend class conffwk::DalFactory;
47 friend class conffwk::DalRegistry;
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
93 std::string m_application_name;
96 std::vector<const dunedaq::appmodel::SourceIDConf*> m_tp_source_ids;
97 const dunedaq::appmodel::RoHwConfig* m_uses;
98 const dunedaq::appmodel::DataHandlerConf* m_link_handler;
99 const dunedaq::appmodel::DataHandlerConf* m_tp_handler;
100 const dunedaq::appmodel::DataReaderConf* m_data_reader;
101 const dunedaq::appmodel::DataRecorderConf* m_data_recorder;
103 std::vector<const dunedaq::confmodel::DetectorToDaqConnection*> m_detector_connections;
105
106
107 public:
108
109 // attribute names
110
111 inline static const std::string s_application_name = "application_name";
112 inline static const std::string s_tp_generation_enabled = "tp_generation_enabled";
113 inline static const std::string s_ta_generation_enabled = "ta_generation_enabled";
114
115 static const std::string& __get_application_name_str() noexcept { return s_application_name; }
116 static const std::string& __get_tp_generation_enabled_str() noexcept { return s_tp_generation_enabled; }
117 static const std::string& __get_ta_generation_enabled_str() noexcept { return s_ta_generation_enabled; }
118
119
126 const std::string&
128 {
129 std::lock_guard scoped_lock(m_mutex);
130 check();
131 check_init();
132 return m_application_name;
133 }
134
141 void
142 set_application_name(const std::string& value)
143 {
144 std::lock_guard scoped_lock(m_mutex);
145 check();
146 clear();
148 }
149
150
157 bool
159 {
160 std::lock_guard scoped_lock(m_mutex);
161 check();
162 check_init();
164 }
165
172 void
174 {
175 std::lock_guard scoped_lock(m_mutex);
176 check();
177 clear();
179 }
180
181
188 bool
190 {
191 std::lock_guard scoped_lock(m_mutex);
192 check();
193 check_init();
195 }
196
203 void
205 {
206 std::lock_guard scoped_lock(m_mutex);
207 check();
208 clear();
210 }
211
212
213 // relationship names
214
215 inline static const std::string s_tp_source_ids = "tp_source_ids";
216 inline static const std::string s_uses = "uses";
217 inline static const std::string s_link_handler = "link_handler";
218 inline static const std::string s_tp_handler = "tp_handler";
219 inline static const std::string s_data_reader = "data_reader";
220 inline static const std::string s_data_recorder = "data_recorder";
221 inline static const std::string s_fragment_aggregator = "fragment_aggregator";
222 inline static const std::string s_detector_connections = "detector_connections";
223 inline static const std::string s_callback_desc = "callback_desc";
224
225 static const std::string& __get_tp_source_ids_str() noexcept { return s_tp_source_ids; }
226 static const std::string& __get_uses_str() noexcept { return s_uses; }
227 static const std::string& __get_link_handler_str() noexcept { return s_link_handler; }
228 static const std::string& __get_tp_handler_str() noexcept { return s_tp_handler; }
229 static const std::string& __get_data_reader_str() noexcept { return s_data_reader; }
230 static const std::string& __get_data_recorder_str() noexcept { return s_data_recorder; }
231 static const std::string& __get_fragment_aggregator_str() noexcept { return s_fragment_aggregator; }
232 static const std::string& __get_detector_connections_str() noexcept { return s_detector_connections; }
233 static const std::string& __get_callback_desc_str() noexcept { return s_callback_desc; }
234
235
242 const std::vector<const dunedaq::appmodel::SourceIDConf*>&
244 {
245 std::lock_guard scoped_lock(m_mutex);
246 check();
247 check_init();
248 return m_tp_source_ids;
249 }
250
251
258 void
259 set_tp_source_ids(const std::vector<const dunedaq::appmodel::SourceIDConf*>& value);
260
269 get_uses() const
270 {
271 std::lock_guard scoped_lock(m_mutex);
272 check();
273 check_init();
274 if (!m_uses)
275 {
276 std::ostringstream text;
277 text << "relationship \"" << s_uses << "\" of object " << this << " is not set";
278 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
279 }
280 return m_uses;
281 }
282
283
291 void
293
302 {
303 std::lock_guard scoped_lock(m_mutex);
304 check();
305 check_init();
306 if (!m_link_handler)
307 {
308 std::ostringstream text;
309 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
310 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
311 }
312 return m_link_handler;
313 }
314
315
322 void
324
333 {
334 std::lock_guard scoped_lock(m_mutex);
335 check();
336 check_init();
337 return m_tp_handler;
338 }
339
340
347 void
349
358 {
359 std::lock_guard scoped_lock(m_mutex);
360 check();
361 check_init();
362 if (!m_data_reader)
363 {
364 std::ostringstream text;
365 text << "relationship \"" << s_data_reader << "\" of object " << this << " is not set";
366 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
367 }
368 return m_data_reader;
369 }
370
371
378 void
380
389 {
390 std::lock_guard scoped_lock(m_mutex);
391 check();
392 check_init();
393 return m_data_recorder;
394 }
395
396
403 void
405
414 {
415 std::lock_guard scoped_lock(m_mutex);
416 check();
417 check_init();
419 {
420 std::ostringstream text;
421 text << "relationship \"" << s_fragment_aggregator << "\" of object " << this << " is not set";
422 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
423 }
425 }
426
427
434 void
436
444 const std::vector<const dunedaq::confmodel::DetectorToDaqConnection*>&
446 {
447 std::lock_guard scoped_lock(m_mutex);
448 check();
449 check_init();
451 }
452
453
461 void
462 set_detector_connections(const std::vector<const dunedaq::confmodel::DetectorToDaqConnection*>& value);
463
472 {
473 std::lock_guard scoped_lock(m_mutex);
474 check();
475 check_init();
476 if (!m_callback_desc)
477 {
478 std::ostringstream text;
479 text << "relationship \"" << s_callback_desc << "\" of object " << this << " is not set";
480 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
481 }
482 return m_callback_desc;
483 }
484
485
492 void
494
495
496 public:
497
498 // user-defined algorithms
499
504 void generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>) const override;
505
506
507 virtual std::vector<const Resource*> contained_resources() const override;
508 };
509
510 // out stream operator
511
512 inline std::ostream& operator<<(std::ostream& s, const ReadoutApplication& obj)
513 {
514 return obj.print_object(s);
515 }
516
517 typedef std::vector<const ReadoutApplication*>::const_iterator ReadoutApplicationIterator;
518
519 }
520}
521
522#endif
#define ERS_HERE
const dunedaq::appmodel::DataMoveCallbackDescriptor * m_callback_desc
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
const dunedaq::appmodel::DataMoveCallbackDescriptor * get_callback_desc() const
Get "callback_desc" relationship value.
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 generate_modules(std::shared_ptr< appmodel::ConfigurationHelper >) const override
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_callback_desc_str() noexcept
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 set_callback_desc(const dunedaq::appmodel::DataMoveCallbackDescriptor *value)
Set "callback_desc" relationship value.
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
Including Qt Headers.
msgpack::object obj