Public Types |
Public Member Functions |
Static Public Member Functions |
Private Member Functions |
Private Attributes |
Static Private Attributes |
List of all members
CUnitConversionEngine Class Reference
#include <UnitConversionEngine.h>
Public Types | |
| typedef std::vector< CQuantityTypeDescriptor * > | QuantityTypeList |
| typedef std::vector< CUnitDescriptor * > | UnitList |
| typedef std::vector< CPrefixDescriptor * > | PrefixList |
| typedef std::vector< CQuantityConversionDescriptor * > | QuantityConversionList |
| typedef std::unordered_map< char, unsigned int > | PrefixMap |
| typedef std::unordered_map< std::string, unsigned int > | UnitSymbolMap |
| typedef std::unordered_map< std::string, unsigned int > | QuantityNameMap |
| typedef std::unordered_map< CQuantityConversionKey, unsigned int > | QuantityConversionMap |
| typedef std::unordered_map< CUnitDimension, unsigned int > | DimensionToQuantityMap |
Public Member Functions | |
| double | ConvertValue (const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const |
| double | ConvertValue (const double &value, const std::string &fromUnit, const std::string &toUnit) const |
| double | QuickConvertValue (const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const |
| double | QuickConvertValue (const double &value, const std::string &fromUnit, const std::string &toUnit) const |
| double | ConvertValueInterval (const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const |
| double | ConvertValueInterval (const double &value, const std::string &fromUnit, const std::string &toUnit) const |
| double | ConvertQuantityType (const double &value, const CCompoundUnit &fromUnit, const CCompoundUnit &toUnit) const |
| int | GetUnitID (const std::string &unitSym) const |
| int | GetQuantityTypeID (const std::string &qtName) const |
| int | GetQuantityTypeID (const CUnitDimension &ud) const |
| int | GetQuantityConversionID (const CUnitDimension *fromDim, const CUnitDimension *toDim) const |
| bool | GetQuantityConversionParams (const CUnitDimension *fromDim, const CUnitDimension *toDim, double &fromExp, CCompoundUnit &mappingUnit) const |
| CCompoundUnit * | GetCompoundUnit (const std::string &unitString) const |
| bool | LookupFullUnit (const std::string &fullUnitSym, int &unitID, double &prefixScaleFac) const |
| bool | LookupFullUnit (const std::string &fullUnitSym, int &unitID, int &prefixID) const |
| const CUnitDescriptor & | GetUnitDescriptor (int unitID) const |
| const CQuantityTypeDescriptor & | GetQuantityTypeDescriptor (int qtID) const |
| const CPrefixDescriptor & | GetPrefixDescriptor (int pfxID) const |
| const CQuantityConversionDescriptor & | GetQuantityConversionDescriptor (int qcID) const |
| int | GetNumQuantities () |
| int | GetNumFundamentalQuantities () |
| void | LoadDefinitions () |
| CUnitDescriptor * | NewUnit (const std::string &name, const std::string &symbol, unsigned int quantityTypeId, const std::string &targetUnit, const double &convFac, const double &bias, CUnitDescriptor::PrefixModeType mode, const std::string &prefixSet) |
| CQuantityTypeDescriptor * | NewQuantityType (const std::string &name, const std::string &expansion="", bool twentyLog=false) |
| CPrefixDescriptor * | NewPrefix (const std::string &name, const std::string &sym, const double &scaleFac) |
| CQuantityConversionDescriptor * | NewQuantityConversion (const std::string &fromTypeName, double fromExp, const std::string &toTypeName, const std::string &mappingUnit) |
Static Public Member Functions | |
| static CUnitConversionEngine & | GetEngine (void) |
| static void | DestroyEngine () |
Private Member Functions | |
| CUnitConversionEngine () | |
| CUnitConversionEngine (const CUnitConversionEngine &) | |
| ~CUnitConversionEngine () | |
| void | GetUCEdefs () |
Private Attributes | |
| QuantityTypeList * | m_QTList |
| UnitList * | m_UList |
| PrefixList * | m_PList |
| QuantityConversionList * | m_QCList |
| PrefixMap * | m_PMap |
| UnitSymbolMap * | m_USMap |
| QuantityNameMap * | m_QNMap |
| QuantityConversionMap * | m_QCMap |
| DimensionToQuantityMap * | m_D2QMap |
| int | m_iNumFundamentalQuantities |
| int | m_iNumQuantities |
| std::stringstream | m_UCEdefs |
Static Private Attributes | |
| static CUnitConversionEngine * | uce =nullptr |
Member Typedef Documentation
◆ DimensionToQuantityMap
| typedef std::unordered_map<CUnitDimension, unsigned int> CUnitConversionEngine::DimensionToQuantityMap |
◆ PrefixList
| typedef std::vector<CPrefixDescriptor*> CUnitConversionEngine::PrefixList |
◆ PrefixMap
| typedef std::unordered_map<char,unsigned int> CUnitConversionEngine::PrefixMap |
◆ QuantityConversionList
| typedef std::vector<CQuantityConversionDescriptor*> CUnitConversionEngine::QuantityConversionList |
◆ QuantityConversionMap
| typedef std::unordered_map<CQuantityConversionKey, unsigned int> CUnitConversionEngine::QuantityConversionMap |
◆ QuantityNameMap
| typedef std::unordered_map<std::string,unsigned int> CUnitConversionEngine::QuantityNameMap |
◆ QuantityTypeList
| typedef std::vector<CQuantityTypeDescriptor*> CUnitConversionEngine::QuantityTypeList |
◆ UnitList
| typedef std::vector<CUnitDescriptor*> CUnitConversionEngine::UnitList |
◆ UnitSymbolMap
| typedef std::unordered_map<std::string,unsigned int> CUnitConversionEngine::UnitSymbolMap |
Constructor & Destructor Documentation
◆ CUnitConversionEngine() [1/2]
|
private |
◆ CUnitConversionEngine() [2/2]
|
inlineprivate |
◆ ~CUnitConversionEngine()
|
private |
Member Function Documentation
◆ ConvertQuantityType()
| double CUnitConversionEngine::ConvertQuantityType | ( | const double & | value, |
| const CCompoundUnit & | fromUnit, | ||
| const CCompoundUnit & | toUnit | ||
| ) | const |
◆ ConvertValue() [1/2]
| double CUnitConversionEngine::ConvertValue | ( | const double & | value, |
| const CCompoundUnit & | fromUnit, | ||
| const CCompoundUnit & | toUnit | ||
| ) | const |
◆ ConvertValue() [2/2]
| double CUnitConversionEngine::ConvertValue | ( | const double & | value, |
| const std::string & | fromUnit, | ||
| const std::string & | toUnit | ||
| ) | const |
◆ ConvertValueInterval() [1/2]
| double CUnitConversionEngine::ConvertValueInterval | ( | const double & | value, |
| const CCompoundUnit & | fromUnit, | ||
| const CCompoundUnit & | toUnit | ||
| ) | const |
◆ ConvertValueInterval() [2/2]
| double CUnitConversionEngine::ConvertValueInterval | ( | const double & | value, |
| const std::string & | fromUnit, | ||
| const std::string & | toUnit | ||
| ) | const |
◆ DestroyEngine()
|
inlinestatic |
◆ GetCompoundUnit()
| CCompoundUnit * CUnitConversionEngine::GetCompoundUnit | ( | const std::string & | unitString | ) | const |
◆ GetEngine()
|
inlinestatic |
◆ GetNumFundamentalQuantities()
|
inline |
◆ GetNumQuantities()
|
inline |
◆ GetPrefixDescriptor()
|
inline |
◆ GetQuantityConversionDescriptor()
|
inline |
◆ GetQuantityConversionID()
| int CUnitConversionEngine::GetQuantityConversionID | ( | const CUnitDimension * | fromDim, |
| const CUnitDimension * | toDim | ||
| ) | const |
◆ GetQuantityConversionParams()
| bool CUnitConversionEngine::GetQuantityConversionParams | ( | const CUnitDimension * | fromDim, |
| const CUnitDimension * | toDim, | ||
| double & | fromExp, | ||
| CCompoundUnit & | mappingUnit | ||
| ) | const |
◆ GetQuantityTypeDescriptor()
|
inline |
◆ GetQuantityTypeID() [1/2]
| int CUnitConversionEngine::GetQuantityTypeID | ( | const CUnitDimension & | ud | ) | const |
◆ GetQuantityTypeID() [2/2]
| int CUnitConversionEngine::GetQuantityTypeID | ( | const std::string & | qtName | ) | const |
◆ GetUCEdefs()
|
private |
◆ GetUnitDescriptor()
|
inline |
◆ GetUnitID()
| int CUnitConversionEngine::GetUnitID | ( | const std::string & | unitSym | ) | const |
◆ LoadDefinitions()
| void CUnitConversionEngine::LoadDefinitions | ( | ) |
◆ LookupFullUnit() [1/2]
|
inline |
◆ LookupFullUnit() [2/2]
| bool CUnitConversionEngine::LookupFullUnit | ( | const std::string & | fullUnitSym, |
| int & | unitID, | ||
| int & | prefixID | ||
| ) | const |
◆ NewPrefix()
| CPrefixDescriptor * CUnitConversionEngine::NewPrefix | ( | const std::string & | name, |
| const std::string & | sym, | ||
| const double & | scaleFac | ||
| ) |
◆ NewQuantityConversion()
| CQuantityConversionDescriptor * CUnitConversionEngine::NewQuantityConversion | ( | const std::string & | fromTypeName, |
| double | fromExp, | ||
| const std::string & | toTypeName, | ||
| const std::string & | mappingUnit | ||
| ) |
◆ NewQuantityType()
| CQuantityTypeDescriptor * CUnitConversionEngine::NewQuantityType | ( | const std::string & | name, |
| const std::string & | expansion = "", |
||
| bool | twentyLog = false |
||
| ) |
◆ NewUnit()
| CUnitDescriptor * CUnitConversionEngine::NewUnit | ( | const std::string & | name, |
| const std::string & | symbol, | ||
| unsigned int | quantityTypeId, | ||
| const std::string & | targetUnit, | ||
| const double & | convFac, | ||
| const double & | bias, | ||
| CUnitDescriptor::PrefixModeType | mode, | ||
| const std::string & | prefixSet | ||
| ) |
◆ QuickConvertValue() [1/2]
| double CUnitConversionEngine::QuickConvertValue | ( | const double & | value, |
| const CCompoundUnit & | fromUnit, | ||
| const CCompoundUnit & | toUnit | ||
| ) | const |
◆ QuickConvertValue() [2/2]
| double CUnitConversionEngine::QuickConvertValue | ( | const double & | value, |
| const std::string & | fromUnit, | ||
| const std::string & | toUnit | ||
| ) | const |
Member Data Documentation
◆ m_D2QMap
|
private |
◆ m_iNumFundamentalQuantities
|
private |
◆ m_iNumQuantities
|
private |
◆ m_PList
|
private |
◆ m_PMap
|
private |
◆ m_QCList
|
private |
◆ m_QCMap
|
private |
◆ m_QNMap
|
private |
◆ m_QTList
|
private |
◆ m_UCEdefs
|
private |
◆ m_UList
|
private |
◆ m_USMap
|
private |
◆ uce
|
staticprivate |
