SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Converts between local currencies that are part of the European Monetary Union (EMU). More...
#include <rw/currency/triexchange.h>
Public Member Functions | |
RWTriangularExchange () | |
RWTriangularExchange (const RWTriangularExchange< T > &) | |
RWTriangularExchange (const RWCString &source, const RWCString &target, const RWCString &interm, double intermToSource, double intermToTarget) | |
virtual RWExchangeImpl< T > * | clone () const |
virtual RWMoney< T > | exchange (const RWMoney< T > &) const |
virtual RWCString | name () const |
RWCString | intermediate () const |
double | intermediateToSourceFactor () const |
double | intermediateToTargetFactor () const |
void | setIntermediate (const RWCString &i) |
void | setIntermediateToSourceFactor (double f) |
void | setIntermediateToTargetFactor (double f) |
RWTriangularExchange< T > & | operator= (const RWTriangularExchange< T > &t) |
Static Public Attributes | |
static const char * | exchangeMethodName |
RWTriangularExchange<T> derives from the abstract base class RWExchangeImpl<T> and implements the currency conversion method used to convert between local currencies that are part of the European Monetary Union (EMU). This class may be used as an implementation class for the RWExchange<T> class, or by itself.
In the triangular currency exchange method of conversion, the source currency is converted to an intermediate currency, for example, the Euro, and the result is converted to the target currency. In a direct currency exchange, the source currency is converted directly to the target currency.
Classes RWMultiplicationExchange<T> and RWDivisionExchange<T> allow a direct conversion from a source to a target currency.
#include <rw/currency/triexchange.h> RWTriangularExchange<double> t("ESP","PTE","EUR" 167.8,203.4);
RWTriangularExchange< T >::RWTriangularExchange | ( | ) |
Default constructor. The exchange rate is set to zero and source and target mnemonic strings are set to null.
RWTriangularExchange< T >::RWTriangularExchange | ( | const RWTriangularExchange< T > & | ) |
Copy constructor.
RWTriangularExchange< T >::RWTriangularExchange | ( | const RWCString & | source, | |
const RWCString & | target, | |||
const RWCString & | interm, | |||
double | intermToSource, | |||
double | intermToTarget | |||
) |
Constructs a triangular exchange object with source currency mnemonic source, target currency mnemonic target, and intermediate currency mnemonic intermediate. The conversion factor intermToSource is the multiplicative factor for converting amounts in the intermediate currency to amounts in the source currency. The second conversion factor, intermToTarget, is the multiplicative factor for converting amounts in the intermediate currency to amounts in the target currency.
virtual RWExchangeImpl<T>* RWTriangularExchange< T >::clone | ( | ) | const [virtual] |
Returns a copy of self off the heap.
Implements RWExchangeImpl< T >.
virtual RWMoney<T> RWTriangularExchange< 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 >.
RWCString RWTriangularExchange< T >::intermediate | ( | ) | const [inline] |
Returns the intermediate currency's mnemonic.
double RWTriangularExchange< T >::intermediateToSourceFactor | ( | ) | const [inline] |
Returns the multiplicative conversion factor used to convert the intermediate currency to the source currency.
double RWTriangularExchange< T >::intermediateToTargetFactor | ( | ) | const [inline] |
Returns the multiplicative conversion factor used to convert the intermediate currency to the target currency.
virtual RWCString RWTriangularExchange< 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 >.
RWTriangularExchange<T>& RWTriangularExchange< T >::operator= | ( | const RWTriangularExchange< T > & | t | ) |
Assignment operator. Copies contents of t to self.
void RWTriangularExchange< T >::setIntermediate | ( | const RWCString & | i | ) | [inline] |
Sets the intermediate currency using the given currency mnemonic.
void RWTriangularExchange< T >::setIntermediateToSourceFactor | ( | double | f | ) | [inline] |
Sets the multiplicative conversion factor used to convert the intermediate currency to the source currency.
void RWTriangularExchange< T >::setIntermediateToTargetFactor | ( | double | f | ) | [inline] |
Sets the multiplicative conversion factor used to convert the intermediate currency to the target currency.
const char* RWTriangularExchange< T >::exchangeMethodName [static] |
This data member is the name returned by the name() function.
© 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.