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