SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWDivisionGroup< T > Class Template Reference

A collection of currency objects that convert a source currency to a target currency by dividing the amount of the source currency by a conversion factor. More...

#include <rw/currency/divexchggrp.h>

Inheritance diagram for RWDivisionGroup< T >:
RWExchangeGroupImpl< T >

Public Member Functions

 RWDivisionGroup ()
 
virtual RWExchangeGroupImpl< T > * clone () const
 
virtual RWExchange< T > getExchange (const RWCString &srcMnemonic, const RWCString &targetMnemonic, const RWExchangeRateTable &rates) const
 
virtual RWCString name () const
 
- Public Member Functions inherited from RWExchangeGroupImpl< T >
 RWExchangeGroupImpl ()
 

Static Public Member Functions

static RWExchangeGroup< T > create ()
 

Static Public Attributes

static const char * groupName
 

Detailed Description

template<class T>
class RWDivisionGroup< T >

Currency exchange groups are collections of currencies that have a common distinguishing characteristic for converting money from one currency to money of another currency. RWDivisionGroup is made up of objects that convert a source currency to a target currency by dividing the amount of the source currency by a conversion factor.

Note
Currencies that use the triangular conversion method required by the European Monetary Union are available in class RWEuroGroup. Currencies that convert a source currency to a target currency by multiplying the amount of the source by a conversion factor are available in RWMultiplicationGroup.

The division exchange group overrides the base class method:

const RWCString& source, const RWCString& target,
const RWExchangeRateTable& rates);
Offers powerful and convenient facilities for manipulating strings.
Definition stdcstring.h:826
virtual RWExchange< T > getExchange(const RWCString &srcMnemonic, const RWCString &tragetMnemonic, const RWExchangeRateTable &rates) const =0
Stores exchange rates as unique pairs of source and target currencies.
Definition exchgratetbl.h:110
Handle class for the abstract body class RWExchangeImpl from which all concrete currency converters d...
Definition currexchange.h:69

so that it looks in exchange rate table rates for an exchange rate that converts the target currency to the source currency. If it finds one, it creates and returns an RWExchange object with an RWDivisionExchange implementation. If it does not find one, it returns an invalid RWExchange object.

Synopsis
#include <rw/currency/divexchggrp.h>
RWDivisionGroup divGroup;
A collection of currency objects that convert a source currency to a target currency by dividing the ...
Definition divexchggrp.h:69

Constructor & Destructor Documentation

◆ RWDivisionGroup()

template<class T >
RWDivisionGroup< T >::RWDivisionGroup ( )
inline

Default constructor. Constructs an empty group.

Member Function Documentation

◆ clone()

template<class T >
virtual RWExchangeGroupImpl< T > * RWDivisionGroup< T >::clone ( ) const
inlinevirtual

Returns a copy of self allocated off the heap.

Implements RWExchangeGroupImpl< T >.

◆ create()

template<class T >
static RWExchangeGroup< T > RWDivisionGroup< T >::create ( )
static

Creates an RWExchangeGroup object with an RWDivisionGroup implementation.

◆ getExchange()

template<class T >
virtual RWExchange< T > RWDivisionGroup< T >::getExchange ( const RWCString & srcMnemonic,
const RWCString & tragetMnemonic,
const RWExchangeRateTable & rates ) const
virtual

Creates and returns a currency exchange object for converting money in the source currency to money in the target currency using the exchange rates table rates. If the parameters are invalid, the Rogue Wave classes that derive from this class return an invalid exchange object.

Implements RWExchangeGroupImpl< T >.

◆ name()

template<class T >
virtual RWCString RWDivisionGroup< T >::name ( ) const
inlinevirtual

Returns a name to be associated with the group.

Implements RWExchangeGroupImpl< T >.

Member Data Documentation

◆ groupName

template<class T >
const char* RWDivisionGroup< T >::groupName
static

Name associated with the group. Returned by the name() member function.

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