template<class T>
class RWExchangeGroup< T >
A currency exchange group is a collection of currencies that have a common distinguishing characteristic related to converting money from one currency to money of another currency. For example, the Euro Currency Exchange Group consists of all the currencies that will eventually be replaced by the Euro. All currencies in the Euro Currency Exchange Group use the same, special rule for converting money between currencies in this group.
The exchange group classes are implemented using a handle/body or bridge design pattern. The handle class is RWExchangeGroup. This class contains a pointer to implementation class RWExchangeGroupImpl. RWExchangeGroupImpl is an abstract base class from which all currency group implementations must derive. The purpose of an exchange group object is to take as input a source currency, target currency, and an exchange rate table, then produce an exchange object. Thus a key component of the class RWExchangeGroupImpl is a pure virtual method:
Offers powerful and convenient facilities for manipulating strings.
Definition stdcstring.h:826
virtual RWExchange< T > getExchange(const RWCString &srcMnemonic, const RWCString &tragetMnemonic, const RWExchangeRateTable &rates) const =0
Stores exchange rates as unique pairs of source and target currencies.
Definition exchgratetbl.h:110
Handle class for the abstract body class RWExchangeImpl from which all concrete currency converters d...
Definition currexchange.h:69
Currency Module includes three currency exchange group implementation classes:
- Synopsis
#include <rw/currency/exchggroup.h>