DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::conffwk::ConfigObject Class Reference

Represents database objects. More...

#include <ConfigObject.hpp>

Collaboration diagram for dunedaq::conffwk::ConfigObject:
[legend]

Public Member Functions

 ConfigObject () noexcept
 Default constructor.
 
 ConfigObject (const ConfigObject &other) noexcept
 Copy constructor.
 
 ConfigObject (ConfigObjectImpl *impl) noexcept
 Construct object from implementation object.
 
 ~ConfigObject () noexcept
 Destructor.
 
ConfigObjectoperator= (const ConfigObject &other) noexcept
 Assignment operator.
 
ConfigObjectoperator= (ConfigObjectImpl *impl) noexcept
 Assignment from implementation object.
 
bool operator== (const ConfigObject &other) const noexcept
 Compare two objects.
 
ConfigObjectget_obj_pybind (const std::string &attrname)
 
template<typename T >
get_value_pybind (const std::string &attrname)
 
template<typename T >
std::vector< T > get_list_pybind (const std::string &attrname)
 
template<typename T >
void set_list_pybind (const std::string &attrname, std::vector< T > l)
 
bool is_null () const noexcept
 Check if object's implementation points to null.
 
bool is_deleted () const
 Check if object was deleted.
 
const std::string & UID () const noexcept
 Return object identity.
 
const std::string & class_name () const noexcept
 Return object's class name.
 
const std::string full_name () const noexcept
 Return full object name.
 
const std::string contained_in () const
 Return the name of the database file this object belongs to.
 
template<class T >
void get (const std::string &name, T &value)
 Get value of object's attribute or relationship.
 
bool rel (const std::string &name, std::vector< ConfigObject > &value)
 Get value of object's relationship.
 
void referenced_by (std::vector< ConfigObject > &value, const std::string &relationship_name="*", bool check_composite_only=true, unsigned long rlevel=0, const std::vector< std::string > *rclasses=nullptr) const
 Get objects which have references to given object.
 
Configurationget_configuration () const
 Get pointer to configuration object.
 
void set_obj (const std::string &name, const ConfigObject *o, bool skip_non_null_check=false)
 Set relationship single-value.
 
void set_objs (const std::string &name, const std::vector< const ConfigObject * > &o, bool skip_non_null_check=false)
 Set relationship multi-value.
 
template<class T >
void set_by_val (const std::string &name, T value)
 Set attribute value.
 
template<class T >
void set_by_ref (const std::string &name, T &value)
 Set attribute value.
 
void set_enum (const std::string &name, const std::string &value)
 Set attribute enumeration value.
 
void set_class (const std::string &name, const std::string &value)
 Set attribute class value.
 
void set_date (const std::string &name, const std::string &value)
 Set attribute date value.
 
void set_time (const std::string &name, const std::string &value)
 Set attribute time value.
 
void set_enum (const std::string &name, const std::vector< std::string > &value)
 Set attribute vector-of-enumerations value.
 
void set_class (const std::string &name, const std::vector< std::string > &value)
 Set attribute vector-of-class value.
 
void set_date (const std::string &name, const std::vector< std::string > &value)
 Set attribute vector-of-dates value.
 
void set_time (const std::string &name, const std::vector< std::string > &value)
 Set attribute vector-of-times value.
 
void move (const std::string &at)
 Move object to a different database.
 
void rename (const std::string &new_id)
 Rename object.
 
void print_ptr (std::ostream &s) const noexcept
 Print object's pointer in format 'obj-id@class-name'.
 
void print_ref (std::ostream &s, Configuration &conf, const std::string &prefix="", bool show_contained_in=false) const noexcept
 Print details of object's attributes and relationships.
 
const ConfigObjectImplimplementation () const noexcept
 Returns pointer on implementation.
 

Private Member Functions

void action_on_object_update (Configuration *db, const std::string &name)
 
void _clear () noexcept
 

Private Attributes

ConfigObjectImplm_impl
 

Friends

