15#ifndef CONFFWK_CONFIGOBJECTIMPL_H_
16#define CONFFWK_CONFIGOBJECTIMPL_H_
70 const std::string&
id,
85 const
std::
string&
UID() const noexcept
87 std::lock_guard<std::mutex> scoped_lock(
m_mutex);
99 virtual void get(
const std::string& attribute,
bool& value) = 0;
102 virtual void get(
const std::string& attribute, uint8_t& value) = 0;
105 virtual void get(
const std::string& attribute, int8_t& value) = 0;
108 virtual void get(
const std::string& attribute, uint16_t& value) = 0;
111 virtual void get(
const std::string& attribute, int16_t& value) = 0;
114 virtual void get(
const std::string& attribute, uint32_t& value) = 0;
117 virtual void get(
const std::string& attribute, int32_t& value) = 0;
120 virtual void get(
const std::string& attribute, uint64_t& value) = 0;
123 virtual void get(
const std::string& attribute, int64_t& value) = 0;
126 virtual void get(
const std::string& attribute,
float& value) = 0;
129 virtual void get(
const std::string& attribute,
double& value) = 0;
132 virtual void get(
const std::string& attribute, std::string& value) = 0;
139 virtual void get(
const std::string& attribute, std::vector<bool>& value) = 0;
142 virtual void get(
const std::string& attribute, std::vector<uint8_t>& value) = 0;
145 virtual void get(
const std::string& attribute, std::vector<int8_t>& value) = 0;
148 virtual void get(
const std::string& attribute, std::vector<uint16_t>& value) = 0;
151 virtual void get(
const std::string& attribute, std::vector<int16_t>& value) = 0;
154 virtual void get(
const std::string& attribute, std::vector<uint32_t>& value) = 0;
157 virtual void get(
const std::string& attribute, std::vector<int32_t>& value) = 0;
160 virtual void get(
const std::string& attribute, std::vector<uint64_t>& value) = 0;
163 virtual void get(
const std::string& attribute, std::vector<int64_t>& value) = 0;
166 virtual void get(
const std::string& attribute, std::vector<float>& value) = 0;
169 virtual void get(
const std::string& attribute, std::vector<double>& value) = 0;
172 virtual void get(
const std::string& attribute, std::vector<std::string>& value) = 0;
175 virtual void get(
const std::string& association, std::vector<ConfigObject>& value) = 0;
180 virtual bool rel(
const std::string& name, std::vector<ConfigObject>& value) = 0;
184 const std::string& association,
185 bool check_composite_only,
186 unsigned long rlevel,
187 const std::vector<std::string>* rclasses)
const = 0;
191 virtual void set(
const std::string& attribute,
bool value) = 0;
194 virtual void set(
const std::string& attribute, uint8_t value) = 0;
197 virtual void set(
const std::string& attribute, int8_t value) = 0;
200 virtual void set(
const std::string& attribute, uint16_t value) = 0;
203 virtual void set(
const std::string& attribute, int16_t value) = 0;
206 virtual void set(
const std::string& attribute, uint32_t value) = 0;
209 virtual void set(
const std::string& attribute, int32_t value) = 0;
212 virtual void set(
const std::string& attribute, uint64_t value) = 0;
215 virtual void set(
const std::string& attribute, int64_t value) = 0;
218 virtual void set(
const std::string& attribute,
float value) = 0;
221 virtual void set(
const std::string& attribute,
double value) = 0;
224 virtual void set(
const std::string& attribute,
const std::string& value) = 0;
227 virtual void set_enum(
const std::string& attribute,
const std::string& value) = 0;
230 virtual void set_class(
const std::string& attribute,
const std::string& value) = 0;
233 virtual void set_date(
const std::string& attribute,
const std::string& value) = 0;
236 virtual void set_time(
const std::string& attribute,
const std::string& value) = 0;
240 virtual void set(
const std::string& attribute,
const std::vector<bool>& value) = 0;
243 virtual void set(
const std::string& attribute,
const std::vector<uint8_t>& value) = 0;
246 virtual void set(
const std::string& attribute,
const std::vector<int8_t>& value) = 0;
249 virtual void set(
const std::string& attribute,
const std::vector<uint16_t>& value) = 0;
252 virtual void set(
const std::string& attribute,
const std::vector<int16_t>& value) = 0;
255 virtual void set(
const std::string& attribute,
const std::vector<uint32_t>& value) = 0;
258 virtual void set(
const std::string& attribute,
const std::vector<int32_t>& value) = 0;
261 virtual void set(
const std::string& attribute,
const std::vector<uint64_t>& value) = 0;
264 virtual void set(
const std::string& attribute,
const std::vector<int64_t>& value) = 0;
267 virtual void set(
const std::string& attribute,
const std::vector<float>& value) = 0;
270 virtual void set(
const std::string& attribute,
const std::vector<double>& value) = 0;
273 virtual void set(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
276 virtual void set_enum(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
279 virtual void set_class(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
282 virtual void set_date(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
285 virtual void set_time(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
288 virtual void set(
const std::string& association,
const ConfigObject* value,
bool skip_non_null_check) = 0;
291 virtual void set(
const std::string& association,
292 const std::vector<const ConfigObject*>& value,
293 bool skip_non_null_check) = 0;
296 virtual void move(
const std::string& at) = 0;
299 virtual void rename(
const std::string& new_id) = 0;
354 void convert(std::vector<uint8_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
356 void convert(std::vector<uint16_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
357 void convert(std::vector<int16_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
358 void convert(std::vector<uint32_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
359 void convert(std::vector<int32_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
360 void convert(std::vector<uint64_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
361 void convert(std::vector<int64_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
364 void convert(std::vector<std::string>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
virtual void set(const std::string &attribute, const std::vector< int64_t > &value)=0
Virtual method to read vector-of-signed-64-bits-integers attribute value.
virtual void get(const std::string &attribute, int64_t &value)=0
Virtual method to read signed 64 bits integer attribute value.
virtual void get(const std::string &attribute, std::vector< uint64_t > &value)=0
Virtual method to read vector-of-unsigned-64-bits-integers attribute value.
virtual void set_date(const std::string &attribute, const std::vector< std::string > &value)=0
Virtual method to read vector-of-dates attribute value.
virtual void get(const std::string &association, std::vector< ConfigObject > &value)=0
Virtual method to read vector-of-conffwk-objects relationship value.
virtual void set_class(const std::string &attribute, const std::vector< std::string > &value)=0
Virtual method to read vector-of-enumerations attribute value.
virtual void get(const std::string &attribute, std::vector< int8_t > &value)=0
Virtual method to read vector-of-signed-chars attribute value.
virtual void set(const std::string &attribute, const std::vector< uint32_t > &value)=0
Virtual method to read vector-of-unsigned-longs attribute value.
virtual void set(const std::string &attribute, const std::string &value)=0
Virtual method to set string attribute value.
virtual void get(const std::string &attribute, int32_t &value)=0
Virtual method to read signed long attribute value.
virtual void get(const std::string &attribute, uint64_t &value)=0
Virtual method to read unsigned 64 bits integer attribute value.
friend class ConfigObject
virtual void set(const std::string &association, const ConfigObject *value, bool skip_non_null_check)=0
Virtual method to read conffwk-object relationship value.
void convert(bool &value, const ConfigObject &obj, const std::string &attr_name) noexcept
friend class Configuration
const std::string & UID() const noexcept
Method to get database object's unique ID.
virtual void rename(const std::string &new_id)=0
Virtual method to change object ID.
virtual void set(const std::string &attribute, const std::vector< int32_t > &value)=0
Virtual method to read vector-of-signed-longs attribute value.
virtual void set(const std::string &attribute, const std::vector< uint16_t > &value)=0
Virtual method to read vector-of-unsigned-shorts attribute value.
virtual void set(const std::string &attribute, double value)=0
Virtual method to set double attribute value.
virtual void get(const std::string &attribute, std::vector< uint16_t > &value)=0
Virtual method to read vector-of-unsigned-shorts attribute value.
virtual void set(const std::string &attribute, int16_t value)=0
Virtual method to set signed short attribute value.
virtual void clear() noexcept
Virtual method to clean resources used by the implementation object.
const std::string & class_name() const noexcept
Virtual method to get object's class name.
virtual void get(const std::string &attribute, float &value)=0
Virtual method to read float attribute value.
virtual const std::string contained_in() const =0
Virtual method to get object's database file name.
virtual void set(const std::string &attribute, bool value)=0
Virtual method to set boolean attribute value.
virtual void set(const std::string &attribute, float value)=0
Virtual method to set float attribute value.
virtual void referenced_by(std::vector< ConfigObject > &value, const std::string &association, bool check_composite_only, unsigned long rlevel, const std::vector< std::string > *rclasses) const =0
Virtual method to read vector-of-conffwk-object referencing this object.
virtual void set(const std::string &attribute, int64_t value)=0
Virtual method to set signed 64 bits integer attribute value.
static ConfigObjectImpl * default_impl() noexcept
Returns default implementation.
virtual void get(const std::string &attribute, std::vector< bool > &value)=0
Virtual method to read vector-of-booleans attribute value.
virtual void set(const std::string &attribute, const std::vector< uint8_t > &value)=0
Virtual method to read vector-of-unsigned-chars attribute value.
virtual void set(const std::string &attribute, uint32_t value)=0
Virtual method to set unsigned long attribute value.
friend class ConfigurationImpl
virtual bool rel(const std::string &name, std::vector< ConfigObject > &value)=0
virtual void get(const std::string &attribute, uint32_t &value)=0
Virtual method to read unsigned long attribute value.
virtual void get(const std::string &attribute, std::vector< float > &value)=0
Virtual method to read vector-of-floats attribute value.
virtual void get(const std::string &attribute, std::vector< int32_t > &value)=0
Virtual method to read vector-of-signed-longs attribute value.
virtual void get(const std::string &attribute, std::vector< double > &value)=0
Virtual method to read vector-of-doubles attribute value.
virtual void set(const std::string &attribute, uint8_t value)=0
Virtual method to set unsigned char attribute value.
virtual void get(const std::string &attribute, std::vector< std::string > &value)=0
Virtual method to read vector-of-strings attribute value.
virtual void get(const std::string &attribute, std::vector< int64_t > &value)=0
Virtual method to read vector-of-signed-64-bits-integers attribute value.
virtual void set(const std::string &attribute, const std::vector< float > &value)=0
Virtual method to read vector-of-floats attribute value.
virtual void set(const std::string &attribute, const std::vector< uint64_t > &value)=0
Virtual method to read vector-of-unsigned-64-bits-integers attribute value.
virtual void reset()=0
Virtual method to reset the implementation object from unknown state.
virtual void set(const std::string &attribute, uint16_t value)=0
Virtual method to set unsigned short attribute value.
virtual void get(const std::string &attribute, std::vector< int16_t > &value)=0
Virtual method to read vector-of-signed-shorts attribute value.
virtual void get(const std::string &attribute, std::string &value)=0
Virtual method to read string attribute value.
void convert(ConfigObject &, const ConfigObject &, const std::string &) noexcept
void convert(std::vector< ConfigObject > &, const ConfigObject &, const std::string &) noexcept
dunedaq::conffwk::ObjectState m_state
virtual void get(const std::string &attribute, double &value)=0
Virtual method to read double attribute value.
bool is_deleted() const
Check object and return true if the object has been deleted.
virtual void get(const std::string &association, ConfigObject &value)=0
Virtual method to read relationship single-value.
const std::string * m_class_name
ConfigObjectImpl()=delete
virtual void set_time(const std::string &attribute, const std::string &value)=0
Virtual method to set time attribute value.
void throw_if_deleted() const
virtual void set(const std::string &attribute, uint64_t value)=0
Virtual method to set unsigned 64 bits integer attribute value.
virtual void move(const std::string &at)=0
Virtual method to move object to a file.
virtual void set(const std::string &attribute, const std::vector< bool > &value)=0
Virtual method to read vector-of-booleans attribute value.
virtual void set_enum(const std::string &attribute, const std::vector< std::string > &value)=0
Virtual method to read vector-of-enumerations attribute value.
virtual void set(const std::string &attribute, const std::vector< std::string > &value)=0
Virtual method to read vector-of-strings attribute value.
virtual void set(const std::string &association, const std::vector< const ConfigObject * > &value, bool skip_non_null_check)=0
Virtual method to read vector-of-conffwk-objects relationship value.
virtual void set(const std::string &attribute, const std::vector< double > &value)=0
Virtual method to read vector-of-doubles attribute value.
ConfigObjectImpl(ConfigurationImpl *impl, const std::string &id, dunedaq::conffwk::ObjectState state=dunedaq::conffwk::Valid) noexcept
The constructor stores configuration implementation pointer.
virtual void get(const std::string &attribute, uint8_t &value)=0
Virtual method to read unsigned char attribute value.
virtual void get(const std::string &attribute, int16_t &value)=0
Virtual method to read signed short attribute value.
virtual void set_enum(const std::string &attribute, const std::string &value)=0
Virtual method to set enumeration attribute value.
virtual void set(const std::string &attribute, int8_t value)=0
Virtual method to set signed char attribute value.
virtual void get(const std::string &attribute, int8_t &value)=0
Virtual method to read signed char attribute value.
ConfigurationImpl * m_impl
virtual void get(const std::string &attribute, uint16_t &value)=0
Virtual method to read unsigned short attribute value.
virtual void get(const std::string &attribute, bool &value)=0
Virtual method to read boolean attribute value.
virtual void set_class(const std::string &attribute, const std::string &value)=0
Virtual method to set enumeration attribute value.
virtual void set_date(const std::string &attribute, const std::string &value)=0
Virtual method to set date attribute value.
virtual void get(const std::string &attribute, std::vector< uint8_t > &value)=0
Virtual method to read vector-of-unsigned-chars attribute value.
virtual void set(const std::string &attribute, const std::vector< int16_t > &value)=0
Virtual method to read vector-of-signed-shorts attribute value.
virtual void set(const std::string &attribute, int32_t value)=0
Virtual method to set signed long attribute value.
virtual void get(const std::string &attribute, std::vector< uint32_t > &value)=0
Virtual method to read vector-of-unsigned-longs attribute value.
virtual void set(const std::string &attribute, const std::vector< int8_t > &value)=0
Virtual method to read vector-of-signed-chars attribute value.
virtual void set_time(const std::string &attribute, const std::vector< std::string > &value)=0
Virtual method to read vector-of-times attribute value.
Represents database objects.
Provides pure virtual interface used by the Configuration class.
Defines base class for cache of template objects.
The base class for any generated DAL object.
DalRegistry: A registry of DalObjects It provides a single interface to create, cache and manage DalO...