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.

115 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. list.hxx
  5. Abstract:
  6. This class is an implementation of the SEQUENTIAL_CONTAINER
  7. protocol. The specific implementation is that of a doubly
  8. linked list.
  9. Author:
  10. Norbert P. Kusters (norbertk) 22-Oct-91
  11. Environment:
  12. ULIB, User Mode
  13. --*/
  14. #if !defined( _LIST_DEFN_ )
  15. #define _LIST_DEFN_
  16. #include "seqcnt.hxx"
  17. #include "membmgr.hxx"
  18. struct OBJECT_LIST_NODE {
  19. OBJECT_LIST_NODE* next;
  20. OBJECT_LIST_NODE* prev;
  21. POBJECT data;
  22. };
  23. DEFINE_POINTER_AND_REFERENCE_TYPES( OBJECT_LIST_NODE );
  24. DECLARE_CLASS( LIST );
  25. class LIST : public SEQUENTIAL_CONTAINER {
  26. FRIEND class LIST_ITERATOR;
  27. public:
  28. ULIB_EXPORT
  29. DECLARE_CONSTRUCTOR( LIST );
  30. VIRTUAL
  31. ULIB_EXPORT
  32. ~LIST(
  33. );
  34. NONVIRTUAL
  35. ULIB_EXPORT
  36. BOOLEAN
  37. Initialize(
  38. );
  39. VIRTUAL
  40. ULONG
  41. QueryMemberCount(
  42. ) CONST;
  43. VIRTUAL
  44. ULIB_EXPORT
  45. BOOLEAN
  46. Put(
  47. IN OUT POBJECT Member
  48. );
  49. VIRTUAL
  50. POBJECT
  51. Remove(
  52. IN OUT PITERATOR Position
  53. );
  54. VIRTUAL
  55. ULIB_EXPORT
  56. PITERATOR
  57. QueryIterator(
  58. ) CONST;
  59. NONVIRTUAL
  60. ULIB_EXPORT
  61. BOOLEAN
  62. Insert(
  63. IN OUT POBJECT Member,
  64. IN OUT PITERATOR Position
  65. );
  66. private:
  67. POBJECT_LIST_NODE _head;
  68. POBJECT_LIST_NODE _tail;
  69. ULONG _count;
  70. MEM_BLOCK_MGR _mem_block_mgr;
  71. NONVIRTUAL
  72. VOID
  73. Construct(
  74. );
  75. NONVIRTUAL
  76. VOID
  77. Destroy(
  78. );
  79. };
  80. #endif // _LIST_DEFN_