class Configuration
 
class ConfigurationImpl
 
class DalObject
 
class DalRegistry
 

Detailed Description

Represents database objects.

The class has default constructor, so user can declare instances locally or as a part of an array as he likes. However, the only way to retrieve a valid instance of the class is to call either Configuration::get(const std::string&, const std::string&, ConfigObject&) or Configuration::get(const std::string&, std::vector<ConfigObject>&) method.

The class has a copy constructor and an assignment operator, i.e. instances can be copied, passed by value, etc. All necessary bookkeeping is done transparent to user.

The class has methods to report object's class and identity:

  • class_name() return actual class name of the object
  • UID() return object's unique identity inside given class

Apart from this there is only one template method get() to retrieve values of object's attributes and relationships.

Definition at line 46 of file ConfigObject.hpp.

Constructor & Destructor Documentation

◆ ConfigObject() [1/3]

dunedaq::conffwk::ConfigObject::ConfigObject ( )
noexcept

Default constructor.

The object is invalid until it is initialized by the Configuration::get(const std::string&, const std::string&, ConfigObject&) or Configuration::get(const std::string&, std::vector<ConfigObject>&) method.

Definition at line 13 of file ConfigObject.cpp.

13 :
14 m_impl(nullptr)
15{
16}

◆ ConfigObject() [2/3]

dunedaq::conffwk::ConfigObject::ConfigObject ( const ConfigObject & other)
noexcept

Copy constructor.

All necessary bookkeeping relevant to implementation is done transparent to user.

Definition at line 18 of file ConfigObject.cpp.

18 :
19 m_impl(other.m_impl)
20{
21}

◆ ConfigObject() [3/3]

dunedaq::conffwk::ConfigObject::ConfigObject ( ConfigObjectImpl * impl)
noexcept

Construct object from implementation object.

Definition at line 23 of file ConfigObject.cpp.

23 :
24 m_impl(impl)
25{
26}

◆ ~ConfigObject()

dunedaq::conffwk::ConfigObject::~ConfigObject ( )
noexcept

Destructor.

Definition at line 28 of file ConfigObject.cpp.

29{
30}

Member Function Documentation

◆ _clear()

void dunedaq::conffwk::ConfigObject::_clear ( )
inlineprivatenoexcept

Definition at line 614 of file ConfigObject.hpp.

615 {
616 if (m_impl)
617 {
618 m_impl->clear();
619 }
620 }
virtual void clear() noexcept
Virtual method to clean resources used by the implementation object.

◆ action_on_object_update()

void dunedaq::conffwk::ConfigObject::action_on_object_update ( Configuration * db,
const std::string & name )
private

Definition at line 94 of file ConfigObject.cpp.

95{
96 db->action_on_update(*this, name);
97}

◆ class_name()

const std::string & dunedaq::conffwk::ConfigObject::class_name ( ) const
inlinenoexcept

Return object's class name.

It corresponds to the actual name of the class from the database implementation.

The pair UID (see UID() method) and class name allows to identify object inside database.

Definition at line 231 of file ConfigObject.hpp.

231{ return *m_impl->m_class_name; }

◆ contained_in()

const std::string dunedaq::conffwk::ConfigObject::contained_in ( ) const
inline

Return the name of the database file this object belongs to.

Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 249 of file ConfigObject.hpp.

250 {
251 return m_impl->contained_in();
252 }
virtual const std::string contained_in() const =0
Virtual method to get object's database file name.

◆ full_name()

const std::string dunedaq::conffwk::ConfigObject::full_name ( ) const
inlinenoexcept

Return full object name.

The method combines object identity and it's class name. Such full name is unique for any database object.

Definition at line 241 of file ConfigObject.hpp.

241{ return UID() + '@' + class_name(); }
const std::string & UID() const noexcept
Return object identity.
const std::string & class_name() const noexcept
Return object's class name.

◆ get()

template<class T >
void dunedaq::conffwk::ConfigObject::get ( const std::string & name,
T & value )
inline

