Gaudi Framework, version v25r0
Home
Generated: Mon Feb 17 2014
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GaudiCoreSvc
src
JobOptionsSvc
Units.cpp
Go to the documentation of this file.
1
// $Id:$
2
// ============================================================================
3
// Include files
4
// ============================================================================
5
#include "
Units.h
"
6
// ============================================================================
7
namespace
gp = Gaudi::Parsers;
8
// ============================================================================
9
bool
gp::Units::Add(
const
std::string
& name,
double
value) {
10
return
Add(name, value,
Position
());
11
}
12
// ============================================================================
13
bool
gp::Units::Add(
const
std::string
& name,
double
value,
14
const
Position
& pos) {
15
std::pair<Container::iterator,bool>
result =
16
units_.insert(
17
Container::value_type
(name,
ValueWithPosition
(value, pos))
18
);
19
return
result.
second
;
20
}
21
// ============================================================================
22
bool
gp::Units::Find(
const
std::string
& name,
double
& result)
const
{
23
24
ValueWithPosition
r;
25
if
(Find(name,r)){
26
result = r.
first
;
27
return
true
;
28
}
29
return
false
;
30
}
31
// ============================================================================
32
bool
gp::Units::Find(
const
std::string
& name,
33
ValueWithPosition
& result)
const
{
34
Container::const_iterator
it = units_.find(name);
35
if
(it != units_.end()) {
36
result = it->
second
;
37
return
true
;
38
}
39
return
false
;
40
}
Generated at Mon Feb 17 2014 14:37:41 for Gaudi Framework, version v25r0 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004