QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
|
Currency specification More...
#include <ql/currency.hpp>
Classes | |
struct | Data |
Public Member Functions | |
Constructors | |
Currency ()=default | |
default constructor More... | |
Currency (const std::string &name, const std::string &code, Integer numericCode, const std::string &symbol, const std::string &fractionSymbol, Integer fractionsPerUnit, const Rounding &rounding, const std::string &formatString, const Currency &triangulationCurrency=Currency(), const std::set< std::string > &minorUnitCodes={}) | |
Inspectors | |
const std::string & | name () const |
currency name, e.g, "U.S. Dollar" More... | |
const std::string & | code () const |
ISO 4217 three-letter code, e.g, "USD". More... | |
Integer | numericCode () const |
ISO 4217 numeric code, e.g, "840". More... | |
const std::string & | symbol () const |
symbol, e.g, "$" More... | |
const std::string & | fractionSymbol () const |
fraction symbol, e.g, "¢" More... | |
Integer | fractionsPerUnit () const |
number of fractionary parts in a unit, e.g, 100 More... | |
const Rounding & | rounding () const |
rounding convention More... | |
std::string | format () const |
output format More... | |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const Currency &, const Currency &) |
bool | operator!= (const Currency &, const Currency &) |
std::ostream & | operator<< (std::ostream &, const Currency &) |
Other information | |
ext::shared_ptr< Data > | data_ |
bool | empty () const |
is this a usable instance? More... | |
const Currency & | triangulationCurrency () const |
currency used for triangulated exchange when required More... | |
const std::set< std::string > & | minorUnitCodes () const |
minor unit codes, e.g. GBp, GBX for GBP More... | |
void | checkNonEmpty () const |
Currency specification
Definition at line 36 of file currency.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.
Currency | ( | const std::string & | name, |
const std::string & | code, | ||
Integer | numericCode, | ||
const std::string & | symbol, | ||
const std::string & | fractionSymbol, | ||
Integer | fractionsPerUnit, | ||
const Rounding & | rounding, | ||
const std::string & | formatString, | ||
const Currency & | triangulationCurrency = Currency() , |
||
const std::set< std::string > & | minorUnitCodes = {} |
||
) |
Definition at line 47 of file currency.cpp.
const std::string & name | ( | ) | const |
currency name, e.g, "U.S. Dollar"
Definition at line 137 of file currency.hpp.
const std::string & code | ( | ) | const |
ISO 4217 three-letter code, e.g, "USD".
Definition at line 142 of file currency.hpp.
Integer numericCode | ( | ) | const |
ISO 4217 numeric code, e.g, "840".
Definition at line 147 of file currency.hpp.
const std::string & symbol | ( | ) | const |
symbol, e.g, "$"
Definition at line 152 of file currency.hpp.
const std::string & fractionSymbol | ( | ) | const |
fraction symbol, e.g, "¢"
Definition at line 157 of file currency.hpp.
Integer fractionsPerUnit | ( | ) | const |
number of fractionary parts in a unit, e.g, 100
Definition at line 162 of file currency.hpp.
const Rounding & rounding | ( | ) | const |
rounding convention
Definition at line 167 of file currency.hpp.
std::string format | ( | ) | const |
output format
The format will be fed three positional parameters, namely, value, code, and symbol, in this order.
Definition at line 172 of file currency.hpp.
bool empty | ( | ) | const |
is this a usable instance?
Definition at line 177 of file currency.hpp.
const Currency & triangulationCurrency | ( | ) | const |
currency used for triangulated exchange when required
Definition at line 181 of file currency.hpp.
const std::set< std::string > & minorUnitCodes | ( | ) | const |
minor unit codes, e.g. GBp, GBX for GBP
Definition at line 186 of file currency.hpp.
|
private |
Definition at line 196 of file currency.hpp.
|
related |
|
protected |
Definition at line 91 of file currency.hpp.