8#ifndef CONFFWK_CONFIGOBJECTIMPL_H_
9#define CONFFWK_CONFIGOBJECTIMPL_H_
23class ConfigurationImpl;
85 std::lock_guard<std::mutex> scoped_lock(
m_mutex);
102 virtual void get(
const std::string& attribute,
bool& value) = 0;
105 virtual void get(
const std::string& attribute, uint8_t& value) = 0;
108 virtual void get(
const std::string& attribute, int8_t& value) = 0;
111 virtual void get(
const std::string& attribute, uint16_t& value) = 0;
114 virtual void get(
const std::string& attribute, int16_t& value) = 0;
117 virtual void get(
const std::string& attribute, uint32_t& value) = 0;
120 virtual void get(
const std::string& attribute, int32_t& value) = 0;
123 virtual void get(
const std::string& attribute, uint64_t& value) = 0;
126 virtual void get(
const std::string& attribute, int64_t& value) = 0;
129 virtual void get(
const std::string& attribute,
float& value) = 0;
132 virtual void get(
const std::string& attribute,
double& value) = 0;
135 virtual void get(
const std::string& attribute, std::string& value) = 0;
144 virtual void get(
const std::string& attribute, std::vector<bool>& value) = 0;
147 virtual void get(
const std::string& attribute, std::vector<uint8_t>& value) = 0;
150 virtual void get(
const std::string& attribute, std::vector<int8_t>& value) = 0;
153 virtual void get(
const std::string& attribute, std::vector<uint16_t>& value) = 0;
156 virtual void get(
const std::string& attribute, std::vector<int16_t>& value) = 0;
159 virtual void get(
const std::string& attribute, std::vector<uint32_t>& value) = 0;
162 virtual void get(
const std::string& attribute, std::vector<int32_t>& value) = 0;
165 virtual void get(
const std::string& attribute, std::vector<uint64_t>& value) = 0;
168 virtual void get(
const std::string& attribute, std::vector<int64_t>& value) = 0;
171 virtual void get(
const std::string& attribute, std::vector<float>& value) = 0;
174 virtual void get(
const std::string& attribute, std::vector<double>& value) = 0;
177 virtual void get(
const std::string& attribute, std::vector<std::string>& value) = 0;
180 virtual void get(
const std::string& association, std::vector<ConfigObject>& value) = 0;
186 virtual bool rel(
const std::string& name, std::vector<ConfigObject>& value) = 0;
189 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;
195 virtual void set(
const std::string& attribute,
bool value) = 0;
198 virtual void set(
const std::string& attribute, uint8_t value) = 0;
201 virtual void set(
const std::string& attribute, int8_t value) = 0;
204 virtual void set(
const std::string& attribute, uint16_t value) = 0;
207 virtual void set(
const std::string& attribute, int16_t value) = 0;
210 virtual void set(
const std::string& attribute, uint32_t value) = 0;
213 virtual void set(
const std::string& attribute, int32_t value) = 0;
216 virtual void set(
const std::string& attribute, uint64_t value) = 0;
219 virtual void set(
const std::string& attribute, int64_t value) = 0;
222 virtual void set(
const std::string& attribute,
float value) = 0;
225 virtual void set(
const std::string& attribute,
double value) = 0;
228 virtual void set(
const std::string& attribute,
const std::string& value) = 0;
231 virtual void set_enum(
const std::string& attribute,
const std::string& value) = 0;
234 virtual void set_class(
const std::string& attribute,
const std::string& value) = 0;
237 virtual void set_date(
const std::string& attribute,
const std::string& value) = 0;
240 virtual void set_time(
const std::string& attribute,
const std::string& value) = 0;
246 virtual void set(
const std::string& attribute,
const std::vector<bool>& value) = 0;
249 virtual void set(
const std::string& attribute,
const std::vector<uint8_t>& value) = 0;
252 virtual void set(
const std::string& attribute,
const std::vector<int8_t>& value) = 0;
255 virtual void set(
const std::string& attribute,
const std::vector<uint16_t>& value) = 0;
258 virtual void set(
const std::string& attribute,
const std::vector<int16_t>& value) = 0;
261 virtual void set(
const std::string& attribute,
const std::vector<uint32_t>& value) = 0;
264 virtual void set(
const std::string& attribute,
const std::vector<int32_t>& value) = 0;
267 virtual void set(
const std::string& attribute,
const std::vector<uint64_t>& value) = 0;
270 virtual void set(
const std::string& attribute,
const std::vector<int64_t>& value) = 0;
273 virtual void set(
const std::string& attribute,
const std::vector<float>& value) = 0;
276 virtual void set(
const std::string& attribute,
const std::vector<double>& value) = 0;
279 virtual void set(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
282 virtual void set_enum(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
285 virtual void set_class(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
288 virtual void set_date(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
291 virtual void set_time(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
294 virtual void set(
const std::string& association,
const ConfigObject * value,
bool skip_non_null_check) = 0;
297 virtual void set(
const std::string& association,
const std::vector<const ConfigObject*>& value,
bool skip_non_null_check) = 0;
300 virtual void move(
const std::string& at) = 0;
303 virtual void rename(
const std::string& new_id) = 0;
354 void convert(uint8_t& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
355 void convert(int8_t& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
356 void convert(uint16_t& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
357 void convert(int16_t& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
358 void convert(uint32_t& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
359 void convert(int32_t& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
360 void convert(uint64_t& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
361 void convert(int64_t& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
362 void convert(
float& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
363 void convert(
double& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
364 void convert(std::string& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
367 void convert(std::vector<bool>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
368 void convert(std::vector<uint8_t>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
369 void convert(std::vector<int8_t>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
370 void convert(std::vector<uint16_t>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
371 void convert(std::vector<int16_t>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
372 void convert(std::vector<uint32_t>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
373 void convert(std::vector<int32_t>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
374 void convert(std::vector<uint64_t>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
375 void convert(std::vector<int64_t>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
376 void convert(std::vector<float>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
377 void convert(std::vector<double>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
378 void convert(std::vector<std::string>& value,
const ConfigObject& obj,
const std::string& attr_name)
noexcept;
Implements database objects.
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.
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
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.
virtual bool rel(const std::string &name, std::vector< ConfigObject > &value)=0
Virtual method to read any relationship value without throwing an exception if there is no such relat...
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 ~ConfigObjectImpl() noexcept
The virtual destructor.
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.
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...
Try to access deleted DAL object.