SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWExchangeImpl< T > Class Template Referenceabstract

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 >

Public Member Functions

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

Detailed Description

template<class T>
class RWExchangeImpl< T >

RWExchangeImpl is an abstract base class from which all currency implementation classes must derive. Class RWExchange 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 RWTriangularExchange< T >, RWDivisionExchange< T >, and RWMultiplicationExchange< 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 >, RWTriangularExchange< T >, and RWMultiplicationExchange< 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 implementation, name() returns RWTriangularExchange::exchangeMethodName.

Implemented in RWDivisionExchange< T >, RWTriangularExchange< T >, and RWMultiplicationExchange< 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.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.