DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
confobject_extra.hpp
Go to the documentation of this file.
1/*
2 * confobject_extra.hpp
3 *
4 * Created on: Jan 19, 2016
5 * Author: Leonidas Georgopoulos
6 */
7
8#ifndef DBE_CONFOBJECT_EXTRA_HPP_
9#define DBE_CONFOBJECT_EXTRA_HPP_
10
15
16#include "conffwk/Schema.hpp"
17#include <string>
18
19namespace dbe
20{
21
22//------------------------------------------------------------------------------------------
23template<typename C>
25{
26public:
27 typedef typename C::t_confobjects t_confobjects;
28 typedef typename C::t_attrmap t_attrmap;
29 typedef typename C::t_relmap t_relmap;
30
36 static t_attrmap getattr ( typename C::t_confobject const & obj )
37 {
39 obj.class_name(), false );
40 t_attrmap attributes;
41
42 for ( dunedaq::conffwk::attribute_t const & attr : classt.p_attributes )
43 {
44 typename t_attrmap::mapped_type values
45 {
47 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 {
65 obj.class_name(), false );
66 t_relmap relations;
67
68 for ( dunedaq::conffwk::relationship_t const & link : classt.p_relationships )
69 {
70 if ( C::filter ( link ) )
71 {
72 t_confobjects linked
73 {
75 link ) };
76
77 if ( not linked.empty() )
78 {
79 relations[link.p_name] = linked;
80 }
81 }
82 }
83
84 return relations;
85 }
86};
87//------------------------------------------------------------------------------------------
88
89//------------------------------------------------------------------------------------------
93template<typename S = std::string>
94struct config_object_aggregates:
95 config_object_representation<S>
96{
99
108
109 static bool filter ( dunedaq::conffwk::relationship_t const & l )
110 {
111 return l.p_is_aggregation;
112 }
113
114};
116//------------------------------------------------------------------------------------------
117
118//------------------------------------------------------------------------------------------
122template<typename S = std::string>
125{
128
137
138 static bool filter()
139 {
140 return true;
141 }
142};
144//------------------------------------------------------------------------------------------
145
146}// namespace dbe
147
148#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_aggregates(config_object_description< S > const &o)
static bool filter(dunedaq::conffwk::relationship_t const &l)
config_object_extractor< config_object_aggregates< S > > t_extractor
config_object_representation< S >::t_confobject t_confobject
config_object_representation< S >::t_confobject t_confobject
config_object_linked(config_object_description< S > const &o)
config_object_extractor< config_object_linked< S > > t_extractor
const std::vector< attribute_t > p_attributes
Definition Schema.hpp:163
const std::vector< relationship_t > p_relationships
Definition Schema.hpp:164