QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
UnitOfMeasureConversionManager Class Reference

repository of conversion factors between units of measure More...

#include <unitofmeasureconversionmanager.hpp>

+ Inheritance diagram for UnitOfMeasureConversionManager:
+ Collaboration diagram for UnitOfMeasureConversionManager:

Public Member Functions

UnitOfMeasureConversion lookup (const CommodityType &commodityType, const UnitOfMeasure &, const UnitOfMeasure &, UnitOfMeasureConversion::Type type=UnitOfMeasureConversion::Derived) const
 
void add (const UnitOfMeasureConversion &)
 
void clear ()
 
- Public Member Functions inherited from Singleton< UnitOfMeasureConversionManager >
 Singleton (const Singleton &)=delete
 
 Singleton (Singleton &&)=delete
 
Singletonoperator= (const Singleton &)=delete
 
Singletonoperator= (Singleton &&)=delete
 
 ~Singleton ()=default
 

Private Member Functions

 UnitOfMeasureConversionManager ()
 
void addKnownConversionFactors ()
 
UnitOfMeasureConversion directLookup (const CommodityType &commodityType, const UnitOfMeasure &source, const UnitOfMeasure &target) const
 
UnitOfMeasureConversion smartLookup (const CommodityType &commodityType, const UnitOfMeasure &source, const UnitOfMeasure &target, std::list< std::string > forbidden=std::list< std::string >()) const
 

Private Attributes

std::list< UnitOfMeasureConversiondata_
 

Friends

class Singleton< UnitOfMeasureConversionManager >
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< UnitOfMeasureConversionManager >
static UnitOfMeasureConversionManagerinstance ()
 access to the unique instance More...
 
- Protected Member Functions inherited from Singleton< UnitOfMeasureConversionManager >
 Singleton ()=default
 

Detailed Description

repository of conversion factors between units of measure

Tests:
lookup of direct unit of measure conversion is tested.

Definition at line 36 of file unitofmeasureconversionmanager.hpp.

Constructor & Destructor Documentation

◆ UnitOfMeasureConversionManager()

Definition at line 57 of file unitofmeasureconversionmanager.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ lookup()

UnitOfMeasureConversion lookup ( const CommodityType commodityType,
const UnitOfMeasure source,
const UnitOfMeasure target,
UnitOfMeasureConversion::Type  type = UnitOfMeasureConversion::Derived 
) const

Definition at line 73 of file unitofmeasureconversionmanager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ add()

void add ( const UnitOfMeasureConversion c)

Definition at line 61 of file unitofmeasureconversionmanager.cpp.

+ Here is the caller graph for this function:

◆ clear()

void clear ( )

Definition at line 101 of file unitofmeasureconversionmanager.cpp.

+ Here is the call graph for this function:

◆ addKnownConversionFactors()

void addKnownConversionFactors ( )
private

Definition at line 106 of file unitofmeasureconversionmanager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ directLookup()

UnitOfMeasureConversion directLookup ( const CommodityType commodityType,
const UnitOfMeasure source,
const UnitOfMeasure target 
) const
private

Definition at line 137 of file unitofmeasureconversionmanager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ smartLookup()

UnitOfMeasureConversion smartLookup ( const CommodityType commodityType,
const UnitOfMeasure source,
const UnitOfMeasure target,
std::list< std::string >  forbidden = std::list<std::string>() 
) const
private

Definition at line 165 of file unitofmeasureconversionmanager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ Singleton< UnitOfMeasureConversionManager >

friend class Singleton< UnitOfMeasureConversionManager >
friend

Definition at line 1 of file unitofmeasureconversionmanager.hpp.

Member Data Documentation

◆ data_

std::list<UnitOfMeasureConversion> data_
private

Definition at line 51 of file unitofmeasureconversionmanager.hpp.