rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWExchangeImpl< T > Class Template Reference
[Currency Conversions]

The abstract base class from which all currency implementation classes must derive. More...

#include <rw/currency/exchgimpl.h>

Inheritance diagram for RWExchangeImpl< T >:
RWBilateralExchange< T > RWTriangularExchange< T > RWDivisionExchange< T > RWMultiplicationExchange< T >

List of all members.

Public Member Functions

virtual RWExchangeImpl< T > * clone () const =0
virtual RWMoney< T > exchange (const RWMoney< T > &money) const =0
virtual RWCString name () const =0
RWCString source () const
RWCString target () const
void setSource (const RWCString &src)
void setTarget (const RWCString &trg)

Detailed Description

template<class T>
class RWExchangeImpl< T >

RWExchangeImpl is an abstract base class from which all currency implementation classes must derive. Class RWExchange<T> is the handle class, which forwards all conversion requests to its associated implementation class.

Synopsis

 #include <rw/currency/exchgimpl.h>

Member Function Documentation

template<class T >
virtual RWExchangeImpl<T>* RWExchangeImpl< T >::clone (  )  const [pure virtual]

Returns a copy of self off the heap.

Implemented in RWDivisionExchange< T >, RWMultiplicationExchange< T >, and RWTriangularExchange< T >.

template<class T >
virtual RWMoney<T> RWExchangeImpl< T >::exchange ( const RWMoney< T > &  money  )  const [pure 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.

Implemented in RWDivisionExchange< T >, RWMultiplicationExchange< T >, and RWTriangularExchange< T >.

template<class T >
virtual RWCString RWExchangeImpl< T >::name (  )  const [pure 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.

Implemented in RWDivisionExchange< T >, RWMultiplicationExchange< T >, and RWTriangularExchange< T >.

template<class T >
void RWExchangeImpl< T >::setSource ( const RWCString src  )  [inline]

Sets the mnemonic for the source currency.

template<class T >
void RWExchangeImpl< T >::setTarget ( const RWCString trg  )  [inline]

Sets the mnemonic for the target currency.

template<class T >
RWCString RWExchangeImpl< T >::source (  )  const [inline]

Returns the mnemonic for the source currency.

template<class T >
RWCString RWExchangeImpl< T >::target (  )  const [inline]

Returns the mnemonic for the target currency.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.