|
QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
#include <unitofmeasureconversion.hpp>
Collaboration diagram for UnitOfMeasureConversion:Classes | |
| struct | Data |
Public Types | |
| enum | Type { Direct , Derived } |
Public Member Functions | |
Constructors | |
| UnitOfMeasureConversion ()=default | |
| UnitOfMeasureConversion (const CommodityType &commodityType, const UnitOfMeasure &source, const UnitOfMeasure &target, Real conversionFactor) | |
Inspectors | |
| const UnitOfMeasure & | source () const |
| the source UOM. More... | |
| const UnitOfMeasure & | target () const |
| the target UOM. More... | |
| const CommodityType & | commodityType () const |
| the commodity type. More... | |
| Type | type () const |
| the type More... | |
| Real | conversionFactor () const |
| the conversion factor More... | |
| const std::string & | code () const |
Utility methods | |
| ext::shared_ptr< Data > | data_ |
| Quantity | convert (const Quantity &quantity) const |
| apply the conversion factor to a cash amount More... | |
| static UnitOfMeasureConversion | chain (const UnitOfMeasureConversion &r1, const UnitOfMeasureConversion &r2) |
| chain two conversion factors More... | |
| UnitOfMeasureConversion (const UnitOfMeasureConversion &r1, const UnitOfMeasureConversion &r2) | |
Definition at line 35 of file unitofmeasureconversion.hpp.
| enum Type |
| Enumerator | |
|---|---|
| Direct | given directly by the user |
| Derived | derived from conversion factors between other uoms |
Definition at line 37 of file unitofmeasureconversion.hpp.
|
default |
| UnitOfMeasureConversion | ( | const CommodityType & | commodityType, |
| const UnitOfMeasure & | source, | ||
| const UnitOfMeasure & | target, | ||
| Real | conversionFactor | ||
| ) |
the conversionFactor \( r \) is given with the convention that a unit of the source is worth \( r \) units of the target.
Definition at line 28 of file unitofmeasureconversion.cpp.
Here is the call graph for this function:
|
protected |
Definition at line 38 of file unitofmeasureconversion.cpp.
| const UnitOfMeasure & source | ( | ) | const |
the source UOM.
Definition at line 112 of file unitofmeasureconversion.hpp.
Here is the caller graph for this function:| const UnitOfMeasure & target | ( | ) | const |
the target UOM.
Definition at line 116 of file unitofmeasureconversion.hpp.
Here is the caller graph for this function:| const CommodityType & commodityType | ( | ) | const |
the commodity type.
Definition at line 108 of file unitofmeasureconversion.hpp.
Here is the caller graph for this function:| UnitOfMeasureConversion::Type type | ( | ) | const |
the type
Definition at line 124 of file unitofmeasureconversion.hpp.
| Real conversionFactor | ( | ) | const |
the conversion factor
Definition at line 120 of file unitofmeasureconversion.hpp.
Here is the caller graph for this function:| const std::string & code | ( | ) | const |
Definition at line 128 of file unitofmeasureconversion.hpp.
apply the conversion factor to a cash amount
Definition at line 61 of file unitofmeasureconversion.cpp.
Here is the call graph for this function:
|
static |
chain two conversion factors
Definition at line 94 of file unitofmeasureconversion.cpp.
Here is the caller graph for this function:
|
protected |
Definition at line 83 of file unitofmeasureconversion.hpp.