DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CIBApplication.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _CIBApplication_0_dunedaq__appmodel_0_appmodel_H_
4#define _CIBApplication_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 CIBConf;
26 class CIBoardConf;
27 class DataHandlerConf;
28 }
29 namespace confmodel {
30 class Session;
31 }
32}
33
34
35namespace dunedaq {
36 namespace appmodel {
37
43
44 friend class conffwk::Configuration;
45 friend class conffwk::DalObject;
46 friend class conffwk::DalFactory;
47 friend class conffwk::DalRegistry;
48
49 protected:
50
52 virtual ~CIBApplication() 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
93 const dunedaq::appmodel::CIBConf* m_generator;
94 const dunedaq::appmodel::CIBoardConf* m_board;
95 const dunedaq::appmodel::DataHandlerConf* m_link_handler;
96
97
98 public:
99
100 // relationship names
101
102 inline static const std::string s_generator = "generator";
103 inline static const std::string s_board = "board";
104 inline static const std::string s_link_handler = "link_handler";
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
110
119 {
120 std::lock_guard scoped_lock(m_mutex);
121 check();
122 check_init();
123 if (!m_generator)
124 {
125 std::ostringstream text;
126 text << "relationship \"" << s_generator << "\" of object " << this << " is not set";
127 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
128 }
129 return m_generator;
130 }
131
132
139 void
141
149 get_board() const
150 {
151 std::lock_guard scoped_lock(m_mutex);
152 check();
153 check_init();
154 if (!m_board)
155 {
156 std::ostringstream text;
157 text << "relationship \"" << s_board << "\" of object " << this << " is not set";
158 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
159 }
160 return m_board;
161 }
162
163
170 void
172
181 {
182 std::lock_guard scoped_lock(m_mutex);
183 check();
184 check_init();
185 if (!m_link_handler)
186 {
187 std::ostringstream text;
188 text << "relationship \"" << s_link_handler << "\" of object " << this << " is not set";
189 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
190 }
191 return m_link_handler;
192 }
193
194
201 void
203
204
205 public:
206
207 // user-defined algorithms
208
213 void generate_modules(const confmodel::Session*) const override;
214
215
216 virtual std::vector<const Resource*> contained_resources() const override;
217 };
218
219 // out stream operator
220
221 inline std::ostream& operator<<(std::ostream& s, const CIBApplication& obj)
222 {
223 return obj.print_object(s);
224 }
225
226 typedef std::vector<const CIBApplication*>::const_iterator CIBApplicationIterator;
227
228 }
229}
230
231#endif
#define ERS_HERE
static const std::string s_link_handler
const dunedaq::appmodel::CIBConf * get_generator() const
Get "generator" relationship value.
static const std::string & __get_generator_str() noexcept
void set_link_handler(const dunedaq::appmodel::DataHandlerConf *value)
Set "link_handler" relationship value.
virtual void init(bool init_children)
const dunedaq::appmodel::CIBoardConf * get_board() const
Get "board" relationship value.
const dunedaq::appmodel::CIBoardConf * m_board
void set_board(const dunedaq::appmodel::CIBoardConf *value)
Set "board" relationship value.
static const std::string & __get_link_handler_str() noexcept
static const std::string & __get_board_str() noexcept
virtual ~CIBApplication() noexcept
static const std::string s_board
virtual std::vector< const Resource * > contained_resources() const override
const dunedaq::appmodel::CIBConf * m_generator
const dunedaq::appmodel::DataHandlerConf * get_link_handler() const
Get "link_handler" relationship value.
void set_generator(const dunedaq::appmodel::CIBConf *value)
Set "generator" relationship value.
CIBApplication(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
void generate_modules(const confmodel::Session *) const override
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 s_generator
const dunedaq::appmodel::DataHandlerConf * m_link_handler
static const std::string & s_class_name
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::vector< constCIBApplication * >::const_iterator CIBApplicationIterator
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
Including Qt Headers.
msgpack::object obj