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

RWExchangeRateTable

Module:  Currency   Group:  Conversion


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include<rw/currency/exchgratetbl.h>
ifstream strm(" exchange_rates.txt");
RWExchangeRateTable rates;
rates.initialize();

Description

Class RWExchangeRateTable stores exchange rates as unique pairs of source and target currencies. No two exchange rates in the table have the same source-target currency pair.

The RWExchangeRateTable class can be initialized from a stream, in particular, from an std::ifstream (file). The format for the stream is:

Public Static Data Members

The following values are used for the names in the name/value pairs described in the RWExchangeRateTable::intialize() member function.

const RWCString sourceTag;
const RWCString targetTag;
const RWCstring conversionFactorTag;

Public Constructors

RWExchangeRateTable();
RWExchangeRateTable(const RWExchangeRateTable& t);

Public Member Operators

RWExchangeRateTable& 
operator=(const RWExchangeRateTable& rhs);

Public Member Functions

bool 
add(const RWExchangeRate& exchangeRate);
bool
add(const RWCString& source, const RWCString& target,
    double convFactor);
void
clear();
bool 
contains(const RWExchangeRate& rate);
bool 
contains(const RWCString& sourceMnemonic, 
         const RWCString& targetMnemonic);
size_t
entries() const;
bool 
findConversionFactor(const RWCString& sourceMnemonic, 
            RWCString targetMnemonic, double& factor);
bool 
findExchangeRate(const RWCString& sourceMnemonic, 
                 RWCString targetMnemonic,
                 RWExchangeRate& rate);
RWTValSlist<RWExchangeRate>
getAllExchangeRates()const;
bool
initialize(istream& strm);
bool 
remove(const RWExchangeRate& exchangeRate);
bool 
remove(const RWCString& sourceMnemonic, 
       const RWCString targetMnemonic);
void 
restoreFrom(RWFile&);
void 
restoreFrom(RWvistream&);
void 
saveOn(RWvostream&) const;
void 
saveOn(RWFile&) const;
bool 
setConversionFactor(const RWCString& source,
                    const RWCString& target, 
                    double convFactor);

Related Global Operators

RWvostream& 
operator<<(RWvostream& strm, const RWExchangeRateTable& r);
RWFile& 
operator<<(RWFile& file, const RWExchangeRateTable& r);
RWvistream& 
operator>>(RWvistream& strm, const RWExchangeRateTable& r);
RWFile& 
operator>>(RWFile& strm, const RWExchangeRateTable& r);
ostream& rwdcmlexport
operator<<(ostream& strm, const RWExchangeRateTable& t);
istream& rwdcmlexport
operator>>(istream& strm, RWExchangeRateTable& t);


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.