QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Unit of measure specification More...
#include <unitofmeasure.hpp>
Classes | |
struct | Data |
Public Types | |
enum | Type { Mass , Volume , Energy , Quantity } |
Public Member Functions | |
UnitOfMeasure ()=default | |
default constructor More... | |
UnitOfMeasure (const std::string &name, const std::string &code, Type unitType) | |
Inspectors | |
const std::string & | name () const |
name, e.g, "Barrels" More... | |
const std::string & | code () const |
code, e.g, "BBL", "MT" More... | |
Type | unitType () const |
unit type (mass, volume...) More... | |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const UnitOfMeasure &, const UnitOfMeasure &) |
bool | operator!= (const UnitOfMeasure &, const UnitOfMeasure &) |
std::ostream & | operator<< (std::ostream &, const UnitOfMeasure &) |
Other information | |
ext::shared_ptr< Data > | data_ |
static std::map< std::string, ext::shared_ptr< UnitOfMeasure::Data > > | unitsOfMeasure_ |
bool | empty () const |
is this a usable instance? More... | |
const Rounding & | rounding () const |
const UnitOfMeasure & | triangulationUnitOfMeasure () const |
unit used for triangulation when required More... | |
Unit of measure specification
Definition at line 37 of file unitofmeasure.hpp.
enum Type |
Enumerator | |
---|---|
Mass | |
Volume | |
Energy | |
Quantity |
Definition at line 39 of file unitofmeasure.hpp.
|
default |
default constructor
Instances built via this constructor have undefined behavior. Such instances can only act as placeholders and must be reassigned to a valid currency before being used.
UnitOfMeasure | ( | const std::string & | name, |
const std::string & | code, | ||
UnitOfMeasure::Type | unitType | ||
) |
const std::string & name | ( | ) | const |
name, e.g, "Barrels"
Definition at line 105 of file unitofmeasure.hpp.
const std::string & code | ( | ) | const |
code, e.g, "BBL", "MT"
Definition at line 109 of file unitofmeasure.hpp.
UnitOfMeasure::Type unitType | ( | ) | const |
unit type (mass, volume...)
Definition at line 113 of file unitofmeasure.hpp.
bool empty | ( | ) | const |
is this a usable instance?
Definition at line 121 of file unitofmeasure.hpp.
const Rounding & rounding | ( | ) | const |
const UnitOfMeasure & triangulationUnitOfMeasure | ( | ) | const |
unit used for triangulation when required
Definition at line 126 of file unitofmeasure.hpp.
|
related |
|
related |
Definition at line 134 of file unitofmeasure.hpp.
|
related |
|
protected |
Definition at line 70 of file unitofmeasure.hpp.
|
staticprivate |
Definition at line 73 of file unitofmeasure.hpp.