00001 #if !defined(__ABSTRACTBANKACCOUNT_HPP) 00002 #define __ABSTRACTBANKACCOUNT_HPP 00003 00004 /* 00005 CoreLinux++ 00006 Copyright (C) 2000 CoreLinux Consortium 00007 00008 The CoreLinux++ Library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Library General Public License as 00010 published by the Free Software Foundation; either version 2 of the 00011 License, or (at your option) any later version. 00012 00013 The CoreLinux++ Library Library is distributed in the hope that it will 00014 be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Library General Public License for more details. 00017 00018 You should have received a copy of the GNU Library General Public 00019 License along with the GNU C Library; see the file COPYING.LIB. If not, 00020 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00021 Boston, MA 02111-1307, USA. 00022 */ 00023 00024 00025 DECLARE_TYPE( CORELINUX(Real), Amount ); 00026 DECLARE_TYPE( CORELINUX(Exception), InvalidAmountException ); 00027 DECLARE_TYPE( CORELINUX(Exception), InsufficientFundsException ); 00028 00029 DECLARE_CLASS( AbstractBankAccount ); 00030 00038 class AbstractBankAccount 00039 { 00040 public: 00041 00042 // 00043 // Constructors and destructor 00044 // 00045 00047 00048 AbstractBankAccount( void ) 00049 { 00050 ; // do nothing 00051 } 00052 00054 00055 AbstractBankAccount( AbstractBankAccountCref aRef ) 00056 { 00057 ; // do nothing 00058 } 00059 00061 00062 virtual ~AbstractBankAccount( void ) 00063 { 00064 ; // do nothing 00065 } 00066 00067 // 00068 // Operator overloads 00069 // 00070 00077 AbstractBankAccountRef operator=( AbstractBankAccountCref aRef ) 00078 { 00079 return ( *this ); 00080 } 00081 00088 bool operator==( AbstractBankAccountCref aRef ) const 00089 { 00090 return ( this == &aRef ); 00091 } 00092 00093 // 00094 // Accessors 00095 // 00101 virtual AmountCref getBalance( void ) const = 0; 00102 00103 // 00104 // Mutators 00105 // 00114 virtual void withdrawFunds( Amount ) 00115 throw(InsufficientFundsException) = 0; 00116 00117 00123 virtual void depositFunds( Amount ) 00124 throw(InsufficientFundsException) = 0; 00125 00126 00127 00128 }; 00129 00130 #endif // if !defined(__ABSTRACTBANKACCOUNT_HPP) 00131 00132 /* 00133 Common rcs information do not modify 00134 $Author: frankc $ 00135 $Revision: 1.2 $ 00136 $Date: 2000/02/10 14:32:20 $ 00137 $Locker: $ 00138 */ 00139 00140