QuantLib_Quantity man page

Quantity — Amount of a commodity.

Synopsis

#include <ql/experimental/commodities/quantity.hpp>

Public Member Functions

Constructors

Quantity ()

Quantity (const CommodityType &commodityType, const UnitOfMeasure &unitOfMeasure, Real amount)

Inspectors

const CommodityType & commodityType () const

const UnitOfMeasure & unitOfMeasure () const

Real amount () const

Quantity rounded () const

Quantity arithmetics
See below for non-member functions and for settings which determine the behavior of the operators.

Quantity operator+ () const

Quantity operator- () const

Quantity & operator+= (const Quantity &)

Quantity & operator-= (const Quantity &)

Quantity & operator*= (Real)

Quantity & operator/= (Real)

Friends

std::ostream & operator<< (std::ostream &, const Quantity &)

Conversion settings

These parameters are used for combining quantity amounts in different currencies

enum ConversionType { NoConversion, BaseUnitOfMeasureConversion, AutomatedConversion }

static ConversionType conversionType

static UnitOfMeasure baseUnitOfMeasure

Detailed Description

Amount of a commodity.

Member Enumeration Documentation

enum ConversionType

Enumerator

NoConversion
do not perform conversions
BaseUnitOfMeasureConversion
convert both operands to the base unitOfMeasure before converting
AutomatedConversion
return the result in the unitOfMeasure of the first operand

Author

Generated automatically by Doxygen for QuantLib from the source code.

Referenced By

baseUnitOfMeasure(3), BaseUnitOfMeasureConversion(3) and Quantity(3) are aliases of QuantLib_Quantity(3).

Fri Sep 23 2016 Version 1.8.1 QuantLib