Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Examples

AccountProxy Class Reference

AccountProxy is a read/write access proxy that enables all of the methods for the underlying subject. More...

#include <AccountProxy.hpp>

Inheritance diagram for AccountProxy:

AbstractBankAccount corelinux::Proxy< AbstractBankAccount > RestrictedAccountProxy List of all members.

Public Member Functions

 AccountProxy (void)
 Default constructor.

 AccountProxy (AbstractBankAccountPtr)
 Initializing constructor.

 AccountProxy (AccountProxyCref)
 Copy constructor.

virtual ~AccountProxy (void)
 Virtual Destructor.

AccountProxyRef operator= (AccountProxyCref)
 Assignment operator.

bool operator== (AccountProxyCref) const
 Equality operator compares the subject pointers.

virtual AmountCref getBalance (void) const
 Retrieve the account balance.

virtual void withdrawFunds (Amount) throw (InsufficientFundsException)
 Withdraw an amount of funds from the account.

virtual void depositFunds (Amount) throw (InsufficientFundsException)
 Deposit funds into the account.


Detailed Description

AccountProxy is a read/write access proxy that enables all of the methods for the underlying subject.

It is derived from AbstractBankAccount as well so that the proxy can be used as a Account in the application.

Another option would have been to "realize" the interface only, somewhat like a bridge, but this would have meant the application is aware of the Proxy type.


Member Function Documentation

void AccountProxy::depositFunds Amount   )  throw (InsufficientFundsException) [virtual]
 

Deposit funds into the account.

Parameters:
Amount - to deposit

Implements AbstractBankAccount.

AmountCref AccountProxy::getBalance void   )  const [virtual]
 

Retrieve the account balance.

Returns:
Amount const reference to balance

Implements AbstractBankAccount.

AccountProxyRef AccountProxy::operator= AccountProxyCref   ) 
 

Assignment operator.

Parameters:
AccountProxy const reference
Returns:
AccountProxy reference

bool AccountProxy::operator== AccountProxyCref   )  const
 

Equality operator compares the subject pointers.

Parameters:
AccountProxy const reference
Returns:
bool if subjects match

void AccountProxy::withdrawFunds Amount   )  throw (InsufficientFundsException) [virtual]
 

Withdraw an amount of funds from the account.

Parameters:
Amount - amount to withdraw
Exceptions:
InsufficientFundsException if the amount requested to withdraw is not available in the account funds

Implements AbstractBankAccount.

Reimplemented in RestrictedAccountProxy.


The documentation for this class was generated from the following files:
This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium