The Bank Side of the Application

 <  Free Open Study  >  

 // Bankmain.cpp: The main driver function for the Bank side of the  // application. This main method builds a network, creates a bank, // initializing its accounts to the data in a user-provided file, // and builds an ATM proxy, which is then activated. The ATM proxy // will listen on the network for a data packet. When it arrives, // this packet is parsed to build an appropriate transaction. The // Bank is then asked to process the transaction, and the results // are shipped back to the sender. In this simulation, the network // is really a user typing in packets with the appropriate format. // The reader can replace these calls to getline with any // appropriate byte-transfer mechanism. #include <iostream.h> #include ''bank.hpp'' #include ''trans.hpp'' main(int argc, char** argv) {    if (argc != 2) {       cout << ''Usage: '' << argv[0] << '' AccountsFile\n'';       return(1);    }    Network* network = new Network;    Bank* mybank = new Bank(100, argv[1]);    ATMProxy* atm = new ATMProxy(mybank, network);    atm->activate();    delete mybank;    delete atm;    return(0); } 
 <  Free Open Study  >  


Object-Oriented Design Heuristics
Object-Oriented Design Heuristics (paperback)
ISBN: 0321774965
EAN: 2147483647
Year: 1996
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net