DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ActionPlan.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _ActionPlan_0_dunedaq__confmodel_0_confmodel_H_
4#define _ActionPlan_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 DaqModulesGroup;
22 class FSMCommand;
23 }
24}
25
26
27namespace dunedaq {
28 namespace confmodel {
29
34 class ActionPlan : public virtual dunedaq::conffwk::DalObject {
35
37 friend class conffwk::DalObject;
38 friend class conffwk::DalFactory;
40
41 protected:
42
44 virtual ~ActionPlan() noexcept;
45 virtual void init(bool init_children);
46
47 public:
48
51 static const std::string& s_class_name;
52
53
63 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
64
65
75 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
76
77
78 protected:
79
80 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
81
82
83 private:
84
88
89
90 public:
91
92 // attribute names
93
94 inline static const std::string s_execution_policy = "execution_policy";
95
96 static const std::string& __get_execution_policy_str() noexcept { return s_execution_policy; }
97
98
103 struct Execution_policy {
104 inline static const std::string Modules_in_parallel = "modules-in-parallel";
105 inline static const std::string Modules_in_series = "modules-in-series";
106 };
107
115 const std::string&
117 {
118 std::lock_guard scoped_lock(m_mutex);
119 check();
120 check_init();
121 return m_execution_policy;
122 }
123
131 void
132 set_execution_policy(const std::string& value)
133 {
134 std::lock_guard scoped_lock(m_mutex);
135 check();
136 clear();
138 }
139
140
141 // relationship names
142
143 inline static const std::string s_command = "command";
144 inline static const std::string s_steps = "steps";
145
146 static const std::string& __get_command_str() noexcept { return s_command; }
147 static const std::string& __get_steps_str() noexcept { return s_steps; }
148
149
158 {
159 std::lock_guard scoped_lock(m_mutex);
160 check();
161 check_init();
162 if (!m_command)
163 {
164 std::ostringstream text;
165 text << "relationship \"" << s_command << "\" of object " << this << " is not set";
166 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
167 }
168 return m_command;
169 }
170
171
178 void
180
187 const std::vector<const dunedaq::confmodel::DaqModulesGroup*>&
188 get_steps() const
189 {
190 std::lock_guard scoped_lock(m_mutex);
191 check();
192 check_init();
193 return m_steps;
194 }
195
196
203 void
204 set_steps(const std::vector<const dunedaq::confmodel::DaqModulesGroup*>& value);
205
206 };
207
208 // out stream operator
209
210 inline std::ostream& operator<<(std::ostream& s, const ActionPlan& obj)
211 {
212 return obj.print_object(s);
213 }
214
215 typedef std::vector<const ActionPlan*>::const_iterator ActionPlanIterator;
216
217 }
218}
219
220#endif
#define ERS_HERE
void set_enum(const std::string &name, const std::string &value)
Set attribute enumeration 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::string & get_execution_policy() const
Get "execution_policy" attribute value. How the application should execute steps of the action plan.
virtual ~ActionPlan() noexcept
ActionPlan(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
void set_steps(const std::vector< const dunedaq::confmodel::DaqModulesGroup * > &value)
Set "steps" relationship value.
static const std::string s_command
void set_execution_policy(const std::string &value)
Set "execution_policy" attribute value. How the application should execute steps of the action plan.
const std::vector< const dunedaq::confmodel::DaqModulesGroup * > & get_steps() const
Get "steps" relationship value.
static const std::string & __get_execution_policy_str() noexcept
static const std::string & __get_command_str() noexcept
friend class conffwk::DalFactory
static const std::string & __get_steps_str() noexcept
const dunedaq::confmodel::FSMCommand * m_command
static const std::string s_steps
friend class conffwk::DalObject
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_execution_policy
static const std::string & s_class_name
std::vector< const dunedaq::confmodel::DaqModulesGroup * > m_steps
const dunedaq::confmodel::FSMCommand * get_command() const
Get "command" relationship value.
void set_command(const dunedaq::confmodel::FSMCommand *value)
Set "command" relationship value.
virtual void init(bool init_children)
conffwk entry point
double offset
std::vector< constActionPlan * >::const_iterator ActionPlanIterator
std::ostream & operator<<(std::ostream &s, const ActionPlan &obj)
Including Qt Headers.