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

RWExchangeRate

Module:  Currency   Group:  Conversion


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rw/currency/exchgrate.h>
RWExchangeRate r("USD", "INR",42.254);

Description

Class RWExchangeRate encapsulates a source currency, a target currency, and a conversion factor, which is, by convention, a multiplicative conversion factor. This means that the source currency amount is multiplied by the conversion factor to obtain the equivalent amount in the target currency. Source and target currencies are stored by their mnemonics and the conversion factor is stored as a double precision floating point number.

Public Constructors

RWExchangeRate();
RWExchangeRate(const RWCString& sourceMnemonic,
               const RWCString& targetMnemonic, double f);
RWExchangeRate(const RWEXchangeRate& r);

Public Member Operators

RWExchangeRate& 
operator=(const RWExchangeRate& r);

Public Member Functions

double 
conversionFactor() const;
void 
restoreFrom(RWFile&);
void 
restoreFrom(RWvistream&);
void 
saveOn(RWFile&) const;
void 
saveOn(RWvostream&) const;
void 
setConversionFactor(double factor);
void 
setSource(const RWCString& mnemonic);
void 
setTarget(const RWCString& mnemonic);
RWCString 
source() const;
RWCString 
target() const;

Related Global Operators

bool 
operator==(const RWExchangeRate& lhs, 
           const RWEXchangeRate& rhs);
RWvostream& 
operator<<(RWvostream& strm, const RWExchangeRate& r);
RWFile& 
operator<<(RWFile& file, const RWExchangeRate& r);
RWvistream& 
operator>>(RWvistream& strm, const RWExchangeRate& r);
RWFile& 
operator>>(RWFile& strm, const RWExchangeRate& r);


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.