1#ifndef __DUNEDAQ_CONFFWK_DALREGISTRY_HPP__
2#define __DUNEDAQ_CONFFWK_DALREGISTRY_HPP__
47 std::vector<const DalObject*>
get(std::vector<ConfigObject>& objs,
bool upcast_unregistered=
false);
70 T *
get(
ConfigObject& obj,
bool init_children=
false,
bool init_object=
true);
94 T *
get(
const std::string& name,
bool init_children=
false,
bool init_object=
true,
unsigned long rlevel = 0,
const std::vector<std::string> * rclasses =
nullptr);
112 T *
find(
const std::string &
id);
123 bool is_valid(
const T *
object)
noexcept;
136 void update(
const std::vector<std::string>& modified,
137 const std::vector<std::string>& removed,
138 const std::vector<std::string>& created);
140 void update(
const std::string& class_name,
141 const std::vector<std::string>& modified,
142 const std::vector<std::string>& removed,
143 const std::vector<std::string>& created);
169 const T*
_ref(
ConfigObject& obj,
const std::string& name,
bool read_children);
184 void _ref(
ConfigObject& obj,
const std::string& name, std::vector<const T*>& results,
bool read_children);
205 void _rename_object(std::string class_name, std::string old_id, std::string new_id);
Represents database objects.
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...
DalObject * get(ConfigObject &obj, bool upcast_unregistered=false)
Configuration & configuration()
void _reset_objects()
Update state of objects after abort operations.
void update(const std::vector< std::string > &modified, const std::vector< std::string > &removed, const std::vector< std::string > &created)
Update cache of objects in case of modification.
const Configuration & configuration() const
void _rename_object(std::string class_name, std::string old_id, std::string new_id)
Rename object of given template class (multi-thread unsafe).
void clear()
Clear the content of the registy.
DalRegistry(Configuration &confdb)
Construct a new Dal Registry object.
std::unordered_map< uint, DalDomain > m_cache_domains
void unread_all()
Set the status of all objects in cache to unread.
const T * _ref(ConfigObject &obj, const std::string &name, bool read_children)
Get signle value of object's relation and instantiate result with it (multi-thread safe).
void update_class_maps()
Update the internal class domains map.
conffwk::fmap< uint > m_class_domain_map
void update_class_domain_map()
bool is_valid(const T *object) noexcept
Checks validity of pointer to an objects of given user class.
conffwk::map< DalObject * > cache