OSB_LIB::Money Class Reference

Collaboration diagram for OSB_LIB::Money:

Collaboration graph
[legend]
List of all members.

Detailed Description

An amount of a particular currency.

You can not have too much of it.

Definition at line 227 of file money.h.

Read access to data members

Public Types

Public Member Functions

Arithmetic operations

Static Public Member Functions

Private Attributes

Static Private Attributes

Friends


Member Enumeration Documentation

enum OSB_LIB::Money::ConversionMethod

Available conversion methods.

Arithmetic operations are allowed on monies of same and different currencies. Monies of same currency are operated upon without any check for the conversion method. For monies of different currencies, the conversion method is used to determine how to convert the money.

Reference: OMG Currency Specification (formal/00-06-29)

Enumerator:
noConversion 
baseCurrency 
automatic 

Definition at line 250 of file money.h.


Constructor & Destructor Documentation

OSB_LIB::Money::Money (  )  [inline]

Default constructor.

The default constructor creates a Money object without a currency (ID_NOT_SET) and an amount of 0. When such an object is used in an addition or subtraction with another Money, then it will assume the currency of the other object for the purpose of this operation. Comparison operations are not treated like this, i.e., a default constructed Money cannot be used in any comparison with a Money that has a defined currency.

Definition at line 264 of file money.h.

OSB_LIB::Money::Money ( const Currency::Oid cc,
const Decimal d 
) [inline]

Constructor with currency and amount.

Definition at line 266 of file money.h.


Member Function Documentation

Decimal OSB_LIB::Money::amount (  )  const [inline]

Amount accessor.

Definition at line 277 of file money.h.

References amount_.

static ConversionMethod OSB_LIB::Money::conversionMethod ( ConversionMethod   )  [static]

Set currency conversion method. Returns old method.

static ConversionMethod OSB_LIB::Money::conversionMethod (  )  [inline, static]

Currency comversion method accessor.

Definition at line 280 of file money.h.

References conversionMethod_.

const Currency::Oid& OSB_LIB::Money::currency (  )  const [inline]

Currency code accessor.

Definition at line 274 of file money.h.

References currency_.

Money & OSB_LIB::Money::operator *= ( const Decimal  )  [inline]

Multiplication with a Decimal.

Definition at line 400 of file money.h.

References amount_.

Money & OSB_LIB::Money::operator *= ( double   )  [inline]

Multiplication with a double.

Definition at line 388 of file money.h.

References amount_.

Money& OSB_LIB::Money::operator+= ( const Money  ) 

Addition.

Money& OSB_LIB::Money::operator- (  ) 

Negation.

Money& OSB_LIB::Money::operator-= ( const Money  ) 

Subtraction.

Money & OSB_LIB::Money::operator/= ( const Decimal  )  [inline]

Division by a Decimal.

Definition at line 424 of file money.h.

References amount_.

Money & OSB_LIB::Money::operator/= ( double   )  [inline]

Division by a double.

Definition at line 412 of file money.h.

References amount_.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const Money  
) [friend]

Money output operator.


Member Data Documentation

Decimal OSB_LIB::Money::amount_ [private]

Amount.

Definition at line 309 of file money.h.

Referenced by amount(), operator *=(), and operator/=().

ConversionMethod OSB_LIB::Money::conversionMethod_ [static, private]

Currency conversion method.

Definition at line 311 of file money.h.

Referenced by conversionMethod().

Currency::Oid OSB_LIB::Money::currency_ [private]

Currency code.

Definition at line 307 of file money.h.

Referenced by currency().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:11:32 2006 for OSB Library by  doxygen 1.4.7