Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWExchange<T>



Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/money/currexchange.h>
#include <rw/money/divexchange.h>
#include <rw/money/decimal.h>
#include <rw/money/mp2int.h>

typedef RWDecimal<RWMP2Int> Decimal;
RWDivisionGroup<Decimal>* impl = 
  new RWDivisionGroup<Decimal>("LBP","CAD",971.8);
RWExchange<Decimal> divExchange(impl);

Related Java Class

com.roguewave.money.currency.v1_0.Exchange

Description

Currency exchange objects are responsible for converting money of one currency into money of another currency. They encapsulate the source and target currency mnemonics, an exchange algorithm and any required exchange rates.

RWExchangeImpl is an abstract base class from which all currency implementation classes must derive. Class RWExchange<T> is the handle class, which forwards all conversion requests to its associated implementation class.

Money.h++ provides three types of currency exchange objects. The first type implements a triangular exchange algorithm required for converting between local currencies through an intermediate currency, such as the EMU requires for the Euro transition. The second type of exchange object multiplies the source currency amount by the exchange factor to obtain a target amount. The third type of exchange object divides the source currency amount by the exchange factor to obtain the target currency amount. All of the exchange objects share a common API for performing the actual conversion of money.

Public Constructors

RWExchange();
RWExchange(const RWExchange<T>& e);
RWExchange(RWExchangeImpl<T>* impl);

Public Member Operators

RWExchange<T>& 
operator=(const RWExchange<T>& e);

Public Member Functions

RWMoney<T> 
exchange(const RWMoney<T>& money) const;
RWExchangeImpl<T>* 
impl() const;
RWBoolean
isValid() const;
RWCString
name()const;
void 
setImpl( RWExchangeImpl<T>* impl );
RWCString 
source() const;
RWCString 
target() const;


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.