SourcePro® 2022.1 |
SourcePro® API Reference Guide |
The handle for the implementation class RWExchangeGroupImpl, the abstract base class for all currency exchange group implementations. A currency exchange group is a collection of currencies that use the same currency-conversion rules. More...
#include <rw/currency/exchggroup.h>
Public Member Functions | |
RWExchangeGroup () | |
RWExchangeGroup (const RWExchangeGroup< T > &eg) | |
RWExchangeGroup (RWExchangeGroupImpl< T > *imp) | |
RWExchange< T > | getExchange (const RWCString &srcMnemonic, const RWCString &targetMnemonic, const RWExchangeRateTable &rates) const |
RWExchangeGroupImpl< T > * | impl () const |
RWCString | name () const |
RWExchangeGroup< T > & | operator= (const RWExchangeGroup< T > &eg) |
void | setImpl (RWExchangeGroupImpl< T > *i) |
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:
Currency Module includes three currency exchange group implementation classes:
|
inline |
Default constructor.
|
inline |
Makes a (deep) copy of the implementation for currency exchange group object eg.
|
inline |
Constructs an exchange group object with the provided implementation imp. The object's destructor will delete imp.
|
inline |
Creates and returns a currency exchange object for converting money in the source currency to money in the target currency using the exchange rates table rates. If the parameters are not valid, an invalid exchange object is returned.
|
inline |
Returns a pointer to the implementation class.
|
inline |
Returns a name to be associated with the group.
|
inline |
Deletes self's current implementation and clones a copy of the implementation for eg.
|
inline |
Sets self to the RWExchangeGroupImpl object pointed to by i.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |