UnitConversionEngine.h
58 double ConvertValue(const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const;
59 double ConvertValue(const double &value, const std::string &fromUnit, const std::string &toUnit) const;
60 double QuickConvertValue(const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const;
61 double QuickConvertValue(const double &value, const std::string &fromUnit, const std::string &toUnit) const;
64 double ConvertValueInterval(const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const;
65 double ConvertValueInterval(const double &value, const std::string &fromUnit, const std::string &toUnit) const;
66 double ConvertQuantityType(const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const;
79 // if looking up conversion in opposite direction from that which was defined. The two reference parameters
83 // conversion factor contains the mapping unit and has already been raised to the necessary power
88 bool GetQuantityConversionParams(const CUnitDimension *fromDim, const CUnitDimension *toDim, double &fromExp, CCompoundUnit &mappingUnit) const;
160 CUnitDescriptor *NewUnit(const std::string &name, const std::string &symbol, unsigned int quantityTypeId, const std::string &targetUnit,
161 const double &convFac, const double &bias, CUnitDescriptor::PrefixModeType mode, const std::string &prefixSet);
162 CQuantityTypeDescriptor *NewQuantityType(const std::string &name, const std::string &expansion = "", bool twentyLog = false);
164 CPrefixDescriptor *NewPrefix(const std::string &name, const std::string &sym, const double &scaleFac);
165 CQuantityConversionDescriptor *NewQuantityConversion(const std::string &fromTypeName, double fromExp, const std::string &toTypeName,
Definition: CompoundUnit.h:40
Definition: PrefixDescriptor.h:14
Definition: QuantityConversionDescriptor.h:14
Definition: QuantityTypeDescriptor.h:17
Definition: UnitConversionEngine.h:24
static CUnitConversionEngine & GetEngine(void)
Definition: UnitConversionEngine.h:41
CUnitConversionEngine(const CUnitConversionEngine &)
Definition: UnitConversionEngine.h:175
QuantityConversionList * m_QCList
Definition: UnitConversionEngine.h:183
DimensionToQuantityMap * m_D2QMap
Definition: UnitConversionEngine.h:188
std::unordered_map< CQuantityConversionKey, unsigned int > QuantityConversionMap
Definition: UnitConversionEngine.h:38
int m_iNumFundamentalQuantities
Definition: UnitConversionEngine.h:190
const CPrefixDescriptor & GetPrefixDescriptor(int pfxID) const
Definition: UnitConversionEngine.h:134
std::vector< CPrefixDescriptor * > PrefixList
Definition: UnitConversionEngine.h:31
std::unordered_map< std::string, unsigned int > UnitSymbolMap
Definition: UnitConversionEngine.h:36
int GetNumFundamentalQuantities()
Definition: UnitConversionEngine.h:151
std::unordered_map< std::string, unsigned int > QuantityNameMap
Definition: UnitConversionEngine.h:37
static void DestroyEngine()
Definition: UnitConversionEngine.h:51
bool LookupFullUnit(const std::string &fullUnitSym, int &unitID, double &prefixScaleFac) const
Definition: UnitConversionEngine.h:96
std::vector< CUnitDescriptor * > UnitList
Definition: UnitConversionEngine.h:30
const CQuantityConversionDescriptor & GetQuantityConversionDescriptor(int qcID) const
Definition: UnitConversionEngine.h:140
std::unordered_map< char, unsigned int > PrefixMap
Definition: UnitConversionEngine.h:35
std::unordered_map< CUnitDimension, unsigned int > DimensionToQuantityMap
Definition: UnitConversionEngine.h:39
std::vector< CQuantityConversionDescriptor * > QuantityConversionList
Definition: UnitConversionEngine.h:32
std::vector< CQuantityTypeDescriptor * > QuantityTypeList
Definition: UnitConversionEngine.h:29
const CUnitDescriptor & GetUnitDescriptor(int unitID) const
Definition: UnitConversionEngine.h:122
const CQuantityTypeDescriptor & GetQuantityTypeDescriptor(int qtID) const
Definition: UnitConversionEngine.h:128
Definition: UnitDescriptor.h:13
Definition: UnitDimension.h:22