All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Units.h
Go to the documentation of this file.
1 #ifndef JOBOPTIONSVC_UNITS_H_
2 #define JOBOPTIONSVC_UNITS_H_
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // STD & STL:
7 // ============================================================================
8 #include <string>
9 #include <map>
10 // ============================================================================
11 #include "Position.h"
12 // ============================================================================
13 
14 // ============================================================================
15 namespace Gaudi { namespace Parsers {
16 // ============================================================================
17 class Units final {
18  public:
20  typedef Container::mapped_type ValueWithPosition;
21 
22  bool Add(std::string name, double value);
23  bool Add(std::string name, double value, const Position& pos);
24 
25  bool Find(const std::string& name, ValueWithPosition& result) const;
26  bool Find(const std::string& name, double& result) const;
27  std::string ToString() const;
28  private:
29  Container units_;
30 };
31 
32 // ============================================================================
33 } /* Gaudi */ } /* Parsers */
34 // ============================================================================
35 
36 #endif /* UNITS_H_ */
bool Find(const std::string &name, ValueWithPosition &result) const
Definition: Units.cpp:23
Container units_
Definition: Units.h:29
STL class.
STL class.
std::map< std::string, std::pair< double, Position > > Container
Definition: Units.h:19
Container::mapped_type ValueWithPosition
Definition: Units.h:20
bool Add(std::string name, double value)
Definition: Units.cpp:8
std::string ToString() const
Helper functions to set/get the application return code.
Definition: __init__.py:1