home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / CTECHAPP.ZIP / CONTAINR.ZIP / WORKLIST.HPP < prev   
C/C++ Source or Header  |  1990-01-27  |  1KB  |  59 lines

  1. //  Header:     WorkList (A Useful Kind of Doubly-Linked List)
  2. //  Version:    3.20
  3. //
  4. //  Language:   C++ 2.0
  5. //  Environ:    Any
  6. //
  7. //  Purpose:    I'm not sure what to call this kind of doubly-linked list;
  8. //              it's been so useful, I needed to create a class for it. So,
  9. //              WorkList is what it's called!
  10. //
  11. //  Written by: Scott Robert Ladd
  12.  
  13. #if !defined(__WORKLIST_HPP)
  14. #define __WORKLIST_HPP 1
  15.  
  16. #include "DblList.hpp"
  17.  
  18. class WorkList : public DoublyLinkedList
  19.     {
  20.     protected:
  21.         DListNode * Current; // currently selected node in the list
  22.  
  23.     public:
  24.         // constructor
  25.         WorkList();
  26.  
  27.         // copy constructor
  28.         WorkList(const WorkList & wl);
  29.  
  30.         // assignment operator
  31.         void operator = (const WorkList & wl);
  32.  
  33.         // store an item
  34.         virtual int Store(void * item);
  35.  
  36.         // examine an item
  37.         virtual void * Examine();
  38.  
  39.         // read and remove an item
  40.         virtual void * Retrieve();
  41.  
  42.         // delete an item from the list
  43.         virtual int Delete(void * item);
  44.  
  45.         // go to head of list
  46.         virtual void GoToHead();
  47.  
  48.         // go to end of list
  49.         virtual void GoToTail();
  50.  
  51.         // go to next item in list
  52.         virtual void GoNext();
  53.  
  54.         // go to previous item in list
  55.         virtual void GoPrev();
  56.     };
  57.  
  58. #endif
  59.