Class USDollarBaseGroup
Class USDollarBaseGroup inherits from RWExchangeGroupImpl<T>, and implements a currency exchange group that produces USDollarBaseExchange objects, which convert a source currency to a US Dollar base, then convert the US Dollar base to a target currency. Here is the code that declares the class:
 
template< class T >
class USDollarBaseGroup : public RWExchangeGroupImpl<T>
{
public:
USDollarBaseGroup() {;}
 
// Inherited from RWExchangeGroup
virtual RWExchange<T> getExchange( const RWCString& srcMnemonic,
const RWCString& targetMnemonic,
const RWExchangeRateTable& rates ) const;
virtual RWCString name() const { return "USDollarBaseGroup"; }
 
virtual RWExchangeGroupImpl<T>* clone() const
{ return (RWExchangeGroupImpl<T>*)new
USDollarBaseGroup<T>(*this);}
};
First, this class declares the default constructor. Then it adds definitions for the following inherited virtual functions:
*getExchange() -- Creates and returns the currency exchange object.
*name() -- Returns the name associated with the group, in this case USDollarBaseGroup.
*clone() -- Returns a copy of self allocated off the heap.