Get value of object's attribute or relationship.

Template parameter T can be:

  • bool
  • int8_t and uint8_t
  • int16_t and uint16_t
  • int32_t and uint32_t
  • int64_t and uint64_t
  • float
  • double
  • std::string
  • ConfigObject&
  • std::vector<T> of above types

All operations are simply forwarded to the implementation.

Parameters
namename of attribute or relationship
valuetype of attribute or relationship
Exceptions
dunedaq::conffwk::Exceptionin case of an error

Definition at line 278 of file ConfigObject.hpp.

278 {
279 m_impl->get(name, value);
280 m_impl->convert(value, *this, name);
281 }
void convert(bool &value, const ConfigObject &obj, const std::string &attr_name) noexcept
virtual void get(const std::string &attribute, bool &value)=0
Virtual method to read boolean attribute value.

◆ get_configuration()

Configuration * dunedaq::conffwk::ConfigObject::get_configuration ( ) const

Get pointer to configuration object.

Definition at line 81 of file ConfigObject.cpp.

82{
83 return m_impl->m_impl->m_conf;
84}
Configuration * m_conf
Configuration pointer is needed for notification on changes, e.g. in case of subscription or an objec...

◆ get_list_pybind()

template<typename T >
std::vector< T > dunedaq::conffwk::ConfigObject::get_list_pybind ( const std::string & attrname)
inline

Definition at line 124 of file ConfigObject.hpp.

124 {
125 std::vector<T> attrvals;
126 this->get(attrname, attrvals);
127 return attrvals;
128 }
void get(const std::string &name, T &value)
Get value of object's attribute or relationship.

◆ get_obj_pybind()

ConfigObject * dunedaq::conffwk::ConfigObject::get_obj_pybind ( const std::string & attrname)

Definition at line 297 of file ConfigObject.cpp.

297 {
298
299 ConfigObject* newobject = new ConfigObject;
300
301 if (newobject) {
302 this->get(attrname, *newobject);
303
304 if (newobject->is_null()) {
305 delete newobject;
306 return nullptr;
307 }
308 }
309
310 return newobject;
311}
ConfigObject() noexcept
Default constructor.

◆ get_value_pybind()

template<typename T >
T dunedaq::conffwk::ConfigObject::get_value_pybind ( const std::string & attrname)
inline

Definition at line 117 of file ConfigObject.hpp.

117 {
118 T attrval;
119 this->get(attrname, attrval);
120 return attrval;
121 }

◆ implementation()

const ConfigObjectImpl * dunedaq::conffwk::ConfigObject::implementation ( ) const
inlinenoexcept

Returns pointer on implementation.

This method exists only by the performance reasons.

Definition at line 608 of file ConfigObject.hpp.

608{return m_impl;}

◆ is_deleted()

bool dunedaq::conffwk::ConfigObject::is_deleted ( ) const
inline

Check if object was deleted.

Definition at line 192 of file ConfigObject.hpp.

193 {
194 return (m_impl->is_deleted());
195 }
bool is_deleted() const
Check object and return true if the object has been deleted.

◆ is_null()

bool dunedaq::conffwk::ConfigObject::is_null ( ) const
inlinenoexcept

Check if object's implementation points to null.

Returns false, if the object points to a valid implementation object. The object can point to null implementation object, if it was initialized via Configuration::get(relationship, object) and the relationship's value is not set.

Definition at line 181 of file ConfigObject.hpp.

182 {
183 return (m_impl == nullptr);
184 }

◆ move()

void dunedaq::conffwk::ConfigObject::move ( const std::string & at)
inline

Move object to a different database.

Forward operation to the implementation.

Parameters
atname of database file
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 564 of file ConfigObject.hpp.

564 {
565 m_impl->move(at);
566 }
virtual void move(const std::string &at)=0
Virtual method to move object to a file.

◆ operator=() [1/2]

ConfigObject & dunedaq::conffwk::ConfigObject::operator= ( ConfigObjectImpl * impl)
noexcept

