ExchangeRate Class Reference

#include <ql/exchangerate.hpp>

List of all members.


Detailed Description

exchange rate between two currencies

Tests:
application of direct and derived exchange rate is tested against calculations.


Utility methods

Money exchange (const Money &amount) const
 apply the exchange rate to a cash amount
static ExchangeRate chain (const ExchangeRate &r1, const ExchangeRate &r2)
 chain two exchange rates

Public Types

enum  Type { Direct, Derived }

Public Member Functions

Constructors
 ExchangeRate (const Currency &source, const Currency &target, Decimal rate)
Inspectors
const Currencysource () const
 the source currency.
const Currencytarget () const
 the target currency.
Type type () const
 the type
Decimal rate () const
 the exchange rate (when available)


Member Enumeration Documentation

enum Type

Enumerator:
Direct  given directly by the user
Derived  derived from exchange rates between other currencies


Constructor & Destructor Documentation

ExchangeRate ( const Currency source,
const Currency target,
Decimal  rate 
)

the rate $ r $ is given with the convention that a unit of the source is worth $ r $ units of the target.