The Gaudi Framework
v32r2 (46d42edc)
Units.cpp
Go to the documentation of this file.
1
// ============================================================================
2
// Include files
3
// ============================================================================
4
#include "
Units.h
"
5
// ============================================================================
6
namespace
gp
=
Gaudi::Parsers
;
7
// ============================================================================
8
bool
gp::Units::Add(
std::string
name
,
double
value ) {
return
Add(
std::move
(
name
), value,
Position
() ); }
9
// ============================================================================
10
bool
gp::Units::Add(
std::string
name
,
double
value,
const
Position
& pos ) {
11
return
units_.emplace(
std::move
(
name
),
ValueWithPosition
( value, pos ) ).second;
12
}
13
// ============================================================================
14
bool
gp::Units::Find(
const
std::string
&
name
,
double
& result )
const
{
15
ValueWithPosition
r;
16
if
( !Find(
name
, r ) )
return
false
;
17
result = r.first;
18
return
true
;
19
}
20
// ============================================================================
21
bool
gp::Units::Find(
const
std::string
&
name
,
ValueWithPosition
& result )
const
{
22
auto
it = units_.find(
name
);
23
if
( it == units_.end() )
return
false
;
24
result = it->second;
25
return
true
;
26
}
gaudiComponentHelp.name
name
Definition:
gaudiComponentHelp.py:42
std::string
STL class.
Gaudi::Parsers::Position
Definition:
Position.h:13
std::move
T move(T... args)
Units.h
Gaudi::Parsers
Definition:
DODBasicMapper.cpp:7
Gaudi::Parsers::Units::ValueWithPosition
Container::mapped_type ValueWithPosition
Definition:
Units.h:21
GaudiCoreSvc
src
JobOptionsSvc
Units.cpp
Generated on Sat Sep 28 2019 18:06:48 for The Gaudi Framework by
1.8.15