Assignment from implementation object.

Definition at line 43 of file ConfigObject.cpp.

44{
45 if(m_impl != impl) {
46 m_impl = impl;
47 }
48
49 return *this;
50}

◆ operator=() [2/2]

ConfigObject & dunedaq::conffwk::ConfigObject::operator= ( const ConfigObject & other)
noexcept

Assignment operator.

All necessary bookkeeping relevant to implementation is done transparent to user.

Definition at line 33 of file ConfigObject.cpp.

34{
35 if(this != &other) {
36 m_impl = other.m_impl;
37 }
38
39 return *this;
40}

◆ operator==()

bool dunedaq::conffwk::ConfigObject::operator== ( const ConfigObject & other) const
noexcept

Compare two objects.

Definition at line 53 of file ConfigObject.cpp.

54{
55 if(this == &other || m_impl == other.m_impl) return true; // the objects or implementations are the same
56 if(!m_impl || !other.m_impl) return false; // only one of objects has no implementation
57 return ((UID() == other.UID()) && (class_name() == other.class_name()));
58}

◆ print_ptr()

void dunedaq::conffwk::ConfigObject::print_ptr ( std::ostream & s) const
noexcept

Print object's pointer in format 'obj-id@class-name'.

Definition at line 61 of file ConfigObject.cpp.

62{
63 if(m_impl)
64 {
65 if(m_impl->is_deleted())
66 {
67 s << "(deleted object " << full_name() << ')';
68 }
69 else
70 {
71 s << full_name();
72 }
73 }
74 else
75 {
76 s << "(null)";
77 }
78}
const std::string full_name() const noexcept
Return full object name.

◆ print_ref()

void dunedaq::conffwk::ConfigObject::print_ref ( std::ostream & s,
Configuration & conf,
const std::string & prefix = "",
bool show_contained_in = false ) const
noexcept

Print details of object's attributes and relationships.

Parameters
sthe output stream
confthe configuration object (required to read schema description)
prefixoptional shift output using prefix
show_contained_inoptional print out info about object database file

Definition at line 194 of file ConfigObject.cpp.

