DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
OksConfigObject.hpp
Go to the documentation of this file.
1// this is -*- c++ -*-
2#ifndef OKSCONFLIBS_OKSCONFLIBSOBJECT_H_
3#define OKSCONFLIBS_OKSCONFLIBSOBJECT_H_
4
5#include <string>
6#include <vector>
7
8#include "oks/kernel.hpp"
9#include "oks/object.hpp"
10
12
13namespace dunedaq {
14namespace oksconflibs {
15
16class ConfigurationImpl;
18
20
21 friend class ConfigurationImpl;
22 friend class OksConfiguration;
23
24 public:
25
27 virtual ~OksConfigObject() noexcept;
28
29
30 public:
31
32 virtual const std::string contained_in() const;
33
34 virtual void get(const std::string& name, bool& value);
35 virtual void get(const std::string& name, uint8_t& value);
36 virtual void get(const std::string& name, int8_t& value);
37 virtual void get(const std::string& name, uint16_t& value);
38 virtual void get(const std::string& name, int16_t& value);
39 virtual void get(const std::string& name, uint32_t& value);
40 virtual void get(const std::string& name, int32_t& value);
41 virtual void get(const std::string& name, uint64_t& value);
42 virtual void get(const std::string& name, int64_t& value);
43 virtual void get(const std::string& name, float& value);
44 virtual void get(const std::string& name, double& value);
45 virtual void get(const std::string& name, std::string& value);
46 virtual void get(const std::string& name, conffwk::ConfigObject& value);
47
48 virtual void get(const std::string& name, std::vector<bool>& value);
49 virtual void get(const std::string& name, std::vector<uint8_t>& value);
50 virtual void get(const std::string& name, std::vector<int8_t>& value);
51 virtual void get(const std::string& name, std::vector<uint16_t>& value);
52 virtual void get(const std::string& name, std::vector<int16_t>& value);
53 virtual void get(const std::string& name, std::vector<uint32_t>& value);
54 virtual void get(const std::string& name, std::vector<int32_t>& value);
55 virtual void get(const std::string& name, std::vector<uint64_t>& value);
56 virtual void get(const std::string& name, std::vector<int64_t>& value);
57 virtual void get(const std::string& name, std::vector<float>& value);
58 virtual void get(const std::string& name, std::vector<double>& value);
59 virtual void get(const std::string& name, std::vector<std::string>& value);
60 virtual void get(const std::string& name, std::vector<conffwk::ConfigObject>& value);
61
62 virtual bool rel(const std::string& name, std::vector<conffwk::ConfigObject>& value);
63 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;
64
65
66 virtual void set(const std::string& name, bool value);
67 virtual void set(const std::string& name, uint8_t value);
68 virtual void set(const std::string& name, int8_t value);
69 virtual void set(const std::string& name, uint16_t value);
70 virtual void set(const std::string& name, int16_t value);
71 virtual void set(const std::string& name, uint32_t value);
72 virtual void set(const std::string& name, int32_t value);
73 virtual void set(const std::string& name, uint64_t value);
74 virtual void set(const std::string& name, int64_t value);
75 virtual void set(const std::string& name, float value);
76 virtual void set(const std::string& name, double value);
77 virtual void set(const std::string& name, const std::string& value);
78
79 virtual void set_enum(const std::string& attribute, const std::string& value);
80 virtual void set_date(const std::string& attribute, const std::string& value);
81 virtual void set_time(const std::string& attribute, const std::string& value);
82
83 virtual void set_class(const std::string& attribute, const std::string& value);
84
85 virtual void set(const std::string& name, const std::vector<bool>& value);
86 virtual void set(const std::string& name, const std::vector<uint8_t>& value);
87 virtual void set(const std::string& name, const std::vector<int8_t>& value);
88 virtual void set(const std::string& name, const std::vector<uint16_t>& value);
89 virtual void set(const std::string& name, const std::vector<int16_t>& value);
90 virtual void set(const std::string& name, const std::vector<uint32_t>& value);
91 virtual void set(const std::string& name, const std::vector<int32_t>& value);
92 virtual void set(const std::string& name, const std::vector<uint64_t>& value);
93 virtual void set(const std::string& name, const std::vector<int64_t>& value);
94 virtual void set(const std::string& name, const std::vector<float>& value);
95 virtual void set(const std::string& name, const std::vector<double>& value);
96 virtual void set(const std::string& name, const std::vector<std::string>& value);
97
98 virtual void set_enum(const std::string& attribute, const std::vector<std::string>& value);
99 virtual void set_date(const std::string& attribute, const std::vector<std::string>& value);
100 virtual void set_time(const std::string& attribute, const std::vector<std::string>& value);
101
102 virtual void set_class(const std::string& attribute, const std::vector<std::string>& value);
103
104 virtual void set(const std::string& name, const conffwk::ConfigObject* value, bool skip_non_null_check);
105 virtual void set(const std::string& name, const std::vector<const conffwk::ConfigObject*>& value, bool skip_non_null_check);
106
107 virtual void move(const std::string& at);
108 virtual void rename(const std::string& new_id);
109
110 virtual void reset();
111
112 public:
113
114 // required by JNI
115
116 oks::OksData::Type get_type(const std::string& attribute) const;
117
118
119 // helper functions
120
121 private:
122
123 // extract values out of OKS database
124
125 template<class T> void get_value(const std::string& name, T& value);
126 template<class T> void get_vector(const std::string& name, std::vector<T>& value);
127
128
129 // set values in OKS database
130
131 void set_attr_value(const std::string& name, oks::OksData& value);
132 void set_rel_value(const std::string& name, oks::OksData& value, bool skip_non_null_check);
133
134 template<class T> void set_value(const std::string& name, const T& value);
135 template<class T> void set_vector(const std::string& name, const std::vector<T>& value);
136
137
138 // checkout file, if is needed for update
139
140// void test_checkout_needs();
141
142 public:
143 // required by template method insert_object
144 void set(oks::OksObject *obj)
145 {
146 m_obj = obj;
147 }
148
149 // representation
150
151 private:
152
154};
155
156} // namespace oksconflibs
157} // namespace dunedaq
158
159#endif // OKSCONFLIBS_OKSCONFLIBSOBJECT_H_
Implements database objects.
Provides pure virtual interface used by the Configuration class.
OksObject describes instance of OksClass.
Definition object.hpp:836
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 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.
Monitoring thread not set
Definition __init__.py:1