SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Converts a source currency to a target currency by multiplying the amount of the source currency by the associated conversion factor. More...
#include <rw/currency/multexchange.h>
Public Member Functions | |
RWMultiplicationExchange () | |
RWMultiplicationExchange (const RWMultiplicationExchange< T > &) | |
RWMultiplicationExchange (const RWCString &source, const RWCString &target, double convFactor) | |
RWMultiplicationExchange (const RWExchangeRate &rate) | |
virtual RWExchangeImpl< T > * | clone () const |
virtual RWMoney< T > | exchange (const RWMoney< T > &) const |
virtual RWCString | name () const |
RWMultiplicationExchange< T > & | operator= (const RWMultiplicationExchange< T > &) |
Static Public Attributes | |
static const char * | exchangeMethodName |
RWMultiplicationExchange<T> derives from the abstract base class RWBilateralExchange<T> . An RWMultiplicationExchange<T> object converts a source currency to a target currency by multiplying the amount of the source currency by the associated conversion factor to obtain the target currency amount. This contrasts with RWDivisionExchange<T> , which divides its source currency amount by the conversion factor to obtain the target amount.
#include <rw/currency/multexchange.h> RWMultiplicationExchange<double> e("CAD","XEC", 1.747);
RWMultiplicationExchange< T >::RWMultiplicationExchange | ( | ) |
Default constructor. Source and target strings are set to null and the conversion factor is set to zero.
RWMultiplicationExchange< T >::RWMultiplicationExchange | ( | const RWMultiplicationExchange< T > & | ) |
Copy constructor.
RWMultiplicationExchange< T >::RWMultiplicationExchange | ( | const RWCString & | source, | |
const RWCString & | target, | |||
double | convFactor | |||
) |
Constructs an exchange object with source currency mnemonic source, target currency mnemonic target, and source to target conversion factor convFactor.
RWMultiplicationExchange< T >::RWMultiplicationExchange | ( | const RWExchangeRate & | rate | ) |
Constructs an exchange object with source, target, and conversion factor provided in the RWExchangeRate object rate.
virtual RWExchangeImpl<T>* RWMultiplicationExchange< T >::clone | ( | ) | const [virtual] |
Returns a copy of self off the heap.
Implements RWExchangeImpl< T >.
virtual RWMoney<T> RWMultiplicationExchange< T >::exchange | ( | const RWMoney< T > & | money | ) | const [virtual] |
Pure virtual function for converting money from the source currency to the target currency. If the currency associated with money does not match the source currency for self, an exception will be thrown.
Implements RWExchangeImpl< T >.
virtual RWCString RWMultiplicationExchange< T >::name | ( | ) | const [inline, virtual] |
Pure virtual function that returns the name of the implementation class. Rogue Wave implementation classes return their static data member exchangeMethodName
. For example, when an RWExchange object contains an RWTriangularExchange<T> implementation, name() returns RWTriangularExchange::exchangeMethodName.
Implements RWExchangeImpl< T >.
RWMultiplicationExchange<T>& RWMultiplicationExchange< T >::operator= | ( | const RWMultiplicationExchange< T > & | ) |
Assignment operator.
const char* RWMultiplicationExchange< T >::exchangeMethodName [static] |
This data member is the name returned by the name() function. It contains the name associated with this exchange class.
© 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.