rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWDivisionExchange< T > Class Template Reference
[Currency Conversions]

Concrete currency exchange implementation class that converts a source currency to a target currency by dividing the amount of the source currency by the associated conversion factor. More...

#include <rw/currency/divexchange.h>

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

List of all members.

Public Member Functions

 RWDivisionExchange ()
 RWDivisionExchange (const RWDivisionExchange< T > &)
 RWDivisionExchange (const RWCString &source, const RWCString &target, double convFactor)
 RWDivisionExchange (const RWExchangeRate &r)
virtual RWExchangeImpl< T > * clone () const
virtual RWMoney< T > exchange (const RWMoney< T > &) const
virtual RWCString name () const
RWDivisionExchange< T > & operator= (const RWDivisionExchange< T > &)

Static Public Attributes

static const char * exchangeMethodName

Detailed Description

template<class T>
class RWDivisionExchange< T >

RWDivisionExchange<T> derives from the abstract base class RWBilateralExchange<T>. An RWDivisionExchange<T> object converts a source currency to a target currency by dividing the amount of the source currency by the associated conversion factor to obtain the target currency. This contrasts with RWMultiplicationExchange<T>, which multiplies its source currency by the conversion factor to obtain the target amount.

Synopsis

 #include<rw/currency/divexchange.h>
 RWDivisionExchange<double> e("CAD","XEC", 0.57241)

Constructor & Destructor Documentation

template<class T >
RWDivisionExchange< T >::RWDivisionExchange (  ) 

Default constructor. Sets source and target strings to null and the conversion factor to zero.

template<class T >
RWDivisionExchange< T >::RWDivisionExchange ( const RWDivisionExchange< T > &   ) 

Copy constructor.

template<class T >
RWDivisionExchange< T >::RWDivisionExchange ( 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.

template<class T >
RWDivisionExchange< T >::RWDivisionExchange ( const RWExchangeRate r  ) 

Constructs an exchange object with source, target, and conversion factor provided in the RWExchangeRate object r.


Member Function Documentation

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

Returns a copy of self off the heap.

Implements RWExchangeImpl< T >.

template<class T >
virtual RWMoney<T> RWDivisionExchange< T >::exchange ( const RWMoney< T > &   )  const [virtual]

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

template<class T >
virtual RWCString RWDivisionExchange< T >::name (  )  const [inline, virtual]

Returns the value of the static data member exchangeMethodName.

Implements RWExchangeImpl< T >.

template<class T >
RWDivisionExchange<T>& RWDivisionExchange< T >::operator= ( const RWDivisionExchange< T > &   ) 

Assignment operator.


Member Data Documentation

template<class T >
const char* RWDivisionExchange< T >::exchangeMethodName [static]

This data member is the name returned by the name() function. It contains the name associated with this exchange class.

 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.