DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
confobject_extra.hpp
Go to the documentation of this file.
1// DUNE DAQ modification notice:
2// This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3// Fork baseline commit: dbe-02-12-17 (2022-05-12).
4// Renamed since fork: yes (from dbe/confobject_extra.hpp to include/dbe/confobject_extra.hpp).
5
6/*
7 * confobject_extra.hpp
8 *
9 * Created on: Jan 19, 2016
10 * Author: Leonidas Georgopoulos
11 */
12
13#ifndef DBE_CONFOBJECT_EXTRA_HPP_
14#define DBE_CONFOBJECT_EXTRA_HPP_
15
20
21#include "conffwk/Schema.hpp"
22#include <string>
23
24namespace dbe {
25
26//------------------------------------------------------------------------------------------
27template<typename C>
29{
30public:
31 typedef typename C::t_confobjects t_confobjects;
32 typedef typename C::t_attrmap t_attrmap;
33 typedef typename C::t_relmap t_relmap;
34
40 static t_attrmap getattr(typename C::t_confobject const& obj)
41 {
42 dunedaq::conffwk::class_t const& classt = dbe::config::api::info::onclass::definition(obj.class_name(), false);
43 t_attrmap attributes;
44
45 for (dunedaq::conffwk::attribute_t const& attr : classt.p_attributes) {
47 obj.ref(), attr) };
48 attributes[attr.p_name] = values;
49 }
50
51 return attributes;
52 }
53
62 static t_relmap getrel(typename C::t_confobject const& obj)
63 {
64 dunedaq::conffwk::class_t const& classt = dbe::config::api::info::onclass::definition(obj.class_name(), false);
65 t_relmap relations;
66
67 for (dunedaq::conffwk::relationship_t const& link : classt.p_relationships) {
68 if (C::filter(link)) {
70
71 if (not linked.empty()) {
72 relations[link.p_name] = linked;
73 }
74 }
75 }
76
77 return relations;
78 }
79};
80//------------------------------------------------------------------------------------------
81
82//------------------------------------------------------------------------------------------
86template<typename S = std::string>
100//------------------------------------------------------------------------------------------
101
102//------------------------------------------------------------------------------------------
106template<typename S = std::string>
120//------------------------------------------------------------------------------------------
121
122} // namespace dbe
123
124#endif /* DBE_CONFOBJECT_EXTRA_HPP_ */
static T list(dbe::inner::configobject::tref obj, dunedaq::conffwk::attribute_t const &attr)
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
static t_attrmap getattr(typename C::t_confobject const &obj)
static t_relmap getrel(typename C::t_confobject const &obj)
T relation(tref item, dunedaq::conffwk::relationship_t const &relation)
Include QT Headers.
config_object_aggregates config_object_aggregator
config_object_linked config_object_linker
config_object_representation< S >::t_confobject t_confobject
config_object_aggregates(config_object_description< S > const &o)
config_object_extractor< config_object_aggregates< S > > t_extractor
static bool filter(dunedaq::conffwk::relationship_t const &l)
config_object_extractor< config_object_linked< S > > t_extractor
config_object_representation< S >::t_confobject t_confobject
config_object_linked(config_object_description< S > const &o)
config_object_description< S > t_confobject
const std::vector< attribute_t > p_attributes
Definition Schema.hpp:161
const std::vector< relationship_t > p_relationships
Definition Schema.hpp:162