The Gaudi Framework  master (37c0b60a)
Gaudi::Parsers::Units Class Referencefinal

#include </builds/gaudi/Gaudi/GaudiCoreSvc/src/JobOptionsSvc/Units.h>

Collaboration diagram for Gaudi::Parsers::Units:

Public Types

typedef std::map< std::string, std::pair< double, Position >, std::less<> > Container
 
typedef Container::mapped_type ValueWithPosition
 

Public Member Functions

bool Add (std::string name, double value)
 
bool Add (std::string name, double value, const Position &pos)
 
bool Find (std::string_view name, ValueWithPosition &result) const
 
bool Find (std::string_view name, double &result) const
 

Private Attributes

Container units_
 

Detailed Description

Definition at line 28 of file Units.h.

Member Typedef Documentation

◆ Container

Definition at line 30 of file Units.h.

◆ ValueWithPosition

typedef Container::mapped_type Gaudi::Parsers::Units::ValueWithPosition

Definition at line 31 of file Units.h.

Member Function Documentation

◆ Add() [1/2]

bool Gaudi::Parsers::Units::Add ( std::string  name,
double  value 
)

Definition at line 18 of file Units.cpp.

18 { return Add( std::move( name ), value, Position() ); }

◆ Add() [2/2]

bool Gaudi::Parsers::Units::Add ( std::string  name,
double  value,
const Position pos 
)

Definition at line 20 of file Units.cpp.

20  {
21  return units_.emplace( std::move( name ), ValueWithPosition( value, pos ) ).second;
22 }

◆ Find() [1/2]

bool Gaudi::Parsers::Units::Find ( std::string_view  name,
double &  result 
) const

Definition at line 24 of file Units.cpp.

24  {
26  if ( !Find( name, r ) ) return false;
27  result = r.first;
28  return true;
29 }

◆ Find() [2/2]

bool Gaudi::Parsers::Units::Find ( std::string_view  name,
ValueWithPosition result 
) const

Definition at line 31 of file Units.cpp.

31  {
32  auto it = units_.find( name );
33  if ( it == units_.end() ) return false;
34  result = it->second;
35  return true;
36 }

Member Data Documentation

◆ units_

Container Gaudi::Parsers::Units::units_
private

Definition at line 40 of file Units.h.


The documentation for this class was generated from the following files:
std::move
T move(T... args)
Gaudi::Parsers::Units::Find
bool Find(std::string_view name, ValueWithPosition &result) const
Definition: Units.cpp:31
std::map::find
T find(T... args)
std::map::emplace
T emplace(T... args)
Gaudi::Parsers::Units::Add
bool Add(std::string name, double value)
Definition: Units.cpp:18
ConditionsStallTest.name
name
Definition: ConditionsStallTest.py:77
std::map::end
T end(T... args)
Gaudi::Parsers::Units::ValueWithPosition
Container::mapped_type ValueWithPosition
Definition: Units.h:31
Gaudi::Parsers::Units::units_
Container units_
Definition: Units.h:40