195{
196 static bool expand_aggregation = (getenv("TDAQ_CONFFWK_PRINT_EXPAND_AGGREGATIONS")); // FIXME tdaq-09-05-00 => add new parameter to conffwk and add fuse
197
198 // check if it is not a reference to 0
199 if (is_null_obj(this))
200 {
201 s << prefix << "(null)";
202 return;
203 }
204
205 // print out object-id and class-name
206 s
207 << prefix << "Object:\n"
208 << prefix << " id: \'" << UID() << "\', class name: \'" << class_name() << "\'\n";
209
210 if (show_contained_in)
211 s << prefix << " contained in: \'" << contained_in() << "\'\n";
212
213 try
214 {
215 const dunedaq::conffwk::class_t& cd(conffwk.get_class_info(class_name()));
216
217 // print attributes
218 for (const auto& i : cd.p_attributes)
219 {
220 const std::string& aname(i.p_name); // attribute name
221 const bool ismv(i.p_is_multi_value); // attribute is multi-value
222
223 s << prefix << " " << aname << ": ";
224
225 switch (i.p_type)
226 {
232 print_value<std::string>(*this, aname, ismv, '\"', s); break;
233 case dunedaq::conffwk::bool_type: print_value<bool>(*this, aname, ismv, 0, s); break;
234 case dunedaq::conffwk::u8_type: print_value<uint8_t>(*this, aname, ismv, 0, s); break;
235 case dunedaq::conffwk::s8_type: print_value<int8_t>(*this, aname, ismv, 0, s); break;
236 case dunedaq::conffwk::u16_type: print_value<uint16_t>(*this, aname, ismv, 0, s); break;
237 case dunedaq::conffwk::s16_type: print_value<int16_t>(*this, aname, ismv, 0, s); break;
238 case dunedaq::conffwk::u32_type: print_value<uint32_t>(*this, aname, ismv, 0, s); break;
239 case dunedaq::conffwk::s32_type: print_value<int32_t>(*this, aname, ismv, 0, s); break;
240 case dunedaq::conffwk::u64_type: print_value<uint64_t>(*this, aname, ismv, 0, s); break;
241 case dunedaq::conffwk::s64_type: print_value<int64_t>(*this, aname, ismv, 0, s); break;
242 case dunedaq::conffwk::float_type: print_value<float>(*this, aname, ismv, 0, s); break;
243 case dunedaq::conffwk::double_type: print_value<double>(*this, aname, ismv, 0, s); break;
244 default: s << "*** bad type ***";
245 }
246
247 s << std::endl;
248 }
249
250 // print relationships
251 for (const auto& i : cd.p_relationships)
252 {
253 s << prefix << " " << i.p_name << ':';
254 if (expand_aggregation == false || i.p_is_aggregation == false)
255 {
256 s << ' ';
257 print_value<ConfigObject>(*this, i.p_name, (i.p_cardinality == dunedaq::conffwk::zero_or_many) || (i.p_cardinality == dunedaq::conffwk::one_or_many), '\"', s);
258 s << std::endl;
259 }
260 else
261 {
262 s << std::endl;
263 std::string prefix2(prefix + " ");
264 ConfigObject& obj = const_cast<ConfigObject&>(*this);
265 if ((i.p_cardinality == dunedaq::conffwk::zero_or_many) || (i.p_cardinality == dunedaq::conffwk::one_or_many))
266 {
267 std::vector<ConfigObject> value;
268 obj.get(i.p_name, value);
269 if (value.empty())
270 s << prefix2 << "(null)\n";
271 else
272 for (const auto& x : value)
273 x.print_ref(s, conffwk, prefix2, show_contained_in);
274 }
275 else
276 {
277 ConfigObject value;
278 obj.get(i.p_name, value);
279 if (value.is_null())
280 s << prefix2 << "(null)\n";
281 else
282 value.print_ref(s, conffwk, prefix2, show_contained_in);
283 }
284 }
285 }
286 }
287 catch (dunedaq::conffwk::Exception& ex)
288 {
289 s << "cannot get schema description: caught dunedaq::conffwk::Exception exception" << std::endl;
290 std::cerr << "ERROR: " << ex << std::endl;
291 }
292
293}
const std::string contained_in() const
Return the name of the database file this object belongs to.
bool is_null_obj(const ConfigObject *o)
void print_value(const ConfigObject &const_obj, const std::string &name, const bool ismv, const char sep, std::ostream &s)

◆ referenced_by()

void dunedaq::conffwk::ConfigObject::referenced_by ( std::vector< ConfigObject > & value,
const std::string & relationship_name = "*",
bool check_composite_only = true,
unsigned long rlevel = 0,
const std::vector< std::string > * rclasses = nullptr ) const
inline

Get objects which have references to given object.

The method returns objects, which have references on given object via explicitly provided relationship name. If the relationship name is set to "*", then the method takes into account all relationships of all objects. The method is efficient only for composite relationships (i.e. when a parent has composite reference on this object). For generic relationships the method performs full scan of all database objects, so at large scale this method should not be applied to every object.

Parameters
valuereturned objects
relationship_namename of relationship (if "*", then return objects referencing via ANY relationship)
check_composite_onlyonly returned composite parent objects
rleveloptional references level to optimize performance (defines how many objects referenced by given object have also to be read to the implementation cache)
rclassesoptional array of class names to optimize performance (defines which referenced objects have to be read to the implementation cache)
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 327 of file ConfigObject.hpp.

331 {
332 m_impl->referenced_by(value, relationship_name, check_composite_only, rlevel, rclasses);
333 }
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.

◆ rel()

bool dunedaq::conffwk::ConfigObject::rel ( const std::string & name,
std::vector< ConfigObject > & value )
inline

Get value of object's relationship.

