Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWExchangeFactory<T>



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

Synopsis

#include <rw/money/exchgfact.h>
#include <rw/money/exchgratetbl.h>
RWExchangeRateTable rates;
RWExchangeFactory<double> factory(rates);

Related Java Class

com.roguewave.money.currency.v1_0.ExchangeFactory

Description

Money.h++ provides a factory class, RWExchangeFactory<T> that creates currency exchange objects. The currency exchange factory is essentially a list of RWExchangeGroups. When the factory receives a request for a currency exchange object, it finds the first currency exchange group that can create an RWExchange<T> object and returns the object it found. By default, upon construction, the RWExchangeFactory<T> class always contains one currency exchange group: RWMultiplicationGroup<T>.

The RWMultiplicationGroup<T> group is the default exchange group, and, initially, is always available in the factory's list of currency groups. When presented with a source/target currency pair and exchange rate table, the default exchange group looks for an exchange rate in the table for the pair and, if found, constructs an RWExchange<T> exchange rate object, with an RWMultiplicationExchange<T> implementation.

Public Constructors

RWExchangeFactory<T>();
RWExchangeFactory<T>(const RWExchangeFactory<T>& f);
RWExchangeFactory<T>(const RWExchangeRateTable& t);

Public Member Operators

RWExchangeFactory<T>& 
operator=(const RWExchangeFactory<T>&);

Public Member Functions

void 
appendExchangeGroup(const RWExchangeGroup<T>& a);
void
clearExchangeGroups();
RWBoolean
containsExchangeGroup(const RWCString& groupName) const;
RWExchangGroup<T>
exchangeGroupAt(size_t i) const;
size_t
exchangeGroupIndex(const RWCString& groupName)const;
RWTValSlist< RWExchangeGroup<T> >
exchangeGroups() const;
RWExchangeRateTable 
exchangeRateTable() const;
RWExchangeRateTable& 
exchangeRateTable();
RWBoolean
findExchangeGroup(const RWCString& name, 
                  RWExchangeGroup<T> grp) const;
RWExchangeGroup<T>
firstExchangeGroup() const;
RWExchange<T>
getExchange(const RWCString& sourceMnemonic,
            const RWCString& targetMnemonic) const;
void
insertExchangeGroupAt(size_t i,const RWExchangeGroup<T>& a);
RWExchangeGroup<T>
lastExchangeGroup() const;
size_t
numberOfExchangeGroups() const;
void
prependExchangeGroup(const RWExchangeGroup<T>& a);
RWBoolean
removeExchangeGroup(const RWCString& groupName);
RWExchangeGroup<T>
removeExchangeGroupAt(size_t i);
RWExchangeGroup<T>
removeFirstExchangeGroup();
RWExchangeGroup<T>
removeLastExchangeGroup();
void
setExchangeRateTable( const RWExchangeRateTable& t );
void
setExchangeGroups(const RWTValSlist< RWExchangeGroup<T> >& l);


Previous fileTop of DocumentContentsIndexNext file

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