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_graph.hpp
"
18
#include "
dbe/config_api_info.hpp
"
19
#include "
dbe/confobject_desc.hpp
"
20
21
#include "
conffwk/Schema.hpp
"
22
#include <string>
23
24
namespace
dbe
{
25
26
//------------------------------------------------------------------------------------------
27
template
<
typename
C>
28
class
config_object_extractor
29
{
30
public
:
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
) {
46
typename
t_attrmap::mapped_type values{
dbe::config::api::get::attribute::list<typename t_attrmap::mapped_type>
(
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)) {
69
t_confobjects
linked{
dbe::config::api::graph::linked::through::relation<t_confobjects>
(obj.ref(), 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
//------------------------------------------------------------------------------------------
86
template
<
typename
S = std::
string
>
87
struct
config_object_aggregates
:
config_object_representation
<S>
88
{
89
typedef
typename
config_object_representation<S>::t_confobject
t_confobject
;
90
typedef
config_object_extractor<config_object_aggregates<S>
>
t_extractor
;
91
92
config_object_aggregates
(
config_object_description<S>
const
& o)
93
:
config_object_representation
<S>{
t_extractor::getattr
(o),
t_extractor::getrel
(o), o }
94
{
95
}
96
97
static
bool
filter
(
dunedaq::conffwk::relationship_t
const
& l) {
return
l.p_is_aggregation; }
98
};
99
typedef
config_object_aggregates<>
config_object_aggregator
;
100
//------------------------------------------------------------------------------------------
101
102
//------------------------------------------------------------------------------------------
106
template
<
typename
S = std::
string
>
107
struct
config_object_linked
:
config_object_representation
<S>
108
{
109
typedef
typename
config_object_representation<S>::t_confobject
t_confobject
;
110
typedef
config_object_extractor<config_object_linked<S>
>
t_extractor
;
111
112
config_object_linked
(
config_object_description<S>
const
& o)
113
:
config_object_representation
<S>{
t_extractor::getattr
(o),
t_extractor::getrel
(o), o }
114
{
115
}
116
117
static
bool
filter
() {
return
true
; }
118
};
119
typedef
config_object_linked<>
config_object_linker
;
120
//------------------------------------------------------------------------------------------
121
122
}
// namespace dbe
123
124
#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:160
dbe::config::api::info::onclass::definition
static dunedaq::conffwk::class_t definition(std::string const &cn, bool direct_only)
Definition
config_api_info.cpp:102
dbe::config_object_description
Definition
confobject_desc.hpp:37
dbe::config_object_extractor
Definition
confobject_extra.hpp:29
dbe::config_object_extractor::getattr
static t_attrmap getattr(typename C::t_confobject const &obj)
Definition
confobject_extra.hpp:40
dbe::config_object_extractor::getrel
static t_relmap getrel(typename C::t_confobject const &obj)
Definition
confobject_extra.hpp:62
dbe::config_object_extractor::t_relmap
C::t_relmap t_relmap
Definition
confobject_extra.hpp:33
dbe::config_object_extractor::t_attrmap
C::t_attrmap t_attrmap
Definition
confobject_extra.hpp:32
dbe::config_object_extractor::t_confobjects
C::t_confobjects t_confobjects
Definition
confobject_extra.hpp:31
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:16
dbe::config_object_aggregator
config_object_aggregates config_object_aggregator
Definition
confobject_extra.hpp:99
dbe::config_object_linker
config_object_linked config_object_linker
Definition
confobject_extra.hpp:119
dbe::config_object_aggregates
Definition
confobject_extra.hpp:88
dbe::config_object_aggregates::t_confobject
config_object_representation< S >::t_confobject t_confobject
Definition
confobject_extra.hpp:89
dbe::config_object_aggregates::config_object_aggregates
config_object_aggregates(config_object_description< S > const &o)
Definition
confobject_extra.hpp:92
dbe::config_object_aggregates::t_extractor
config_object_extractor< config_object_aggregates< S > > t_extractor
Definition
confobject_extra.hpp:90
dbe::config_object_aggregates::filter
static bool filter(dunedaq::conffwk::relationship_t const &l)
Definition
confobject_extra.hpp:97
dbe::config_object_linked
Definition
confobject_extra.hpp:108
dbe::config_object_linked::t_extractor
config_object_extractor< config_object_linked< S > > t_extractor
Definition
confobject_extra.hpp:110
dbe::config_object_linked::t_confobject
config_object_representation< S >::t_confobject t_confobject
Definition
confobject_extra.hpp:109
dbe::config_object_linked::config_object_linked
config_object_linked(config_object_description< S > const &o)
Definition
confobject_extra.hpp:112
dbe::config_object_linked::filter
static bool filter()
Definition
confobject_extra.hpp:117
dbe::config_object_representation
Definition
confobject_desc.hpp:137
dbe::config_object_representation::t_confobject
config_object_description< S > t_confobject
Definition
confobject_desc.hpp:139
dunedaq::conffwk::attribute_t
Definition
Schema.hpp:60
dunedaq::conffwk::attribute_t::p_name
std::string p_name
Definition
Schema.hpp:62
dunedaq::conffwk::class_t
Definition
Schema.hpp:153
dunedaq::conffwk::class_t::p_attributes
const std::vector< attribute_t > p_attributes
Definition
Schema.hpp:161
dunedaq::conffwk::class_t::p_relationships
const std::vector< relationship_t > p_relationships
Definition
Schema.hpp:162
dunedaq::conffwk::relationship_t
Definition
Schema.hpp:117
dunedaq::conffwk::relationship_t::p_name
std::string p_name
Definition
Schema.hpp:119
Generated on
for DUNE-DAQ by
1.18.0