Manages a list of currencies and contains a base currency used in the base conversion method.
Definition at line 126 of file money.h.
typedef CurrencyList::const_iterator OSB_LIB::CurrencyBook::ConstIterator |
typedef std::map<Currency::Oid, Currency> OSB_LIB::CurrencyBook::CurrencyList |
typedef CurrencyList::iterator OSB_LIB::CurrencyBook::Iterator |
typedef CurrencyList::size_type OSB_LIB::CurrencyBook::SizeType |
OSB_LIB::CurrencyBook::CurrencyBook | ( | ) | [inline] |
void OSB_LIB::CurrencyBook::add | ( | const Currency & | currency, | |
bool | isBase = false | |||
) |
Add a currency to the currency book.
currency | The currency to add. | |
isBase | Pass true if the currency should be set as base currency. |
OsbException | if the currency to add is already in the book. | |
OsbException | if a base currency is already set. |
const Currency::Oid& OSB_LIB::CurrencyBook::baseCurrency | ( | ) | const |
Get base currency code.
ConstIterator OSB_LIB::CurrencyBook::begin | ( | ) | const [inline] |
Const iterator to the beginning of the list.
Definition at line 162 of file money.h.
References currencyList_.
Iterator OSB_LIB::CurrencyBook::begin | ( | ) | [inline] |
Iterator to the beginning of the list.
Definition at line 158 of file money.h.
References currencyList_.
void OSB_LIB::CurrencyBook::clear | ( | ) |
Deletes the currency list and resets the base currency.
ConstIterator OSB_LIB::CurrencyBook::end | ( | ) | const [inline] |
Const iterator to the end of the list.
Definition at line 164 of file money.h.
References currencyList_.
Iterator OSB_LIB::CurrencyBook::end | ( | ) | [inline] |
const Currency* OSB_LIB::CurrencyBook::findCurrency | ( | const Currency::Oid & | oid | ) | const |
Find a currency in the currency book.
oid | Currency code of the currency to search. |
const Currency& OSB_LIB::CurrencyBook::getCurrency | ( | const Currency::Oid & | oid | ) | const |
Get a currency from the currency book.
oid | Currency code of the currency to search. |
OsbException | if the currency is not found. |
void OSB_LIB::CurrencyBook::print | ( | std::ostream & | os | ) |
Print the currency book to a given stream.
long OSB_LIB::CurrencyBook::read | ( | const OSB_DB::Session & | session | ) |
Read in currency list from database.
session | Database session. |
void OSB_LIB::CurrencyBook::setBaseCurrency | ( | const Currency::Oid & | newBase | ) |
Set a new base currency.
SizeType OSB_LIB::CurrencyBook::size | ( | ) | const [inline] |
void OSB_LIB::CurrencyBook::swap | ( | CurrencyBook & | ) |
Swap currency books.