Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Currency Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

5.3 Currency Exchange Classes

The Currency Module provides three different conversion methods:

The class RWExchange contains a pointer to implementation class of type RWExchangeImpl, and defers to that implementation when actually performing a currency conversion. The Currency Module provides three currency exchange classes, corresponding to the conversion methods listed above, that derived from the abstract base class RWExchangeImpl. The three exchange classes are implementation classes of class RWExchange, which presents a generic interface for performing currency exchanges.

The different implementations share an interface, but work differently from one another. For example, an RWExchange object that contains an RWMultiplicationExchange implementation performs a currency exchange by invoking an implementation multiplies the amount in the source currency by a conversion factor to get the amount in the target currency.

Contrast this with an RWExchange object that contains an RWTriangularExchange implementation. RWTriangularExchange invokes an implementation that converts the source currency to a base currency, then converts the base currency to the target. First, the RWTriangularExchange implementation converts the source to the base by dividing the source by a base-to-source conversion factor. Then it multiplies the result by a base-to-target conversion factor to obtain the target. This is the algorithm mandated by the European Monetary Union (EMU) for converting between local EMU currencies during the Euro transition period.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.