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 RoHwConfig;
29 class SourceIDConf;
30 }
31 namespace confmodel {
32 class DaqModule;
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
102 std::vector<const dunedaq::confmodel::DetectorToDaqConnection*> m_detector_connections;
103
104
105 public:
106
107 // attribute names
108
109 inline static const std::string s_application_name = "application_name";
110 inline static const std::string s_tp_generation_enabled = "tp_generation_enabled";
111 inline static const std::string s_ta_generation_enabled = "ta_generation_enabled";
112
113 static const std::string& __get_application_name_str() noexcept { return s_application_name; }
114 static const std::string& __get_tp_generation_enabled_str() noexcept { return s_tp_generation_enabled; }
115 static const std::string& __get_ta_generation_enabled_str() noexcept { return s_ta_generation_enabled; }
116
117
124 const std::string&
126 {
127 std::lock_guard scoped_lock(m_mutex);
128 check();
129 check_init();
130 return m_application_name;
131 }
132
139 void
140 set_application_name(const std::string& value)
141 {
142 std::lock_guard scoped_lock(m_mutex);
143 check();
144 clear();
146 }
147
148
155 bool
157 {
158 std::lock_guard scoped_lock(m_mutex);
159 check();
160 check_init();
162 }
163
170 void
172 {
173 std::lock_guard scoped_lock(m_mutex);
174 check();
175 clear();
177 }
178
179
186 bool
188 {
189 std::lock_guard scoped_lock(m_mutex);
190 check();
191 check_init();
193 }
194
201 void
203 {
204 std::lock_guard scoped_lock(m_mutex);
205 check();
206 clear();
208 }
209
210
211 // relationship names
212
213 inline static const std::string s_tp_source_ids = "tp_source_ids";
214 inline static const std::string s_uses = "uses";
215 inline static const std::string s_link_handler = "link_handler";
216 inline static const std::string s_tp_handler = "tp_handler";
217 inline static const std::string s_data_reader = "data_reader";
218 inline static const std::string s_data_recorder = "data_recorder";
219 inline static const std::string s_detector_connections = "detector_connections";
220
221 static const std::string& __get_tp_source_ids_str() noexcept { return s_tp_source_ids; }
222 static const std::string& __get_uses_str() noexcept { return s_uses; }
223 static const std::string& __get_link_handler_str() noexcept { return s_link_handler; }
224 static const std::string& __get_tp_handler_str() noexcept { return s_tp_handler; }
225 static const std::string& __get_data_reader_str() noexcept { return s_data_reader; }
226 static const std::string& __get_data_recorder_str() noexcept { return s_data_recorder; }
227 static const std::string& __get_detector_connections_str() noexcept { return s_detector_connections; }
228
229
236 const std::vector<const dunedaq::appmodel::SourceIDConf*>&
238 {
239 std::lock_guard scoped_lock(m_mutex);
240 check();
241 check_init();
242 return m_tp_source_ids;
243 }
244
245
252 void
253 set_tp_source_ids(const std::vector<const dunedaq::appmodel::SourceIDConf*>& value);
254
263 get_uses() const
264 {
265 std::lock_guard scoped_lock(m_mutex);
266 check();
267 check_init();
268 if (!m_uses)
269 {
270 std::ostringstream text;
271 text << "relationship \"" << s_uses << "\" of object " << this << " is not set";
272 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
273 }
274 return m_uses;
275 }
276
277
285 void
287
296 {
297 std::lock_guard scoped_lock(m_mutex);
298 check();
299 check_init();
300 if (!m_link_handler)
301 {
302 std::ostringstream text;
303 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
304 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
305 }
306 return m_link_handler;
307 }
308
309
316 void
318
327 {
328 std::lock_guard scoped_lock(m_mutex);
329 check();
330 check_init();
331 return m_tp_handler;
332 }
333
334
341 void
343
352 {
353 std::lock_guard scoped_lock(m_mutex);
354 check();
355 check_init();
356 if (!m_data_reader)
357 {
358 std::ostringstream text;
359 text << "relationship \"" << s_data_reader << "\" of object " << this << " is not set";
360 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
361 }
362 return m_data_reader;
363 }
364
365
372 void
374
383 {
384 std::lock_guard scoped_lock(m_mutex);
385 check();
386 check_init();
387 return m_data_recorder;
388 }
389
390
397 void
399
407 const std::vector<const dunedaq::confmodel::DetectorToDaqConnection*>&
409 {
410 std::lock_guard scoped_lock(m_mutex);
411 check();
412 check_init();
414 }
415
416
424 void
425 set_detector_connections(const std::vector<const dunedaq::confmodel::DetectorToDaqConnection*>& value);
426
427
428 public:
429
430 // user-defined algorithms
431
436 virtual std::vector<const dunedaq::confmodel::DaqModule*> generate_modules(const confmodel::Session*) const override;
437
438
439 virtual std::vector<const Resource*> contained_resources() const override;
440 };
441
442 // out stream operator
443
444 inline std::ostream& operator<<(std::ostream& s, const ReadoutApplication& obj)
445 {
446 return obj.print_object(s);
447 }
448
449 typedef std::vector<const ReadoutApplication*>::const_iterator ReadoutApplicationIterator;
450
451 }
452}
453
454#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::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.
virtual std::vector< const dunedaq::confmodel::DaqModule * > generate_modules(const confmodel::Session *) const override
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...
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
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_data_reader_str() noexcept
std::vector< const dunedaq::appmodel::SourceIDConf * > m_tp_source_ids
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.
Definition DataStore.hpp:57
msgpack::object obj