Go to the documentation of this file.00001
00002
00003
00004
00005 #include "Units.h"
00006
00007 namespace gp = Gaudi::Parsers;
00008
00009 bool gp::Units::Add(const std::string& name, double value) {
00010 return Add(name, value, Position());
00011 }
00012
00013 bool gp::Units::Add(const std::string& name, double value,
00014 const Position& pos) {
00015 std::pair<Container::iterator,bool> result =
00016 units_.insert(
00017 Container::value_type(name,ValueWithPosition(value, pos))
00018 );
00019 return result.second;
00020 }
00021
00022 bool gp::Units::Find(const std::string& name, double& result) const {
00023
00024 ValueWithPosition r;
00025 if (Find(name,r)){
00026 result = r.first;
00027 return true;
00028 }
00029 return false;
00030 }
00031
00032 bool gp::Units::Find(const std::string& name,
00033 ValueWithPosition& result) const {
00034 Container::const_iterator it = units_.find(name);
00035 if (it != units_.end()) {
00036 result = it->second;
00037 return true;
00038 }
00039 return false;
00040 }