Forward to implementation and convert value.

Parameters
namename of relationship
valuereturned value of relationship
Returns
true if there is such relationship and false otherwise
Exceptions
dunedaq::conffwk::Exceptionin case of an error

Definition at line 297 of file ConfigObject.hpp.

298 {
299 if (m_impl->rel(name, value))
300 {
301 m_impl->convert(value, *this, name);
302 return true;
303 }
304
305 return false;
306 }
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...

◆ rename()

void dunedaq::conffwk::ConfigObject::rename ( const std::string & new_id)

Rename object.

Forward operation to the implementation.

Parameters
new_idnew object ID
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 87 of file ConfigObject.cpp.

88{
89 get_configuration()->rename_object(*this, new_id);
91}
Configuration * get_configuration() const
Get pointer to configuration object.
void action_on_object_update(Configuration *db, const std::string &name)
void rename_object(ConfigObject &obj, const std::string &new_id)
Cache of template object of given type.

◆ set_by_ref()

template<class T >
void dunedaq::conffwk::ConfigObject::set_by_ref ( const std::string & name,
T & value )
inline

Set attribute value.

Template parameter T can be:

  • std::string
  • std::vector<T> of bool, [un]signed char, [un]signed short, [un]signed long, float, double, std::string

All operations are simply forwarded to the implementation.

Parameters
namename of attribute
valuetype of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 412 of file ConfigObject.hpp.

412 {
413 m_impl->set(name, value);
415 }
virtual void set(const std::string &attribute, bool value)=0
Virtual method to set boolean attribute value.

◆ set_by_val()

template<class T >
void dunedaq::conffwk::ConfigObject::set_by_val ( const std::string & name,
T value )
inline

Set attribute value.

Template parameter T can be:

  • bool
  • int8_t and uint8_t (old char)
  • int16_t and uint16_t (old short)
  • int32_t and uint32_t (old long)
  • int64_t and uint64_t
  • float
  • double

All operations are simply forwarded to the implementation.

Parameters
namename of attribute
valuetype of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 391 of file ConfigObject.hpp.

391 {
392 m_impl->set(name, value);
394 }

◆ set_class() [1/2]

void dunedaq::conffwk::ConfigObject::set_class ( const std::string & name,
const std::string & value )
inline

Set attribute class value.

Forward operation to the implementation.

Parameters
namename of attribute
valuevalue of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 446 of file ConfigObject.hpp.

446 {
447 m_impl->set_class(name, value);
449 }
virtual void set_class(const std::string &attribute, const std::string &value)=0
Virtual method to set enumeration attribute value.

◆ set_class() [2/2]

void dunedaq::conffwk::ConfigObject::set_class ( const std::string & name,
const std::vector< std::string > & value )
inline

Set attribute vector-of-class value.

Forward operation to the implementation.

Parameters
namename of attribute
valuevalue of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 514 of file ConfigObject.hpp.

514 {
515 m_impl->set_class(name, value);
517 }

◆ set_date() [1/2]

void dunedaq::conffwk::ConfigObject::set_date ( const std::string & name,
const std::string & value )
inline

Set attribute date value.

Forward operation to the implementation.

Parameters
namename of attribute
valuevalue of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 463 of file ConfigObject.hpp.

463 {
464 m_impl->set_date(name, value);
466 }
virtual void set_date(const std::string &attribute, const std::string &value)=0
Virtual method to set date attribute value.

◆ set_date() [2/2]

void dunedaq::conffwk::ConfigObject::set_date ( const std::string & name,
const std::vector< std::string > & value )
inline

Set attribute vector-of-dates value.

Forward operation to the implementation.

Parameters
namename of attribute
valuevalue of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 531 of file ConfigObject.hpp.

531 {
532 m_impl->set_date(name, value);
534 }

◆ set_enum() [1/2]

void dunedaq::conffwk::ConfigObject::set_enum ( const std::string & name,
const std::string & value )
inline

Set attribute enumeration value.

