ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigMonitoring
TrigIDR4Monitoring
src
ConfiguredValueUtils.h
Go to the documentation of this file.
1
/* emacs: this is -*- c++ -*- */
12
13
#ifndef TRIGIDR4MONITORING_CONFIGUREDVALUEUTILS_H
14
#define TRIGIDR4MONITORING_CONFIGUREDVALUEUTILS_H
15
16
#include <stdexcept>
17
18
#include "Gaudi/Property.h"
19
20
#include "
ConfiguredValue.h
"
21
22
23
#define GAUDI_OPERATOR_GENERATOR(OP) template<typename T, typename U> bool operator OP ( const Gaudi::Property<ConfiguredValue<T>>& p, const U& a ) { return p.value() OP a; }
24
#define REV_GAUDI_OPERATOR_GENERATOR(OP, REVOP) template<typename T, typename U> bool operator OP ( const U& a, const Gaudi::Property<ConfiguredValue<T>>& p ) { return p.value() REVOP a; }
25
26
27
GAUDI_OPERATOR_GENERATOR
(==)
28
GAUDI_OPERATOR_GENERATOR
(!=)
29
GAUDI_OPERATOR_GENERATOR
(<=)
30
GAUDI_OPERATOR_GENERATOR
(>=)
31
GAUDI_OPERATOR_GENERATOR
(<)
32
GAUDI_OPERATOR_GENERATOR
(>)
33
34
35
REV_GAUDI_OPERATOR_GENERATOR
(==,==)
36
REV_GAUDI_OPERATOR_GENERATOR
(!=,!=)
37
REV_GAUDI_OPERATOR_GENERATOR
(<=,>=)
38
REV_GAUDI_OPERATOR_GENERATOR
(>=,<=)
39
REV_GAUDI_OPERATOR_GENERATOR
(<,>)
40
REV_GAUDI_OPERATOR_GENERATOR
(>,<)
41
42
43
template<typename T,
bool
UnsetResult=false>
44
bool
isset
(
const
Gaudi
::
Property
<
ConfiguredValue
<T,UnsetResult>>& p ) {
return
p.value().
isset
(); }
45
46
47
template
<
typename
T,
bool
UnsetResult=false>
48
StatusCode
parse
(
ConfiguredValue<T>
& p,
const
Gaudi::Parsers::InputData& input) {
49
T value;
50
StatusCode
sc
=
parse
(value, input);
51
if
(
sc
.isSuccess()) p = value;
52
return
sc
;
53
}
54
55
template
<
typename
T,
bool
UnsetResult = false>
56
class
ConfiguredValueProperty
:
public
Gaudi::Property<ConfiguredValue<T, UnsetResult>> {
57
58
using
Base
= Gaudi::Property<ConfiguredValue<T, UnsetResult>>;
59
60
public
:
61
62
using
Base::Base;
63
64
operator
const
T&()
const
{
return
this->value(); }
65
66
bool
isset
()
const
{
return
this->value().isset(); }
67
68
};
69
70
template
<
typename
Exception=std::runtime_error,
typename
T>
71
const
T&
require_set
(
const
T& t ) {
72
if
( !t.isset() )
throw
Exception(
"no matching parameter "
+ t.name() );
73
return
t;
74
}
75
76
77
template
<
typename
... T>
78
void
require_set
(
const
T&... args) { (
require_set<std::runtime_error>
(args), ...); }
79
80
#endif
// TRIGIDR4MONITORING_CONFIGUREDVALUEUTILS_H
81
82
REV_GAUDI_OPERATOR_GENERATOR
#define REV_GAUDI_OPERATOR_GENERATOR(OP, REVOP)
Definition
ConfiguredValueUtils.h:24
GAUDI_OPERATOR_GENERATOR
#define GAUDI_OPERATOR_GENERATOR(OP)
Definition
ConfiguredValueUtils.h:23
require_set
const T & require_set(const T &t)
Definition
ConfiguredValueUtils.h:71
parse
StatusCode parse(ConfiguredValue< T > &p, const Gaudi::Parsers::InputData &input)
Definition
ConfiguredValueUtils.h:48
isset
bool isset(const Gaudi::Property< ConfiguredValue< T, UnsetResult > > &p)
Definition
ConfiguredValueUtils.h:44
ConfiguredValue.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
ConfiguredValueProperty
Definition
ConfiguredValueUtils.h:56
ConfiguredValueProperty::isset
bool isset() const
Definition
ConfiguredValueUtils.h:66
ConfiguredValueProperty::Base
Gaudi::Property< ConfiguredValue< T, UnsetResult > > Base
Definition
ConfiguredValueUtils.h:58
Property
Support class for PropertyMgr.
Definition
Property.h:23
const
Gaudi
=============================================================================
Definition
CaloGPUClusterAndCellDataMonitorOptions.h:274
ConfiguredValue
Definition
ConfiguredValue.h:25
Generated on
for ATLAS Offline Software by
1.17.0