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

RWExchangeFactory<T>

Module:  Currency   Group:  Conversion


Does not inherit

Local Index

Members

Synopsis

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

Description

Currency Module 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();
RWExchangeFactory(const RWExchangeFactory<T>& f);
RWExchangeFactory(const RWExchangeRateTable& t);

Public Member Operators

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

Public Member Functions

void 
appendExchangeGroup(const RWExchangeGroup<T>& a);
void
clearExchangeGroups();
bool
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();
bool
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);
bool
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 DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.