StdAir Logo  0.43.0
C++ Standard Airline IT Library
DictionaryManager.cpp
Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // StdAir
00005 #include <stdair/basic/DictionaryManager.hpp>
00006 #include <stdair/basic/BasConst_General.hpp>
00007 
00008 namespace stdair {
00009   // ////////////////////////////////////////////////////////////////////
00010   const stdair::Probability_T DictionaryManager::
00011   keyToValue (const DictionaryKey_T iKey) {
00012     const float lValue =
00013       static_cast<float> (iKey) / DEFAULT_NUMBER_OF_SUBDIVISIONS;
00014     const stdair::Probability_T lProbability (lValue);
00015     return lProbability;
00016   }
00017 
00018   // ////////////////////////////////////////////////////////////////////
00019   const DictionaryKey_T DictionaryManager::
00020   valueToKey (const stdair::Probability_T iValue) {
00021     const unsigned short lValueMultipliedByThousand =
00022       iValue * DEFAULT_NUMBER_OF_SUBDIVISIONS;
00023     const DictionaryKey_T lDictionaryKey (lValueMultipliedByThousand);
00024     return lDictionaryKey;
00025   }
00026 }