Forward operation to the implementation.

Parameters
namename of attribute
valuevalue of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 429 of file ConfigObject.hpp.

429 {
430 m_impl->set_enum(name, value);
432 }
virtual void set_enum(const std::string &attribute, const std::string &value)=0
Virtual method to set enumeration attribute value.

◆ set_enum() [2/2]

void dunedaq::conffwk::ConfigObject::set_enum ( const std::string & name,
const std::vector< std::string > & value )
inline

Set attribute vector-of-enumerations value.

Forward operation to the implementation.

Parameters
namename of attribute
valuevalue of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 497 of file ConfigObject.hpp.

497 {
498 m_impl->set_enum(name, value);
500 }

◆ set_list_pybind()

template<typename T >
void dunedaq::conffwk::ConfigObject::set_list_pybind ( const std::string & attrname,
std::vector< T > l )
inline

Definition at line 131 of file ConfigObject.hpp.

131 {
132 this->set_by_ref(attrname, l);
133 }
void set_by_ref(const std::string &name, T &value)
Set attribute value.

◆ set_obj()

void dunedaq::conffwk::ConfigObject::set_obj ( const std::string & name,
const ConfigObject * o,
bool skip_non_null_check = false )
inline

Set relationship single-value.

Parameters
namename of relationship
opointer to object
skip_non_null_checkif true, ignore low cardinality constraint
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 349 of file ConfigObject.hpp.

349 {
350 m_impl->set(name, o, skip_non_null_check);
352 }

◆ set_objs()

void dunedaq::conffwk::ConfigObject::set_objs ( const std::string & name,
const std::vector< const ConfigObject * > & o,
bool skip_non_null_check = false )
inline

Set relationship multi-value.

Parameters
namename of relationship
ovector of pointers on conffwk object
skip_non_null_checkif true, ignore low cardinality constraint
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 365 of file ConfigObject.hpp.

365 {
366 m_impl->set(name, o, skip_non_null_check);
368 }

◆ set_time() [1/2]

void dunedaq::conffwk::ConfigObject::set_time ( const std::string & name,
const std::string & value )
inline

Set attribute time value.

Forward operation to the implementation.

Parameters
namename of attribute
valuevalue of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 480 of file ConfigObject.hpp.

480 {
481 m_impl->set_time(name, value);
483 }
virtual void set_time(const std::string &attribute, const std::string &value)=0
Virtual method to set time attribute value.

◆ set_time() [2/2]

void dunedaq::conffwk::ConfigObject::set_time ( const std::string & name,
const std::vector< std::string > & value )
inline

Set attribute vector-of-times value.

Forward operation to the implementation.

Parameters
namename of attribute
valuevalue of attribute
Exceptions
dunedaq::conffwk::Genericin case of an error

Definition at line 548 of file ConfigObject.hpp.

548 {
549 m_impl->set_time(name, value);
551 }

◆ UID()

const std::string & dunedaq::conffwk::ConfigObject::UID ( ) const
inlinenoexcept

Return object identity.

The identity corresponds to the unique identity of object within it's class. It is taken from database implementation. For named objects it can be a meaningful string.

The pair UID and class name (see class_name() method) allows to identify object inside database.

Definition at line 218 of file ConfigObject.hpp.

Friends And Related Symbol Documentation

◆ Configuration

friend class Configuration
friend

Definition at line 48 of file ConfigObject.hpp.

◆ ConfigurationImpl

friend class ConfigurationImpl
friend

Definition at line 49 of file ConfigObject.hpp.

◆ DalObject

friend class DalObject
friend

Definition at line 50 of file ConfigObject.hpp.

◆ DalRegistry

friend class DalRegistry
friend

Definition at line 51 of file ConfigObject.hpp.

Member Data Documentation

◆ m_impl

ConfigObjectImpl* dunedaq::conffwk::ConfigObject::m_impl
private

Definition at line 625 of file ConfigObject.hpp.


The documentation for this class was generated from the following files: