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 Session;
32 }
33}
34
35
36namespace dunedaq {
37 namespace appmodel {
38
44
46 friend class conffwk::DalObject;
47 friend class conffwk::DalFactory;
49
50 protected:
51
53 virtual ~CTBApplication() noexcept;
54 virtual void init(bool init_children);
55
56 public:
57
60 static const std::string& s_class_name;
61
62
72 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
73
74
84 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
85
86
87 protected:
88
89 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
90
91
92 private:
93
94 const dunedaq::appmodel::CTBConf* m_generator;
95 const dunedaq::appmodel::CTBoardConf* m_board;
98
99
100 public:
101
102 // relationship names
103
104 inline static const std::string s_generator = "generator";
105 inline static const std::string s_board = "board";
106 inline static const std::string s_link_handler = "link_handler";
107 inline static const std::string s_LLT_source = "LLT_source";
108
109 static const std::string& __get_generator_str() noexcept { return s_generator; }
110 static const std::string& __get_board_str() noexcept { return s_board; }
111 static const std::string& __get_link_handler_str() noexcept { return s_link_handler; }
112 static const std::string& __get_LLT_source_str() noexcept { return s_LLT_source; }
113
114
123 {
124 std::lock_guard scoped_lock(m_mutex);
125 check();
126 check_init();
127 if (!m_generator)
128 {
129 std::ostringstream text;
130 text << "relationship \"" << s_generator << "\" of object " << this << " is not set";
131 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
132 }
133 return m_generator;
134 }
135
136
143 void
145
153 get_board() const
154 {
155 std::lock_guard scoped_lock(m_mutex);
156 check();
157 check_init();
158 if (!m_board)
159 {
160 std::ostringstream text;
161 text << "relationship \"" << s_board << "\" of object " << this << " is not set";
162 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
163 }
164 return m_board;
165 }
166
167
174 void
176
185 {
186 std::lock_guard scoped_lock(m_mutex);
187 check();
188 check_init();
189 if (!m_link_handler)
190 {
191 std::ostringstream text;
192 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
193 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
194 }
195 return m_link_handler;
196 }
197
198
205 void
207
218 {
219 std::lock_guard scoped_lock(m_mutex);
220 check();
221 check_init();
222 if (!m_LLT_source)
223 {
224 std::ostringstream text;
225 text << "relationship \"" << s_LLT_source << "\" of object " << this << " is not set";
226 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
227 }
228 return m_LLT_source;
229 }
230
231
240 void
242
243
244 public:
245
246 // user-defined algorithms
247
252 void generate_modules(const confmodel::Session*) const override;
253
254
260 std::vector<std::pair<std::string, const appmodel::SourceIDConf*>> get_sources() const;
261
262
263 virtual std::vector<const Resource*> contained_resources() const override;
264 };
265
266 // out stream operator
267
268 inline std::ostream& operator<<(std::ostream& s, const CTBApplication& obj)
269 {
270 return obj.print_object(s);
271 }
272
273 typedef std::vector<const CTBApplication*>::const_iterator CTBApplicationIterator;
274
275 }
276}
277
278#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.
void generate_modules(const confmodel::Session *) const override
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 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
The DUNE-DAQ namespace.
msgpack::object obj