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.

118 lines
1.4 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. listit.hxx
  5. Abstract:
  6. This is an implementation of iterator for LIST.
  7. Author:
  8. Norbert P. Kusters (norbertk) 24-Oct-91
  9. Environment:
  10. ULIB, User Mode
  11. --*/
  12. #if ! defined( _LIST_ITERATOR_ )
  13. #define _LIST_ITERATOR_
  14. #include "iterator.hxx"
  15. #include "list.hxx"
  16. DECLARE_CLASS( LIST_ITERATOR );
  17. class LIST_ITERATOR : public ITERATOR {
  18. FRIEND class LIST;
  19. public:
  20. DECLARE_CONSTRUCTOR( LIST_ITERATOR );
  21. DECLARE_CAST_MEMBER_FUNCTION( LIST_ITERATOR );
  22. NONVIRTUAL
  23. BOOLEAN
  24. Initialize(
  25. IN PCLIST List
  26. );
  27. VIRTUAL
  28. VOID
  29. Reset(
  30. );
  31. VIRTUAL
  32. POBJECT
  33. GetCurrent(
  34. );
  35. VIRTUAL
  36. POBJECT
  37. GetNext(
  38. );
  39. VIRTUAL
  40. POBJECT
  41. GetPrevious(
  42. );
  43. private:
  44. POBJECT_LIST_NODE _current;
  45. PCLIST _list;
  46. NONVIRTUAL
  47. VOID
  48. Construct(
  49. );
  50. };
  51. INLINE
  52. VOID
  53. LIST_ITERATOR::Construct(
  54. )
  55. /*++
  56. Routine Description:
  57. This routine resets LIST_ITERATOR.
  58. Arguments:
  59. None.
  60. Return Value:
  61. None.
  62. --*/
  63. {
  64. _current = NULL;
  65. _list = NULL;
  66. }
  67. INLINE
  68. BOOLEAN
  69. LIST_ITERATOR::Initialize(
  70. IN PCLIST List
  71. )
  72. {
  73. DebugAssert(List);
  74. _list = List;
  75. return TRUE;
  76. }
  77. #endif // _LIST_ITERATOR_