25#ifndef quantlib_unit_of_measure_conversion_hpp
26#define quantlib_unit_of_measure_conversion_hpp
67 const std::string&
code()
const;
91 std::pair<ext::shared_ptr<UnitOfMeasureConversion>,
92 ext::shared_ptr<UnitOfMeasureConversion> >
109 return data_->commodityType;
113 return data_->source;
117 return data_->target;
121 return data_->conversionFactor;
const std::string & code() const
const UnitOfMeasure & source() const
the source UOM.
Quantity convert(const Quantity &quantity) const
apply the conversion factor to a cash amount
const UnitOfMeasure & target() const
the target UOM.
Real conversionFactor() const
the conversion factor
UnitOfMeasureConversion()=default
const CommodityType & commodityType() const
the commodity type.
ext::shared_ptr< Data > data_
Type type() const
the type
static UnitOfMeasureConversion chain(const UnitOfMeasureConversion &r1, const UnitOfMeasureConversion &r2)
chain two conversion factors
Unit of measure specification
CommodityType commodityType
std::pair< ext::shared_ptr< UnitOfMeasureConversion >, ext::shared_ptr< UnitOfMeasureConversion > > conversionFactorChain