DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
dbe
include
dbe
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
16
#include "
dbe/config_api_get.hpp
"
17
#include "
dbe/config_api_info.hpp
"
18
#include "
dbe/config_api_graph.hpp
"
19
#include "
dbe/confobject_desc.hpp
"
20
21
#include "
conffwk/Schema.hpp
"
22
#include <string>
23
24
namespace
dbe
25
{
26
27
//------------------------------------------------------------------------------------------
28
template
<
typename
C>
29
class
config_object_extractor
30
{
31
public
:
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
{
43
dunedaq::conffwk::class_t
const
& classt =
dbe::config::api::info::onclass::definition
(
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
{
51
dbe::config::api::get::attribute::list<typename t_attrmap::mapped_type>
( obj.ref(),
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
{
69
dunedaq::conffwk::class_t
const
& classt =
dbe::config::api::info::onclass::definition
(
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
{
79
dbe::config::api::graph::linked::through::relation<t_confobjects>
( obj.ref(),
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
//------------------------------------------------------------------------------------------
98
template
<
typename
S = std::
string
>
99
struct
config_object_aggregates
:
100
config_object_representation
<S>
101
{
102
typedef
typename
config_object_representation<S>::t_confobject
t_confobject
;
103
typedef
config_object_extractor<config_object_aggregates<S>
>
t_extractor
;
104
105
config_object_aggregates
(
config_object_description<S>
const
& o )
106
:
107
config_object_representation
<S>
108
{
109
t_extractor::getattr
( o ),
t_extractor::getrel
( o ), o
110
}
111
{
112
}
113
114
static
bool
filter
(
dunedaq::conffwk::relationship_t
const
& l )
115
{
116
return
l.p_is_aggregation;
117
}
118
119
};
120
typedef
config_object_aggregates<>
config_object_aggregator
;
121
//------------------------------------------------------------------------------------------
122
123
//------------------------------------------------------------------------------------------
127
template
<
typename
S = std::
string
>
128
struct
config_object_linked
:
129
config_object_representation
<S>
130
{
131
typedef
typename
config_object_representation<S>::t_confobject
t_confobject
;
132
typedef
config_object_extractor<config_object_linked<S>
>
t_extractor
;
133
134
config_object_linked
(
config_object_description<S>
const
& o )
135
:
136
config_object_representation
<S>
137
{
138
t_extractor::getattr
( o ),
t_extractor::getrel
( o ), o
139
}
140
{
141
}
142
143
static
bool
filter
()
144
{
145
return
true
;
146
}
147
};
148
typedef
config_object_linked<>
config_object_linker
;
149
//------------------------------------------------------------------------------------------
150
151
}
// namespace dbe
152
153
#endif
/* DBE_CONFOBJECT_EXTRA_HPP_ */
dbe::config::api::get::attribute::list
static T list(dbe::inner::configobject::tref obj, dunedaq::conffwk::attribute_t const &attr)
Definition
config_api_get.cpp:178
dbe::config::api::info::onclass::definition
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
Definition
config_api_info.cpp:116
dbe::config_object_description
Definition
confobject_desc.hpp:38
dbe::config_object_extractor
Definition
confobject_extra.hpp:30
dbe::config_object_extractor::getattr
static t_attrmap getattr(typename C::t_confobject const &obj)
Definition
confobject_extra.hpp:41
dbe::config_object_extractor::getrel
static t_relmap getrel(typename C::t_confobject const &obj)
Definition
confobject_extra.hpp:67
dbe::config_object_extractor::t_relmap
C::t_relmap t_relmap
Definition
confobject_extra.hpp:34
dbe::config_object_extractor::t_attrmap
C::t_attrmap t_attrmap
Definition
confobject_extra.hpp:33
dbe::config_object_extractor::t_confobjects
C::t_confobjects t_confobjects
Definition
confobject_extra.hpp:32
Schema.hpp
config_api_get.hpp
config_api_graph.hpp
config_api_info.hpp
confobject_desc.hpp
dbe::config::api::graph::linked::through::relation
T relation(tref item, dunedaq::conffwk::relationship_t const &relation)
dbe
Include QT Headers.
Definition
BatchChangeWidget.hpp:18
dbe::config_object_aggregator
config_object_aggregates config_object_aggregator
Definition
confobject_extra.hpp:120
dbe::config_object_linker
config_object_linked config_object_linker
Definition
confobject_extra.hpp:148
dbe::config_object_aggregates
Definition
confobject_extra.hpp:101
dbe::config_object_aggregates::t_confobject
config_object_representation< S >::t_confobject t_confobject
Definition
confobject_extra.hpp:102
dbe::config_object_aggregates::config_object_aggregates
config_object_aggregates(config_object_description< S > const &o)
Definition
confobject_extra.hpp:105
dbe::config_object_aggregates::t_extractor
config_object_extractor< config_object_aggregates< S > > t_extractor
Definition
confobject_extra.hpp:103
dbe::config_object_aggregates::filter
static bool filter(dunedaq::conffwk::relationship_t const &l)
Definition
confobject_extra.hpp:114
dbe::config_object_linked
Definition
confobject_extra.hpp:130
dbe::config_object_linked::t_extractor
config_object_extractor< config_object_linked< S > > t_extractor
Definition
confobject_extra.hpp:132
dbe::config_object_linked::t_confobject
config_object_representation< S >::t_confobject t_confobject
Definition
confobject_extra.hpp:131
dbe::config_object_linked::config_object_linked
config_object_linked(config_object_description< S > const &o)
Definition
confobject_extra.hpp:134
dbe::config_object_linked::filter
static bool filter()
Definition
confobject_extra.hpp:143
dbe::config_object_representation
Definition
confobject_desc.hpp:153
dbe::config_object_representation::t_confobject
config_object_description< S > t_confobject
Definition
confobject_desc.hpp:155
dunedaq::conffwk::attribute_t
Definition
Schema.hpp:59
dunedaq::conffwk::attribute_t::p_name
std::string p_name
Definition
Schema.hpp:61
dunedaq::conffwk::class_t
Definition
Schema.hpp:162
dunedaq::conffwk::class_t::p_attributes
const std::vector< attribute_t > p_attributes
Definition
Schema.hpp:170
dunedaq::conffwk::class_t::p_relationships
const std::vector< relationship_t > p_relationships
Definition
Schema.hpp:171
dunedaq::conffwk::relationship_t
Definition
Schema.hpp:120
dunedaq::conffwk::relationship_t::p_name
std::string p_name
Definition
Schema.hpp:122
Generated on
for DUNE-DAQ by
1.17.0