DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DataStoreConf.hpp
Go to the documentation of this file.
1// *** this file is generated by oksdalgen, do not modify it ***
2
3#ifndef _DataStoreConf_0_dunedaq__appmodel_0_appmodel_H_
4#define _DataStoreConf_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
17 // forward declaration for classes used in relationships and algorithms
18
19namespace dunedaq {
20 namespace appmodel {
21 class FilenameParams;
22 class HDF5FileLayoutParams;
23 }
24}
25
26
27namespace dunedaq {
28 namespace appmodel {
29
31
32 friend class conffwk::Configuration;
33 friend class conffwk::DalObject;
34 friend class conffwk::DalFactory;
35 friend class conffwk::DalRegistry;
36
37 protected:
38
40 virtual ~DataStoreConf() noexcept;
41 virtual void init(bool init_children);
42
43 public:
44
47 static const std::string& s_class_name;
48
49
59 virtual void print(unsigned int offset, bool print_header, std::ostream& s) const;
60
61
71 virtual std::vector<const dunedaq::conffwk::DalObject *> get(const std::string& name, bool upcast_unregistered = true) const;
72
73
74 protected:
75
76 bool get(const std::string& name, std::vector<const dunedaq::conffwk::DalObject *>& vec, bool upcast_unregistered, bool first_call) const;
77
78
79 private:
80
81 std::string m_type;
82 std::string m_directory_path;
83 std::string m_mode;
84 uint64_t m_max_file_size;
87 uint8_t m_compression_level;
90
91
92 public:
93
94 // attribute names
95
96 inline static const std::string s_type = "type";
97 inline static const std::string s_directory_path = "directory_path";
98 inline static const std::string s_mode = "mode";
99 inline static const std::string s_max_file_size = "max_file_size";
100 inline static const std::string s_disable_unique_filename_suffix = "disable_unique_filename_suffix";
101 inline static const std::string s_free_space_safety_factor = "free_space_safety_factor";
102 inline static const std::string s_compression_level = "compression_level";
103
104 static const std::string& __get_type_str() noexcept { return s_type; }
105 static const std::string& __get_directory_path_str() noexcept { return s_directory_path; }
106 static const std::string& __get_mode_str() noexcept { return s_mode; }
107 static const std::string& __get_max_file_size_str() noexcept { return s_max_file_size; }
108 static const std::string& __get_disable_unique_filename_suffix_str() noexcept { return s_disable_unique_filename_suffix; }
109 static const std::string& __get_free_space_safety_factor_str() noexcept { return s_free_space_safety_factor; }
110 static const std::string& __get_compression_level_str() noexcept { return s_compression_level; }
111
112
119 const std::string&
120 get_type() const
121 {
122 std::lock_guard scoped_lock(m_mutex);
123 check();
124 check_init();
125 return m_type;
126 }
127
134 void
135 set_type(const std::string& value)
136 {
137 std::lock_guard scoped_lock(m_mutex);
138 check();
139 clear();
140 p_obj.set_by_ref(s_type, value);
141 }
142
143
151 const std::string&
153 {
154 std::lock_guard scoped_lock(m_mutex);
155 check();
156 check_init();
157 return m_directory_path;
158 }
159
167 void
168 set_directory_path(const std::string& value)
169 {
170 std::lock_guard scoped_lock(m_mutex);
171 check();
172 clear();
174 }
175
176
181 struct Mode {
182 inline static const std::string All_per_file = "all-per-file";
183 inline static const std::string One_event_per_file = "one-event-per-file";
184 };
185
193 const std::string&
194 get_mode() const
195 {
196 std::lock_guard scoped_lock(m_mutex);
197 check();
198 check_init();
199 return m_mode;
200 }
201
209 void
210 set_mode(const std::string& value)
211 {
212 std::lock_guard scoped_lock(m_mutex);
213 check();
214 clear();
215 p_obj.set_enum(s_mode, value);
216 }
217
218
225 uint64_t
227 {
228 std::lock_guard scoped_lock(m_mutex);
229 check();
230 check_init();
231 return m_max_file_size;
232 }
233
240 void
241 set_max_file_size(uint64_t value)
242 {
243 std::lock_guard scoped_lock(m_mutex);
244 check();
245 clear();
247 }
248
249
256 bool
258 {
259 std::lock_guard scoped_lock(m_mutex);
260 check();
261 check_init();
263 }
264
271 void
273 {
274 std::lock_guard scoped_lock(m_mutex);
275 check();
276 clear();
278 }
279
280
287 int32_t
289 {
290 std::lock_guard scoped_lock(m_mutex);
291 check();
292 check_init();
294 }
295
302 void
304 {
305 std::lock_guard scoped_lock(m_mutex);
306 check();
307 clear();
309 }
310
311
318 uint8_t
320 {
321 std::lock_guard scoped_lock(m_mutex);
322 check();
323 check_init();
324 return m_compression_level;
325 }
326
333 void
335 {
336 std::lock_guard scoped_lock(m_mutex);
337 check();
338 clear();
340 }
341
342
343 // relationship names
344
345 inline static const std::string s_file_layout_params = "file_layout_params";
346 inline static const std::string s_filename_params = "filename_params";
347
348 static const std::string& __get_file_layout_params_str() noexcept { return s_file_layout_params; }
349 static const std::string& __get_filename_params_str() noexcept { return s_filename_params; }
350
351
360 {
361 std::lock_guard scoped_lock(m_mutex);
362 check();
363 check_init();
365 {
366 std::ostringstream text;
367 text << "relationship \"" << s_file_layout_params << "\" of object " << this << " is not set";
368 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
369 }
371 }
372
373
380 void
382
391 {
392 std::lock_guard scoped_lock(m_mutex);
393 check();
394 check_init();
396 {
397 std::ostringstream text;
398 text << "relationship \"" << s_filename_params << "\" of object " << this << " is not set";
399 throw dunedaq::conffwk::Generic(ERS_HERE, text.str().c_str());
400 }
401 return m_filename_params;
402 }
403
404
411 void
413
414 };
415
416 // out stream operator
417
418 inline std::ostream& operator<<(std::ostream& s, const DataStoreConf& obj)
419 {
420 return obj.print_object(s);
421 }
422
423 typedef std::vector<const DataStoreConf*>::const_iterator DataStoreConfIterator;
424
425 }
426}
427
428#endif
#define ERS_HERE
static const std::string s_disable_unique_filename_suffix
void set_filename_params(const dunedaq::appmodel::FilenameParams *value)
Set "filename_params" relationship value.
static const std::string & __get_mode_str() noexcept
static const std::string & s_class_name
static const std::string s_free_space_safety_factor
uint8_t get_compression_level() const
Get "compression_level" attribute value.
static const std::string & __get_type_str() noexcept
DataStoreConf(conffwk::DalRegistry &db, const conffwk::ConfigObject &obj) noexcept
void set_directory_path(const std::string &value)
Set "directory_path" attribute value. The base directory for saving files.
virtual void init(bool init_children)
static const std::string s_compression_level
const dunedaq::appmodel::HDF5FileLayoutParams * get_file_layout_params() const
Get "file_layout_params" relationship value.
const std::string & get_type() const
Get "type" attribute value.
bool get_disable_unique_filename_suffix() const
Get "disable_unique_filename_suffix" attribute value.
static const std::string & __get_free_space_safety_factor_str() noexcept
const dunedaq::appmodel::FilenameParams * m_filename_params
static const std::string s_directory_path
static const std::string & __get_directory_path_str() noexcept
int32_t get_free_space_safety_factor() const
Get "free_space_safety_factor" attribute value.
void set_max_file_size(uint64_t value)
Set "max_file_size" attribute value.
const dunedaq::appmodel::HDF5FileLayoutParams * m_file_layout_params
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_max_file_size_str() noexcept
const std::string & get_mode() const
Get "mode" attribute value. The operation mode that the DataStore should use when organizing the data...
static const std::string s_file_layout_params
const std::string & get_directory_path() const
Get "directory_path" attribute value. The base directory for saving files.
static const std::string & __get_file_layout_params_str() noexcept
friend class conffwk::DalFactory
static const std::string s_filename_params
virtual ~DataStoreConf() noexcept
static const std::string & __get_disable_unique_filename_suffix_str() noexcept
void set_mode(const std::string &value)
Set "mode" attribute value. The operation mode that the DataStore should use when organizing the data...
static const std::string s_type
void set_disable_unique_filename_suffix(bool value)
Set "disable_unique_filename_suffix" attribute value.
friend class conffwk::DalObject
void set_free_space_safety_factor(int32_t value)
Set "free_space_safety_factor" attribute value.
static const std::string & __get_filename_params_str() noexcept
static const std::string & __get_compression_level_str() noexcept
void set_compression_level(uint8_t value)
Set "compression_level" attribute value.
static const std::string s_max_file_size
void set_type(const std::string &value)
Set "type" attribute value.
static const std::string s_mode
void set_file_layout_params(const dunedaq::appmodel::HDF5FileLayoutParams *value)
Set "file_layout_params" relationship value.
uint64_t get_max_file_size() const
Get "max_file_size" attribute value.
const dunedaq::appmodel::FilenameParams * get_filename_params() const
Get "filename_params" relationship value.
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.
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.
conffwk entry point
double offset
std::ostream & operator<<(std::ostream &s, const AVXAbsRunSumProcessor &obj)
std::vector< constDataStoreConf * >::const_iterator DataStoreConfIterator
Including Qt Headers.
static const std::string One_event_per_file