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.

111 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. Environment:
  10. ULIB, User Mode
  11. --*/
  12. #if !defined( _LIST_DEFN_ )
  13. #define _LIST_DEFN_
  14. #include "seqcnt.hxx"
  15. #include "membmgr.hxx"
  16. struct OBJECT_LIST_NODE {
  17. OBJECT_LIST_NODE* next;
  18. OBJECT_LIST_NODE* prev;
  19. POBJECT data;
  20. };
  21. DEFINE_POINTER_AND_REFERENCE_TYPES( OBJECT_LIST_NODE );
  22. DECLARE_CLASS( LIST );
  23. class LIST : public SEQUENTIAL_CONTAINER {
  24. FRIEND class LIST_ITERATOR;
  25. public:
  26. ULIB_EXPORT
  27. DECLARE_CONSTRUCTOR( LIST );
  28. VIRTUAL
  29. ULIB_EXPORT
  30. ~LIST(
  31. );
  32. NONVIRTUAL
  33. ULIB_EXPORT
  34. BOOLEAN
  35. Initialize(
  36. );
  37. VIRTUAL
  38. ULONG
  39. QueryMemberCount(
  40. ) CONST;
  41. VIRTUAL
  42. ULIB_EXPORT
  43. BOOLEAN
  44. Put(
  45. IN OUT POBJECT Member
  46. );
  47. VIRTUAL
  48. POBJECT
  49. Remove(
  50. IN OUT PITERATOR Position
  51. );
  52. VIRTUAL
  53. ULIB_EXPORT
  54. PITERATOR
  55. QueryIterator(
  56. ) CONST;
  57. NONVIRTUAL
  58. ULIB_EXPORT
  59. BOOLEAN
  60. Insert(
  61. IN OUT POBJECT Member,
  62. IN OUT PITERATOR Position
  63. );
  64. private:
  65. POBJECT_LIST_NODE _head;
  66. POBJECT_LIST_NODE _tail;
  67. ULONG _count;
  68. MEM_BLOCK_MGR _mem_block_mgr;
  69. NONVIRTUAL
  70. VOID
  71. Construct(
  72. );
  73. NONVIRTUAL
  74. VOID
  75. Destroy(
  76. );
  77. };
  78. #endif // _LIST_DEFN_