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 Session;
34 }
35}
36
37
38namespace dunedaq {
39 namespace appmodel {
40
42
43 friend class conffwk::Configuration;
44 friend class conffwk::DalObject;
45 friend class conffwk::DalFactory;
46 friend class conffwk::DalRegistry;
47
48 protected:
49
51 virtual ~ReadoutApplication() noexcept;
52 virtual void init(bool init_children);
53
54 public:
55
58 static const std::string& s_class_name;
59
60
70 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
71
72
82 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
83
84
85 protected:
86
87 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
88
89
90 private:
91
92 std::string m_application_name;
101
102
103 public:
104
105 // attribute names
106
107 inline static const std::string s_application_name = "application_name";
108 inline static const std::string s_tp_generation_enabled = "tp_generation_enabled";
109 inline static const std::string s_ta_generation_enabled = "ta_generation_enabled";
110
111 static const std::string& __get_application_name_str() noexcept { return s_application_name; }
112 static const std::string& __get_tp_generation_enabled_str() noexcept { return s_tp_generation_enabled; }
113 static const std::string& __get_ta_generation_enabled_str() noexcept { return s_ta_generation_enabled; }
114
115
122 const std::string&
124 {
125 std::lock_guard scoped_lock(m_mutex);
126 check();
127 check_init();
128 return m_application_name;
129 }
130
137 void
138 set_application_name(const std::string& value)
139 {
140 std::lock_guard scoped_lock(m_mutex);
141 check();
142 clear();
144 }
145
146
153 bool
155 {
156 std::lock_guard scoped_lock(m_mutex);
157 check();
158 check_init();
160 }
161
168 void
170 {
171 std::lock_guard scoped_lock(m_mutex);
172 check();
173 clear();
175 }
176
177
184 bool
186 {
187 std::lock_guard scoped_lock(m_mutex);
188 check();
189 check_init();
191 }
192
199 void
201 {
202 std::lock_guard scoped_lock(m_mutex);
203 check();
204 clear();
206 }
207
208
209 // relationship names
210
211 inline static const std::string s_tp_source_ids = "tp_source_ids";
212 inline static const std::string s_uses = "uses";
213 inline static const std::string s_link_handler = "link_handler";
214 inline static const std::string s_tp_handler = "tp_handler";
215 inline static const std::string s_data_reader = "data_reader";
216 inline static const std::string s_data_recorder = "data_recorder";
217
218 static const std::string& __get_tp_source_ids_str() noexcept { return s_tp_source_ids; }
219 static const std::string& __get_uses_str() noexcept { return s_uses; }
220 static const std::string& __get_link_handler_str() noexcept { return s_link_handler; }
221 static const std::string& __get_tp_handler_str() noexcept { return s_tp_handler; }
222 static const std::string& __get_data_reader_str() noexcept { return s_data_reader; }
223 static const std::string& __get_data_recorder_str() noexcept { return s_data_recorder; }
224
225
232 const std::vector<const dunedaq::appmodel::SourceIDConf*>&
234 {
235 std::lock_guard scoped_lock(m_mutex);
236 check();
237 check_init();
238 return m_tp_source_ids;
239 }
240
241
248 void
249 set_tp_source_ids(const std::vector<const dunedaq::appmodel::SourceIDConf*>& value);
250
259 get_uses() const
260 {
261 std::lock_guard scoped_lock(m_mutex);
262 check();
263 check_init();
264 if (!m_uses)
265 {
266 std::ostringstream text;
267 text << "relationship \"" << s_uses << "\" of object " << this << " is not set";
268 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
269 }
270 return m_uses;
271 }
272
273
281 void
283
292 {
293 std::lock_guard scoped_lock(m_mutex);
294 check();
295 check_init();
296 if (!m_link_handler)
297 {
298 std::ostringstream text;
299 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
300 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
301 }
302 return m_link_handler;
303 }
304
305
312 void
314
323 {
324 std::lock_guard scoped_lock(m_mutex);
325 check();
326 check_init();
327 return m_tp_handler;
328 }
329
330
337 void
339
348 {
349 std::lock_guard scoped_lock(m_mutex);
350 check();
351 check_init();
352 if (!m_data_reader)
353 {
354 std::ostringstream text;
355 text << "relationship \"" << s_data_reader << "\" of object " << this << " is not set";
356 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
357 }
358 return m_data_reader;
359 }
360
361
368 void
370
379 {
380 std::lock_guard scoped_lock(m_mutex);
381 check();
382 check_init();
383 return m_data_recorder;
384 }
385
386
393 void
395
396
397 public:
398
399 // user-defined algorithms
400
405 virtual std::vector<const dunedaq::confmodel::DaqModule*> generate_modules(const confmodel::Session*) const override;
406 };
407
408 // out stream operator
409
410 inline std::ostream& operator<<(std::ostream& s, const ReadoutApplication& obj)
411 {
412 return obj.print_object(s);
413 }
414
415 typedef std::vector<const ReadoutApplication*>::const_iterator ReadoutApplicationIterator;
416
417 }
418}
419
420#endif
#define ERS_HERE
const dunedaq::appmodel::DataHandlerConf * get_tp_handler() const
Get "tp_handler" relationship value.
virtual std::vector< const dunedaq::confmodel::DaqModule * > generate_modules(const confmodel::Session *) const override
const dunedaq::appmodel::RoHwConfig * m_uses
const dunedaq::appmodel::DataRecorderConf * get_data_recorder() const
Get "data_recorder" relationship value.
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 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.
static const std::string & __get_ta_generation_enabled_str() noexcept
bool get_tp_generation_enabled() const
Get "tp_generation_enabled" attribute value.
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
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.