DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CTBApplication.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _CTBApplication_0_dunedaq__appmodel_0_appmodel_H_
4#define _CTBApplication_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 CTBConf;
26 class CTBoardConf;
27 class DataHandlerConf;
28 class SourceIDConf;
29 }
30 namespace confmodel {
31 class DaqModule;
32 class Session;
33 }
34}
35
36
37namespace dunedaq {
38 namespace appmodel {
39
45
47 friend class conffwk::DalObject;
48 friend class conffwk::DalFactory;
50
51 protected:
52
54 virtual ~CTBApplication() noexcept;
55 virtual void init(bool init_children);
56
57 public:
58
61 static const std::string& s_class_name;
62
63
73 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
74
75
85 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
86
87
88 protected:
89
90 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
91
92
93 private:
94
99
100
101 public:
102
103 // relationship names
104
105 inline static const std::string s_generator = "generator";
106 inline static const std::string s_board = "board";
107 inline static const std::string s_link_handler = "link_handler";
108 inline static const std::string s_LLT_source = "LLT_source";
109
110 static const std::string& __get_generator_str() noexcept { return s_generator; }
111 static const std::string& __get_board_str() noexcept { return s_board; }
112 static const std::string& __get_link_handler_str() noexcept { return s_link_handler; }
113 static const std::string& __get_LLT_source_str() noexcept { return s_LLT_source; }
114
115
124 {
125 std::lock_guard scoped_lock(m_mutex);
126 check();
127 check_init();
128 if (!m_generator)
129 {
130 std::ostringstream text;
131 text << "relationship \"" << s_generator << "\" of object " << this << " is not set";
132 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
133 }
134 return m_generator;
135 }
136
137
144 void
146
154 get_board() const
155 {
156 std::lock_guard scoped_lock(m_mutex);
157 check();
158 check_init();
159 if (!m_board)
160 {
161 std::ostringstream text;
162 text << "relationship \"" << s_board << "\" of object " << this << " is not set";
163 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
164 }
165 return m_board;
166 }
167
168
175 void
177
186 {
187 std::lock_guard scoped_lock(m_mutex);
188 check();
189 check_init();
190 if (!m_link_handler)
191 {
192 std::ostringstream text;
193 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
194 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
195 }
196 return m_link_handler;
197 }
198
199
206 void
208
219 {
220 std::lock_guard scoped_lock(m_mutex);
221 check();
222 check_init();
223 if (!m_LLT_source)
224 {
225 std::ostringstream text;
226 text << "relationship \"" << s_LLT_source << "\" of object " << this << " is not set";
227 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
228 }
229 return m_LLT_source;
230 }
231
232
241 void
243
244
245 public:
246
247 // user-defined algorithms
248
253 std::vector<const dunedaq::confmodel::DaqModule*> generate_modules(const confmodel::Session*) const override;
254
255
261 std::vector<std::pair<std::string, const appmodel::SourceIDConf*>> get_sources() const;
262 };
263
264 // out stream operator
265
266 inline std::ostream& operator<<(std::ostream& s, const CTBApplication& obj)
267 {
268 return obj.print_object(s);
269 }
270
271 typedef std::vector<const CTBApplication*>::const_iterator CTBApplicationIterator;
272
273 }
274}
275
276#endif
#define ERS_HERE
static const std::string s_link_handler
const dunedaq::appmodel::CTBConf * get_generator() const
Get "generator" relationship value.
void set_board(const dunedaq::appmodel::CTBoardConf *value)
Set "board" relationship value.
const dunedaq::appmodel::CTBoardConf * m_board
static const std::string & __get_link_handler_str() noexcept
const dunedaq::appmodel::SourceIDConf * m_LLT_source
static const std::string s_board
std::vector< std::pair< std::string, const appmodel::SourceIDConf * > > get_sources() const
virtual void init(bool init_children)
static const std::string s_generator
static const std::string s_LLT_source
CTBApplication(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string & __get_generator_str() noexcept
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_board_str() noexcept
void set_generator(const dunedaq::appmodel::CTBConf *value)
Set "generator" relationship value.
const dunedaq::appmodel::SourceIDConf * get_LLT_source() const
Get "LLT_source" relationship value. The source ID of the smart application itself will be used for H...
const dunedaq::appmodel::CTBoardConf * get_board() const
Get "board" relationship value.
const dunedaq::appmodel::DataHandlerConf * get_link_handler() const
Get "link_handler" relationship value.
const dunedaq::appmodel::DataHandlerConf * m_link_handler
std::vector< const dunedaq::confmodel::DaqModule * > generate_modules(const confmodel::Session *) const override
static const std::string & s_class_name
static const std::string & __get_LLT_source_str() noexcept
const dunedaq::appmodel::CTBConf * m_generator
void set_link_handler(const dunedaq::appmodel::DataHandlerConf *value)
Set "link_handler" relationship value.
void set_LLT_source(const dunedaq::appmodel::SourceIDConf *value)
Set "LLT_source" relationship value. The source ID of the smart application itself will be used for H...
The base class for any generated DAL object.
Definition DalObject.hpp:45
std::mutex m_mutex
Used to protect changes of DAL 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< constCTBApplication * >::const_iterator CTBApplicationIterator
Including Qt Headers.