Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
1.8 KiB

  1. /*
  2. *
  3. * NOTES:
  4. *
  5. * REVISIONS:
  6. * pcy26Nov92: Removed windows debug stuff and changed to apcobj.h
  7. * rct01Feb94: List no longer inherits from container or collection
  8. * pcy08Apr94: Trim size, use static iterators, dead code removal
  9. * mwh05May94: #include file madness , part 2
  10. *
  11. * v-stebe 29Jan2002 Removed List::Equals and ListIterator:operator++
  12. * methods to resolve prefast errors.
  13. */
  14. #ifndef __LIST_H
  15. #define __LIST_H
  16. #include "apcobj.h"
  17. _CLASSDEF(Node)
  18. _CLASSDEF(List)
  19. _CLASSDEF(ListIterator)
  20. class List : public Obj {
  21. protected:
  22. INT theItemsInContainer;
  23. PNode theHead;
  24. PNode theTail;
  25. virtual PNode FindNode(PObj);
  26. PNode GetHeadNode() {return theHead;}
  27. PNode GetTailNode() {return theTail;}
  28. friend class ListIterator;
  29. public:
  30. List();
  31. List(List*);
  32. virtual ~List() { Flush(); };
  33. RObj PeekHead() const;
  34. virtual VOID Add( RObj );
  35. virtual VOID Append( PObj );
  36. virtual VOID Detach( RObj );
  37. virtual VOID Flush();
  38. virtual VOID FlushAll();
  39. virtual INT GetItemsInContainer() const { return theItemsInContainer; };
  40. virtual RListIterator InitIterator() const;
  41. // SRB: Removed virtual INT Equal( RObj ) const;
  42. virtual PObj GetHead();
  43. virtual PObj GetTail();
  44. virtual PObj Find(PObj);
  45. };
  46. //-------------------------------------------------------------------
  47. class ListIterator {
  48. private:
  49. PList theList;
  50. PNode theCurrentElement;
  51. public:
  52. ListIterator( RList );
  53. virtual RObj Current();
  54. // SRB: removed virtual RObj operator ++ ( INT );
  55. // SRB: removed virtual RObj operator ++ ();
  56. virtual VOID Reset();
  57. PObj Next();
  58. };
  59. #endif