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}
31
32
33namespace dunedaq {
34 namespace appmodel {
35
41
43 friend class conffwk::DalObject;
44 friend class conffwk::DalFactory;
46
47 protected:
48
50 virtual ~CTBApplication() noexcept;
51 virtual void init(bool init_children);
52
53 public:
54
57 static const std::string& s_class_name;
58
59
69 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
70
71
81 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
82
83
84 protected:
85
86 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
87
88
89 private:
90
91 const dunedaq::appmodel::CTBConf* m_generator;
92 const dunedaq::appmodel::CTBoardConf* m_board;
95
96
97 public:
98
99 // relationship names
100
101 inline static const std::string s_generator = "generator";
102 inline static const std::string s_board = "board";
103 inline static const std::string s_link_handler = "link_handler";
104 inline static const std::string s_LLT_source = "LLT_source";
105
106 static const std::string& __get_generator_str() noexcept { return s_generator; }
107 static const std::string& __get_board_str() noexcept { return s_board; }
108 static const std::string& __get_link_handler_str() noexcept { return s_link_handler; }
109 static const std::string& __get_LLT_source_str() noexcept { return s_LLT_source; }
110
111
120 {
121 std::lock_guard scoped_lock(m_mutex);
122 check();
123 check_init();
124 if (!m_generator)
125 {
126 std::ostringstream text;
127 text << "relationship \"" << s_generator << "\" of object " << this << " is not set";
128 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
129 }
130 return m_generator;
131 }
132
133
140 void
142
150 get_board() const
151 {
152 std::lock_guard scoped_lock(m_mutex);
153 check();
154 check_init();
155 if (!m_board)
156 {
157 std::ostringstream text;
158 text << "relationship \"" << s_board << "\" of object " << this << " is not set";
159 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
160 }
161 return m_board;
162 }
163
164
171 void
173
182 {
183 std::lock_guard scoped_lock(m_mutex);
184 check();
185 check_init();
186 if (!m_link_handler)
187 {
188 std::ostringstream text;
189 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
190 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
191 }
192 return m_link_handler;
193 }
194
195
202 void
204
215 {
216 std::lock_guard scoped_lock(m_mutex);
217 check();
218 check_init();
219 if (!m_LLT_source)
220 {
221 std::ostringstream text;
222 text << "relationship \"" << s_LLT_source << "\" of object " << this << " is not set";
223 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
224 }
225 return m_LLT_source;
226 }
227
228
237 void
239
240
241 public:
242
243 // user-defined algorithms
244
249 void generate_modules(std::shared_ptr<appmodel::ConfigurationHelper>) const override;
250
251
257 std::vector<std::pair<std::string, const appmodel::SourceIDConf*>> get_sources() const;
258
259
260 virtual std::vector<const Resource*> contained_resources() const override;
261 };
262
263 // out stream operator
264
265 inline std::ostream& operator<<(std::ostream& s, const CTBApplication& obj)
266 {
267 return obj.print_object(s);
268 }
269
270 typedef std::vector<const CTBApplication*>::const_iterator CTBApplicationIterator;
271
272 }
273}
274
275#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
static const std::string & s_class_name
static const std::string & __get_LLT_source_str() noexcept
const dunedaq::appmodel::CTBConf * m_generator
void generate_modules(std::shared_ptr< appmodel::ConfigurationHelper >) const override
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...
virtual std::vector< const Resource * > contained_resources() const override
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.
msgpack::object obj