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
27//------------------------------------------------------------------------------------------
28template<typename C>
30{
31public:
32 typedef typename C::t_confobjects t_confobjects;
33 typedef typename C::t_attrmap t_attrmap;
34 typedef typename C::t_relmap t_relmap;
35
41 static t_attrmap getattr ( typename C::t_confobject const & obj )
42 {
44 obj.class_name(), false );
45 t_attrmap attributes;
46
47 for ( dunedaq::conffwk::attribute_t const & attr : classt.p_attributes )
48 {
49 typename t_attrmap::mapped_type values
50 {
52 attr ) };
53 attributes[attr.p_name] = values;
54 }
55
56 return attributes;
57 }
58
67 static t_relmap getrel ( typename C::t_confobject const & obj )
68 {
70 obj.class_name(), false );
71 t_relmap relations;
72
73 for ( dunedaq::conffwk::relationship_t const & link : classt.p_relationships )
74 {
75 if ( C::filter ( link ) )
76 {
77 t_confobjects linked
78 {
80 link ) };
81
82 if ( not linked.empty() )
83 {
84 relations[link.p_name] = linked;
85 }
86 }
87 }
88
89 return relations;
90 }
91};
92//------------------------------------------------------------------------------------------
93
94//------------------------------------------------------------------------------------------
98template<typename S = std::string>
121//------------------------------------------------------------------------------------------
122
123//------------------------------------------------------------------------------------------
127template<typename S = std::string>
149//------------------------------------------------------------------------------------------
150
151}// namespace dbe
152
153#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:170
const std::vector< relationship_t > p_relationships
Definition Schema.hpp:171