SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
A collection of all currencies replaced by the Euro, in which each object implements the RWTriangularExchange<T> conversion type. More...
#include <rw/currency/euroexchggrp.h>
Public Member Functions | |
RWEuroGroup (const char *euro_mnemonic="EUR") | |
RWEuroGroup (const RWEuroGroup< T > &) | |
RWEuroGroup (const RWTValSlist< RWCString > &euroCurrencies, const char *euroMnemonic="EUR") | |
virtual RWExchange< T > | getExchange (const RWCString &srcMnemonic, const RWCString &tragetMnemonic, const RWExchangeRateTable &rates) const |
virtual RWCString | name () const |
virtual RWExchangeGroupImpl< T > * | clone () const |
bool | containsCurrency (const RWCString &) const |
RWTValSlist< RWCString > | getCurrencies () const |
size_t | numCurrencies () const |
bool | addCurrency (const RWCString &) |
bool | removeCurrency (const RWCString &) |
void | setCurrencies (const RWTValSlist< RWCString > &list) |
void | clear () |
RWCString | euroMnemonic () const |
void | setEuroMnemonic (const RWCString &em) |
RWEuroGroup< T > & | operator= (const RWEuroGroup< T > &) |
Static Public Member Functions | |
static RWExchangeGroup< T > | create () |
static RWExchangeGroup< T > | create (std::istream &strm, const char *euroMnem="EUR") |
static RWExchangeGroup< T > | create (const RWTValSlist< RWCString > ¤cyList, const char *euroMnem="EUR") |
Static Public Attributes | |
static const char * | groupName |
Related Functions | |
(Note that these are not member functions.) | |
template<class T > | |
std::ostream & | operator<< (std::ostream &strm, const RWEuroGroup< T > &grp) |
template<class T > | |
std::istream & | operator>> (std::istream &strm, RWEuroGroup< T > &grp) |
Currency exchange groups are collections of currencies that have a common distinguishing characteristic when it comes to converting money from one currency to money of another currency. RWEuroGroup<T> is a currency exchange group class that consists of all currencies replaced by the Euro. RWEuroGroup<T> objects create and return RWExchange<T> objects with the RWTriangularExchange<T> implementation.
#include <rw/currency/euroexchggrp.h> #include <rw/tvslist.h> RWTValSlist<RWCString> euroCurrencies; RWEuroGroup<double> euroGroup(euroCurrencies);
RWEuroGroup< T >::RWEuroGroup | ( | const char * | euro_mnemonic = "EUR" |
) | [inline] |
Default constructor. Constructs an empty group. The default value of euro_mnemonic identifies the Euro currency and is used to look up rates in the exchange rate table, information in the currency book, and so forth.
RWEuroGroup< T >::RWEuroGroup | ( | const RWEuroGroup< T > & | ) |
Copy constructor.
RWEuroGroup< T >::RWEuroGroup | ( | const RWTValSlist< RWCString > & | euroCurrencies, | |
const char * | euroMnemonic = "EUR" | |||
) |
Constructs a Euro exchange group containing the currencies whose mnemonics are contained in euroCurrencies. The default value of euroMnemonic identifies the Euro currency and is used to look up rates in the exchange rate table, information in the currency book, and so forth.
bool RWEuroGroup< T >::addCurrency | ( | const RWCString & | ) |
Adds the currency mnemonic to the Euro exchange group. Returns false
if the currency was already in the group and true
otherwise.
void RWEuroGroup< T >::clear | ( | ) |
Removes all Euro currencies from the group.
virtual RWExchangeGroupImpl<T>* RWEuroGroup< T >::clone | ( | ) | const [inline, virtual] |
Returns a copy of self allocated off the heap.
Implements RWExchangeGroupImpl< T >.
bool RWEuroGroup< T >::containsCurrency | ( | const RWCString & | ) | const |
Returns true
if the given currency is in the Euro exchange group. Note that the Euro is not in the Euro exchange group since you do not use the triangulation algorithm when converting from or to Euros.
static RWExchangeGroup<T> RWEuroGroup< T >::create | ( | const RWTValSlist< RWCString > & | currencyList, | |
const char * | euroMnem = "EUR" | |||
) | [static] |
Creates and returns an RWExchangeGroup<T> object with an RWEuroGroup implementation. This implementation uses the currencies in currencyList to define the currencies in the Euro group.
static RWExchangeGroup<T> RWEuroGroup< T >::create | ( | std::istream & | strm, | |
const char * | euroMnem = "EUR" | |||
) | [static] |
Creates and returns an RWExchangeGroup<T> object with a RWEuroGroup<T> implementation. This implementation uses strm to define the currencies in the Euro group. The stream format must have one currency mnemonic per line, as in the following example:
ATS BEF FIM FRF DEM IEP ITL LUF NLG ESP PTE
static RWExchangeGroup<T> RWEuroGroup< T >::create | ( | ) | [static] |
Creates and returns an RWExchangeGroup<T> object with a RWEuroGroup<T> implementation. The list of Euro currencies contained in the implementation is empty.
RWCString RWEuroGroup< T >::euroMnemonic | ( | ) | const [inline] |
Returns the RWCString for the Euro currency mnemonic.
RWTValSlist<RWCString> RWEuroGroup< T >::getCurrencies | ( | ) | const |
Returns a list of currency mnemonics that are in the Euro group.
virtual RWExchange<T> RWEuroGroup< 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 >.
virtual RWCString RWEuroGroup< T >::name | ( | ) | const [inline, virtual] |
Returns a name to be associated with the group.
Implements RWExchangeGroupImpl< T >.
size_t RWEuroGroup< T >::numCurrencies | ( | ) | const |
Returns the number of currencies in the Euro group.
RWEuroGroup<T>& RWEuroGroup< T >::operator= | ( | const RWEuroGroup< T > & | ) |
Assignment operator.
bool RWEuroGroup< T >::removeCurrency | ( | const RWCString & | ) |
Removes the given currency from the Euro group. Returns false
if the currency was not found in the group, and true
otherwise.
void RWEuroGroup< T >::setCurrencies | ( | const RWTValSlist< RWCString > & | list | ) |
Replaces the list of Euro currencies with list.
void RWEuroGroup< T >::setEuroMnemonic | ( | const RWCString & | em | ) | [inline] |
Sets the Euro currency mnemonic for this object.
std::ostream & operator<< | ( | std::ostream & | strm, | |
const RWEuroGroup< T > & | grp | |||
) | [related] |
Writes grp to a stream. The stream has the format described in the RWEuroGroup::create(std::istream&, const char*) method.
std::istream & operator>> | ( | std::istream & | strm, | |
RWEuroGroup< T > & | grp | |||
) | [related] |
Reads grp from a stream. The stream has the format described in the RWEuroGroup::create(std::istream&, const char*) method.
const char* RWEuroGroup< T >::groupName [static] |
Name that identifies the Euro exchange group. Returned by the name() method.
© 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.