OSB_LIB::CurrencyBook Class Reference

Collaboration diagram for OSB_LIB::CurrencyBook:

Collaboration graph
[legend]
List of all members.

Detailed Description

A set of ISO-defined or user-defined currencies.

Manages a list of currencies and contains a base currency used in the base conversion method.

Definition at line 126 of file money.h.

Public Types

STL container type definitions.

Public Member Functions

Pure wrappers to the STL container.
Remarks:
Do not add an STL operation to this group if the function does more than just wrapping!
All functions return the STL operation on list_.

Private Attributes


Member Typedef Documentation

typedef CurrencyList::const_iterator OSB_LIB::CurrencyBook::ConstIterator

STL const_iterator.

Definition at line 144 of file money.h.

typedef std::map<Currency::Oid, Currency> OSB_LIB::CurrencyBook::CurrencyList

STL container to store the currencies.

The currencies are sorted by their object id, i.e., the ISO 4217 code.

Definition at line 134 of file money.h.

typedef CurrencyList::iterator OSB_LIB::CurrencyBook::Iterator

STL iterator.

Definition at line 142 of file money.h.

typedef CurrencyList::size_type OSB_LIB::CurrencyBook::SizeType

STL container size_type.

Definition at line 146 of file money.h.


Constructor & Destructor Documentation

OSB_LIB::CurrencyBook::CurrencyBook (  )  [inline]

Default constructor.

Definition at line 137 of file money.h.


Member Function Documentation

void OSB_LIB::CurrencyBook::add ( const Currency currency,
bool  isBase = false 
)

Add a currency to the currency book.

Parameters:
currency The currency to add.
isBase Pass true if the currency should be set as base currency.
Exceptions:
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]

Iterator to the end of the list.

Definition at line 160 of file money.h.

References currencyList_.

const Currency* OSB_LIB::CurrencyBook::findCurrency ( const Currency::Oid oid  )  const

Find a currency in the currency book.

Parameters:
oid Currency code of the currency to search.
Returns:
Pointer to the currency for oid, 0 if not found.

const Currency& OSB_LIB::CurrencyBook::getCurrency ( const Currency::Oid oid  )  const

Get a currency from the currency book.

Parameters:
oid Currency code of the currency to search.
Returns:
Currency for oid.
Exceptions:
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.

Parameters:
session Database session.
Returns:
Number of currencies read.

void OSB_LIB::CurrencyBook::setBaseCurrency ( const Currency::Oid newBase  ) 

Set a new base currency.

SizeType OSB_LIB::CurrencyBook::size (  )  const [inline]

The size of the list.

Definition at line 166 of file money.h.

References currencyList_.

void OSB_LIB::CurrencyBook::swap ( CurrencyBook  ) 

Swap currency books.


Member Data Documentation

Currency::Oid OSB_LIB::CurrencyBook::baseCurrency_ [private]

Code of the base currency.

Definition at line 217 of file money.h.

CurrencyList OSB_LIB::CurrencyBook::currencyList_ [private]

List of currencies.

Definition at line 215 of file money.h.

Referenced by begin(), end(), and size().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:11:31 2006 for OSB Library by  doxygen 1.4.7