DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
Application.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _Application_0_dunedaq__confmodel_0_confmodel_H_
4#define _Application_0_dunedaq__confmodel_0_confmodel_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
17 // forward declaration for classes used in relationships and algorithms
18
19namespace dunedaq {
20 namespace confmodel {
21 class OpMonConf;
22 class Service;
23 class VariableBase;
24 class VirtualHost;
25 }
26}
27
28
29namespace dunedaq {
30 namespace confmodel {
31
36 class Application : public virtual dunedaq::conffwk::DalObject {
37
39 friend class conffwk::DalObject;
40 friend class conffwk::DalFactory;
42
43 protected:
44
46 virtual ~Application() noexcept;
47 virtual void init(bool init_children);
48
49 public:
50
53 static const std::string& s_class_name;
54
55
65 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
66
67
77 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
78
79
80 protected:
81
82 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
83
84
85 private:
86
89 std::string m_log_path;
94
95
96 public:
97
98 // attribute names
99
100 inline static const std::string s_application_name = "application_name";
101 inline static const std::string s_commandline_parameters = "commandline_parameters";
102 inline static const std::string s_log_path = "log_path";
103
104 static const std::string& __get_application_name_str() noexcept { return s_application_name; }
105 static const std::string& __get_commandline_parameters_str() noexcept { return s_commandline_parameters; }
106 static const std::string& __get_log_path_str() noexcept { return s_log_path; }
107
108
116 const std::string&
118 {
119 std::lock_guard scoped_lock(m_mutex);
120 check();
121 check_init();
122 return m_application_name;
123 }
124
132 void
133 set_application_name(const std::string& value)
134 {
135 std::lock_guard scoped_lock(m_mutex);
136 check();
137 clear();
139 }
140
141
149 const std::vector<std::string>&
151 {
152 std::lock_guard scoped_lock(m_mutex);
153 check();
154 check_init();
156 }
157
165 void
166 set_commandline_parameters(const std::vector<std::string>& value)
167 {
168 std::lock_guard scoped_lock(m_mutex);
169 check();
170 clear();
172 }
173
174
182 const std::string&
184 {
185 std::lock_guard scoped_lock(m_mutex);
186 check();
187 check_init();
188 return m_log_path;
189 }
190
198 void
199 set_log_path(const std::string& value)
200 {
201 std::lock_guard scoped_lock(m_mutex);
202 check();
203 clear();
205 }
206
207
208 // relationship names
209
210 inline static const std::string s_application_environment = "application_environment";
211 inline static const std::string s_runs_on = "runs_on";
212 inline static const std::string s_exposes_service = "exposes_service";
213 inline static const std::string s_opmon_conf = "opmon_conf";
214
215 static const std::string& __get_application_environment_str() noexcept { return s_application_environment; }
216 static const std::string& __get_runs_on_str() noexcept { return s_runs_on; }
217 static const std::string& __get_exposes_service_str() noexcept { return s_exposes_service; }
218 static const std::string& __get_opmon_conf_str() noexcept { return s_opmon_conf; }
219
220
228 const std::vector<const dunedaq::confmodel::VariableBase*>&
230 {
231 std::lock_guard scoped_lock(m_mutex);
232 check();
233 check_init();
235 }
236
237
245 void
246 set_application_environment(const std::vector<const dunedaq::confmodel::VariableBase*>& value);
247
257 {
258 std::lock_guard scoped_lock(m_mutex);
259 check();
260 check_init();
261 if (!m_runs_on)
262 {
263 std::ostringstream text;
264 text << "relationship \"" << s_runs_on << "\" of object " << this << " is not set";
265 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
266 }
267 return m_runs_on;
268 }
269
270
278 void
280
288 const std::vector<const dunedaq::confmodel::Service*>&
290 {
291 std::lock_guard scoped_lock(m_mutex);
292 check();
293 check_init();
294 return m_exposes_service;
295 }
296
297
305 void
306 set_exposes_service(const std::vector<const dunedaq::confmodel::Service*>& value);
307
317 {
318 std::lock_guard scoped_lock(m_mutex);
319 check();
320 check_init();
321 if (!m_opmon_conf)
322 {
323 std::ostringstream text;
324 text << "relationship \"" << s_opmon_conf << "\" of object " << this << " is not set";
325 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
326 }
327 return m_opmon_conf;
328 }
329
330
338 void
340
341
342 public:
343
344 // user-defined algorithms
345
350 const std::vector<std::string> parse_commandline_parameters() const;
351 };
352
353 // out stream operator
354
355 inline std::ostream& operator<<(std::ostream& s, const Application& obj)
356 {
357 return obj.print_object(s);
358 }
359
360 typedef std::vector<const Application*>::const_iterator ApplicationIterator;
361
362 }
363}
364
365#endif
#define ERS_HERE
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.
const std::vector< std::string > parse_commandline_parameters() const
std::vector< const dunedaq::confmodel::Service * > m_exposes_service
Application(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
static const std::string s_commandline_parameters
void set_application_environment(const std::vector< const dunedaq::confmodel::VariableBase * > &value)
Set "application_environment" relationship value. Define process environment for this application.
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...
std::vector< const dunedaq::confmodel::VariableBase * > m_application_environment
std::vector< std::string > m_commandline_parameters
static const std::string s_exposes_service
const dunedaq::confmodel::OpMonConf * m_opmon_conf
static const std::string & __get_runs_on_str() noexcept
static const std::string & __get_opmon_conf_str() noexcept
const std::vector< std::string > & get_commandline_parameters() const
Get "commandline_parameters" attribute value. command line parameters to add when starting the applic...
static const std::string s_log_path
static const std::string s_application_environment
void set_log_path(const std::string &value)
Set "log_path" attribute value. Where the applications, controllers and infrastructure applications s...
const std::string & get_log_path() const
Get "log_path" attribute value. Where the applications, controllers and infrastructure applications s...
friend class conffwk::DalFactory
static const std::string & __get_commandline_parameters_str() noexcept
static const std::string s_application_name
const dunedaq::confmodel::OpMonConf * get_opmon_conf() const
Get "opmon_conf" relationship value. description of the monitoring behaviour in the application.
static const std::string & __get_application_name_str() noexcept
const std::string & get_application_name() const
Get "application_name" attribute value. Name of the application binary to run.
static const std::string & __get_exposes_service_str() noexcept
static const std::string & s_class_name
virtual ~Application() noexcept
const dunedaq::confmodel::VirtualHost * m_runs_on
virtual void init(bool init_children)
void set_runs_on(const dunedaq::confmodel::VirtualHost *value)
Set "runs_on" relationship value. VirtualHost to run this application on.
const std::vector< const dunedaq::confmodel::Service * > & get_exposes_service() const
Get "exposes_service" relationship value. Services exposed i.e. provided by this application.
void set_application_name(const std::string &value)
Set "application_name" attribute value. Name of the application binary to run.
friend class conffwk::DalObject
const dunedaq::confmodel::VirtualHost * get_runs_on() const
Get "runs_on" relationship value. VirtualHost to run this application on.
void set_opmon_conf(const dunedaq::confmodel::OpMonConf *value)
Set "opmon_conf" relationship value. description of the monitoring behaviour in the application.
void set_commandline_parameters(const std::vector< std::string > &value)
Set "commandline_parameters" attribute value. command line parameters to add when starting the applic...
const std::vector< const dunedaq::confmodel::VariableBase * > & get_application_environment() const
Get "application_environment" relationship value. Define process environment for this application.
static const std::string s_runs_on
static const std::string s_opmon_conf
void set_exposes_service(const std::vector< const dunedaq::confmodel::Service * > &value)
Set "exposes_service" relationship value. Services exposed i.e. provided by this application.
static const std::string & __get_log_path_str() noexcept
static const std::string & __get_application_environment_str() noexcept
conffwk entry point
double offset
std::vector< constApplication * >::const_iterator ApplicationIterator
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.