DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
OksConfigObject.hpp
Go to the documentation of this file.
1//
2// DUNE DAQ modification notice:
3// This file has been modified from the original ATLAS oksconfig source for the DUNE DAQ project.
4// Fork baseline commit: oksconfig-03-02-00 (2021-04-20).
5// Renamed since fork: yes (from oksconfig/OksConfigObject.h to include/oksconflibs/OksConfigObject.hpp).
6//
7
8// this is -*- c++ -*-
9#ifndef OKSCONFLIBS_OKSCONFLIBSOBJECT_H_
10#define OKSCONFLIBS_OKSCONFLIBSOBJECT_H_
11
12#include <string>
13#include <vector>
14
15#include "oks/kernel.hpp"
16#include "oks/object.hpp"
17
19
20namespace dunedaq {
21namespace oksconflibs {
22
23class ConfigurationImpl;
25
27
28 friend class ConfigurationImpl;
29 friend class OksConfiguration;
30
31 public:
32
34 virtual ~OksConfigObject() noexcept;
35
36
37 public:
38
39 virtual const std::string contained_in() const;
40
41 virtual void get(const std::string& name, bool& value);
42 virtual void get(const std::string& name, uint8_t& value);
43 virtual void get(const std::string& name, int8_t& value);
44 virtual void get(const std::string& name, uint16_t& value);
45 virtual void get(const std::string& name, int16_t& value);
46 virtual void get(const std::string& name, uint32_t& value);
47 virtual void get(const std::string& name, int32_t& value);
48 virtual void get(const std::string& name, uint64_t& value);
49 virtual void get(const std::string& name, int64_t& value);
50 virtual void get(const std::string& name, float& value);
51 virtual void get(const std::string& name, double& value);
52 virtual void get(const std::string& name, std::string& value);
53 virtual void get(const std::string& name, conffwk::ConfigObject& value);
54
55 virtual void get(const std::string& name, std::vector<bool>& value);
56 virtual void get(const std::string& name, std::vector<uint8_t>& value);
57 virtual void get(const std::string& name, std::vector<int8_t>& value);
58 virtual void get(const std::string& name, std::vector<uint16_t>& value);
59 virtual void get(const std::string& name, std::vector<int16_t>& value);
60 virtual void get(const std::string& name, std::vector<uint32_t>& value);
61 virtual void get(const std::string& name, std::vector<int32_t>& value);
62 virtual void get(const std::string& name, std::vector<uint64_t>& value);
63 virtual void get(const std::string& name, std::vector<int64_t>& value);
64 virtual void get(const std::string& name, std::vector<float>& value);
65 virtual void get(const std::string& name, std::vector<double>& value);
66 virtual void get(const std::string& name, std::vector<std::string>& value);
67 virtual void get(const std::string& name, std::vector<conffwk::ConfigObject>& value);
68
69 virtual bool rel(const std::string& name, std::vector<conffwk::ConfigObject>& value);
70 virtual void referenced_by(std::vector<conffwk::ConfigObject>& value, const std::string& association, bool check_composite_only, unsigned long rlevel, const std::vector<std::string> * rclasses) const;
71
72
73 virtual void set(const std::string& name, bool value);
74 virtual void set(const std::string& name, uint8_t value);
75 virtual void set(const std::string& name, int8_t value);
76 virtual void set(const std::string& name, uint16_t value);
77 virtual void set(const std::string& name, int16_t value);
78 virtual void set(const std::string& name, uint32_t value);
79 virtual void set(const std::string& name, int32_t value);
80 virtual void set(const std::string& name, uint64_t value);
81 virtual void set(const std::string& name, int64_t value);
82 virtual void set(const std::string& name, float value);
83 virtual void set(const std::string& name, double value);
84 virtual void set(const std::string& name, const std::string& value);
85
86 virtual void set_enum(const std::string& attribute, const std::string& value);
87 virtual void set_date(const std::string& attribute, const std::string& value);
88 virtual void set_time(const std::string& attribute, const std::string& value);
89
90 virtual void set_class(const std::string& attribute, const std::string& value);
91
92 virtual void set(const std::string& name, const std::vector<bool>& value);
93 virtual void set(const std::string& name, const std::vector<uint8_t>& value);
94 virtual void set(const std::string& name, const std::vector<int8_t>& value);
95 virtual void set(const std::string& name, const std::vector<uint16_t>& value);
96 virtual void set(const std::string& name, const std::vector<int16_t>& value);
97 virtual void set(const std::string& name, const std::vector<uint32_t>& value);
98 virtual void set(const std::string& name, const std::vector<int32_t>& value);
99 virtual void set(const std::string& name, const std::vector<uint64_t>& value);
100 virtual void set(const std::string& name, const std::vector<int64_t>& value);
101 virtual void set(const std::string& name, const std::vector<float>& value);
102 virtual void set(const std::string& name, const std::vector<double>& value);
103 virtual void set(const std::string& name, const std::vector<std::string>& value);
104
105 virtual void set_enum(const std::string& attribute, const std::vector<std::string>& value);
106 virtual void set_date(const std::string& attribute, const std::vector<std::string>& value);
107 virtual void set_time(const std::string& attribute, const std::vector<std::string>& value);
108
109 virtual void set_class(const std::string& attribute, const std::vector<std::string>& value);
110
111 virtual void set(const std::string& name, const conffwk::ConfigObject* value, bool skip_non_null_check);
112 virtual void set(const std::string& name, const std::vector<const conffwk::ConfigObject*>& value, bool skip_non_null_check);
113
114 virtual void move(const std::string& at);
115 virtual void rename(const std::string& new_id);
116
117 virtual void reset();
118
119 public:
120
121 // required by JNI
122
123 oks::OksData::Type get_type(const std::string& attribute) const;
124
125
126 // helper functions
127
128 private:
129
130 // extract values out of OKS database
131
132 template<class T> void get_value(const std::string& name, T& value);
133 template<class T> void get_vector(const std::string& name, std::vector<T>& value);
134
135
136 // set values in OKS database
137
138 void set_attr_value(const std::string& name, oks::OksData& value);
139 void set_rel_value(const std::string& name, oks::OksData& value, bool skip_non_null_check);
140
141 template<class T> void set_value(const std::string& name, const T& value);
142 template<class T> void set_vector(const std::string& name, const std::vector<T>& value);
143
144
145 // checkout file, if is needed for update
146
147// void test_checkout_needs();
148
149 public:
150 // required by template method insert_object
151 void set(oks::OksObject *obj)
152 {
153 m_obj = obj;
154 }
155
156 // representation
157
158 private:
159
161};
162
163} // namespace oksconflibs
164} // namespace dunedaq
165
166#endif // OKSCONFLIBS_OKSCONFLIBSOBJECT_H_
Implements database objects.
Provides pure virtual interface used by the Configuration class.
OksObject describes instance of OksClass.
Definition object.hpp:841
void set_vector(const std::string &name, const std::vector< T > &value)
virtual const std::string contained_in() const
Virtual method to get object's database file name.
virtual void set_date(const std::string &attribute, const std::string &value)
Virtual method to set date attribute value.
void set_value(const std::string &name, const T &value)
virtual void set_enum(const std::string &attribute, const std::string &value)
Virtual method to set enumeration attribute value.
virtual void set(const std::string &name, bool value)
Virtual method to set boolean attribute value.
virtual void move(const std::string &at)
Virtual method to move object to a file.
void set_attr_value(const std::string &name, oks::OksData &value)
virtual void set_class(const std::string &attribute, const std::string &value)
Virtual method to set enumeration attribute value.
void set_rel_value(const std::string &name, oks::OksData &value, bool skip_non_null_check)
void get_value(const std::string &name, T &value)
void get_vector(const std::string &name, std::vector< T > &value)
virtual void set_time(const std::string &attribute, const std::string &value)
Virtual method to set time attribute value.
virtual void referenced_by(std::vector< conffwk::ConfigObject > &value, const std::string &association, bool check_composite_only, unsigned long rlevel, const std::vector< std::string > *rclasses) const
oks::OksData::Type get_type(const std::string &attribute) const
virtual void get(const std::string &name, bool &value)
Virtual method to read boolean attribute value.
virtual void rename(const std::string &new_id)
Virtual method to change object ID.
virtual bool rel(const std::string &name, std::vector< conffwk::ConfigObject > &value)
OksConfigObject(oks::OksObject *obj, conffwk::ConfigurationImpl *impl) noexcept
virtual void reset()
Virtual method to reset the implementation object from unknown state.
Including Qt Headers.
Definition module.cpp:16
msgpack::object obj
Definition ral.hpp:35