accountlist.h
资源名称:c.rar [点击查看]
上传用户:puke2000
上传日期:2022-07-25
资源大小:912k
文件大小:1k
源码类别:

C#编程

开发平台:

Visual C++

  1. //=====================================
  2. // accountlist.h
  3. //=====================================
  4. #ifndef ACCOUNTLIST
  5. #define ACCOUNTLIST
  6. #include"account.h"
  7. //-------------------------------------
  8. class Node{
  9. public:
  10.   Account& acnt;
  11.   Node *next, *prev;
  12.   Node(Account& a):acnt(a),next(0),prev(0){}
  13.   bool operator==(const Node& n)const{ return acnt==n.acnt; }
  14. };//-----------------------------------
  15. class AccountList{
  16.   int size;
  17.   Node *first;
  18. public:
  19.   AccountList():first(0),size(0){}
  20.   Node* getFirst()const{ return first; }
  21.   int getSize()const{ return size; }
  22.   void add(Account& a);
  23.   void remove(string acntNo);
  24.   Account* find(string acntNo)const;
  25.   bool isEmpty()const{ return !size; }
  26.   void display()const;
  27.  ~AccountList();
  28. };//-----------------------------------
  29. #endif  // HEADER_ACCOUNTLIST
  30.