15#ifndef CONFFWK_CONFIGOBJECTIMPL_H_
16#define CONFFWK_CONFIGOBJECTIMPL_H_
92 std::lock_guard<std::mutex> scoped_lock(
m_mutex);
109 virtual void get(
const std::string& attribute,
bool& value) = 0;
112 virtual void get(
const std::string& attribute, uint8_t& value) = 0;
115 virtual void get(
const std::string& attribute, int8_t& value) = 0;
118 virtual void get(
const std::string& attribute, uint16_t& value) = 0;
121 virtual void get(
const std::string& attribute, int16_t& value) = 0;
124 virtual void get(
const std::string& attribute, uint32_t& value) = 0;
127 virtual void get(
const std::string& attribute, int32_t& value) = 0;
130 virtual void get(
const std::string& attribute, uint64_t& value) = 0;
133 virtual void get(
const std::string& attribute, int64_t& value) = 0;
136 virtual void get(
const std::string& attribute,
float& value) = 0;
139 virtual void get(
const std::string& attribute,
double& value) = 0;
142 virtual void get(
const std::string& attribute, std::string& value) = 0;
151 virtual void get(
const std::string& attribute, std::vector<bool>& value) = 0;
154 virtual void get(
const std::string& attribute, std::vector<uint8_t>& value) = 0;
157 virtual void get(
const std::string& attribute, std::vector<int8_t>& value) = 0;
160 virtual void get(
const std::string& attribute, std::vector<uint16_t>& value) = 0;
163 virtual void get(
const std::string& attribute, std::vector<int16_t>& value) = 0;
166 virtual void get(
const std::string& attribute, std::vector<uint32_t>& value) = 0;
169 virtual void get(
const std::string& attribute, std::vector<int32_t>& value) = 0;
172 virtual void get(
const std::string& attribute, std::vector<uint64_t>& value) = 0;
175 virtual void get(
const std::string& attribute, std::vector<int64_t>& value) = 0;
178 virtual void get(
const std::string& attribute, std::vector<float>& value) = 0;
181 virtual void get(
const std::string& attribute, std::vector<double>& value) = 0;
184 virtual void get(
const std::string& attribute, std::vector<std::string>& value) = 0;
187 virtual void get(
const std::string& association, std::vector<ConfigObject>& value) = 0;
193 virtual bool rel(
const std::string& name, std::vector<ConfigObject>& value) = 0;
196 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;
202 virtual void set(
const std::string& attribute,
bool value) = 0;
205 virtual void set(
const std::string& attribute, uint8_t value) = 0;
208 virtual void set(
const std::string& attribute, int8_t value) = 0;
211 virtual void set(
const std::string& attribute, uint16_t value) = 0;
214 virtual void set(
const std::string& attribute, int16_t value) = 0;
217 virtual void set(
const std::string& attribute, uint32_t value) = 0;
220 virtual void set(
const std::string& attribute, int32_t value) = 0;
223 virtual void set(
const std::string& attribute, uint64_t value) = 0;
226 virtual void set(
const std::string& attribute, int64_t value) = 0;
229 virtual void set(
const std::string& attribute,
float value) = 0;
232 virtual void set(
const std::string& attribute,
double value) = 0;
235 virtual void set(
const std::string& attribute,
const std::string& value) = 0;
238 virtual void set_enum(
const std::string& attribute,
const std::string& value) = 0;
241 virtual void set_class(
const std::string& attribute,
const std::string& value) = 0;
244 virtual void set_date(
const std::string& attribute,
const std::string& value) = 0;
247 virtual void set_time(
const std::string& attribute,
const std::string& value) = 0;
253 virtual void set(
const std::string& attribute,
const std::vector<bool>& value) = 0;
256 virtual void set(
const std::string& attribute,
const std::vector<uint8_t>& value) = 0;
259 virtual void set(
const std::string& attribute,
const std::vector<int8_t>& value) = 0;
262 virtual void set(
const std::string& attribute,
const std::vector<uint16_t>& value) = 0;
265 virtual void set(
const std::string& attribute,
const std::vector<int16_t>& value) = 0;
268 virtual void set(
const std::string& attribute,
const std::vector<uint32_t>& value) = 0;
271 virtual void set(
const std::string& attribute,
const std::vector<int32_t>& value) = 0;
274 virtual void set(
const std::string& attribute,
const std::vector<uint64_t>& value) = 0;
277 virtual void set(
const std::string& attribute,
const std::vector<int64_t>& value) = 0;
280 virtual void set(
const std::string& attribute,
const std::vector<float>& value) = 0;
283 virtual void set(
const std::string& attribute,
const std::vector<double>& value) = 0;
286 virtual void set(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
289 virtual void set_enum(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
292 virtual void set_class(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
295 virtual void set_date(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
298 virtual void set_time(
const std::string& attribute,
const std::vector<std::string>& value) = 0;
301 virtual void set(
const std::string& association,
const ConfigObject * value,
bool skip_non_null_check) = 0;
304 virtual void set(
const std::string& association,
const std::vector<const ConfigObject*>& value,
bool skip_non_null_check) = 0;
307 virtual void move(
const std::string& at) = 0;
310 virtual void rename(
const std::string& new_id) = 0;
375 void convert(std::vector<uint8_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
377 void convert(std::vector<uint16_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
378 void convert(std::vector<int16_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
379 void convert(std::vector<uint32_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
380 void convert(std::vector<int32_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
381 void convert(std::vector<uint64_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
382 void convert(std::vector<int64_t>& value,
const ConfigObject&
obj,
const std::string& attr_name)
noexcept;
385 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 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.
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...