31 bool check_composite_only)
const
33 std::vector<ConfigObject> referees;
34 std::vector<tref> result;
43 { x.UID(), x.class_name() }));
45 catch (daq::dbe::config_object_retrieval_result_is_null
const & e)
63 for (
auto const & linked : obj.relations)
65 for (
auto const & candidate : linked.second)
67 record(candidate.ref());
70 this_remove_stack.push_back(obj);
76 std::swap(acopy, this_remove_stack);
78 while (not acopy.empty())
85 this_remove_stack.push_back(candidate);
93 if (this_notify_stack.empty())
95 for (
typename type_extractor_stack::value_type
const & val : this_remove_stack)
102 for (
typename type_ref_container::value_type
const & val : this_notify_stack)
111 if (not this_remove_stack.empty())
117 this_remove_stack.pop_front();
120 this_notify_stack.push_back(last);
122 if (this_remove_stack.empty())
128 throw daq::dbe::gref_empty_internal_queue_is_invalid_state(
ERS_HERE);
133 return this_remove_stack.front().is_null();
142 { this->that->template getdirect<ConfigObject>(key) };
144 if (voisin.is_null())
146 throw daq::dbe::config_object_retrieval_result_is_null(
ERS_HERE,key);
156std::vector<tref> authorized_getter<T, std::vector<tref>>::operator()(
157 std::string
const & key)
159 std::vector<ConfigObject> voisins
160 { this->that->template getdirect<std::vector<ConfigObject>>(key) };
169 { voisin.UID(), voisin.class_name() }));
171 catch (daq::dbe::config_object_retrieval_result_is_null
const & ex)
182template class authorized_getter<tref, tref> ;
183template class authorized_getter<tref, std::vector<tref>> ;
217 std::string
const & name,
218 bool check_composite_only)
220 std::vector<ConfigObject> linked;
223 std::vector<configobject::tref> references;
229 references.push_back(
get(
230 { anobj.UID(), anobj.class_name() }));
232 catch (daq::dbe::config_object_retrieval_result_is_null
const & e)
275 image.
ref.this_class,
276 image.
ref.this_name);
283 catch (dunedaq::conffwk::Exception
const & e)
289 catch (daq::dbe::Exception
const & e)
306 return obj.rebuild();
313 tref ret = obj.rebuild();
326 std::string
const & destfile)
339 std::string
const & newname)
347 std::string
const & aname)
352 std::shared_ptr<configobject::oref> current_ptr = objref.
refered;
369 t_object_map::iterator position;
370 std::tie(position, nofail) =
this_allobjects.emplace(*current_ptr, current_ptr);
374 throw daq::dbe::dbcontroller_internal_cache_failure(
ERS_HERE);
376 return position->second;
389 std::string
const & query)
393 std::vector<configobject::tref> result;
400 { keyin.UID(), keyin.class_name() }));
402 catch (daq::dbe::config_object_retrieval_result_is_null
const & e)
430 return position->second;
433 throw daq::dbe::config_object_retrieval_result_is_null (
ERS_HERE,
444 bool object_inserted;
445 t_object_map::iterator position;
448 std::tie(position, object_inserted) =
this_allobjects.emplace(*element, element);
450 if (not object_inserted)
457 return position->second;
469 if (not
ref.is_null())
497 if (this_referenced_object.is_null())
500 { this->this_name, this->this_class });
502 return this_referenced_object;
static tref set_object(tref newobj, dbe::t_config_object_preimage::type_attrmap const &attributes, dbe::t_config_object_preimage::type_relmap const &relations)
static void destroy_object(dunedaq::conffwk::ConfigObject &)
static dunedaq::conffwk::ConfigObject get_object(std::string const &, std::string const &)
static std::vector< dunedaq::conffwk::ConfigObject > query_class(std::string const &classname, std::string const &query)
static dunedaq::conffwk::ConfigObject create_object(std::string const &fn, std::string const &cn, std::string const &name)
static void rename_object(dunedaq::conffwk::ConfigObject &object, std::string const &newname)
inner::configobject::tref ref() const
U operator()(std::string const &key)
void record(tref const &obj)
std::function< void(dref const) > config_action_notifiable
std::deque< t_extractor > type_extractor_stack
type_extractor_stack this_remove_stack
void notify(config_action_notifiable tele)
std::vector< T > referenced_by(std::string const &name="*", bool check_composite_only=true) const
dunedaq::conffwk::ConfigObject & ref(bool check_null=true) const
std::shared_ptr< oref > refered
std::recursive_mutex t_mutex
std::lock_guard< t_mutex > locker
configobject::tref rename(configobject::tref objref, std::string const &aname)
static dbcontroller & ref()
configobject::gref< T > remove(dbe::tref ref)
static configobject::gref< T > delete_object_request(configobject::tref const &obj)
t_object_map this_allobjects
static std::vector< configobject::tref > gets(std::string const &cname, std::string const &query="")
configobject::tref insert(dunedaq::conffwk::ConfigObject const &)
std::vector< configobject::tref > referenced_by(configobject::tref objref, std::string const &name="*", bool check_composite_only=true)
static configobject::tref move_object_request(configobject::tref objref, std::string const &destfile)
configobject::tref lookup(dbe::cokey const &desc)
static configobject::tref get(dbe::cokey const &desc)
static configobject::tref rename_object_request(configobject::tref objref, std::string const &newname)
static configobject::tref create_object_request(dbe::t_config_object_preimage const &rep)
Represents database objects.
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.
bool is_null() const noexcept
Check if object's implementation points to null.
Generic configuration exception.
Only Configuration DB opened by rdbconfig or oksconflibs plug in can be const char *message Internal DBE references cannot point to null ConfigObject references
bool has_obj(std::string const &classname, std::string const &object_uid)
std::string const parse(ers::Issue const &)