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.

125 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. arrayit.hxx
  5. Abstract:
  6. This module contains the declaration for the ARRAY_ITERATOR class.
  7. ARRAY_ITERATOR is a concrete implementation derived from the abstarct
  8. ITERATOR class. It is used to 'read' (iterate) over an ARRAY object.
  9. It has no public constructor and therefore can only be queried from an
  10. ARRAY object. It is the client's responsibility to detsroy
  11. ARRAY_ITERATORs when they are done. ARRAY_ITERATORs maintain the currency
  12. for reading an ARRAY in order.
  13. Author:
  14. David J. Gilman (davegi) 29-Oct-1990
  15. Environment:
  16. ULIB, User Mode
  17. --*/
  18. #if ! defined( _ARRAY_ITERATOR_ )
  19. #define _ARRAY_ITERATOR_
  20. #include "iterator.hxx"
  21. //
  22. // Forward references
  23. //
  24. DECLARE_CLASS( ARRAY );
  25. DECLARE_CLASS( ARRAY_ITERATOR );
  26. class ARRAY_ITERATOR : public ITERATOR {
  27. friend ARRAY;
  28. public:
  29. VIRTUAL
  30. ~ARRAY_ITERATOR(
  31. );
  32. VIRTUAL
  33. VOID
  34. Reset(
  35. );
  36. VIRTUAL
  37. POBJECT
  38. GetCurrent(
  39. );
  40. VIRTUAL
  41. POBJECT
  42. GetNext(
  43. );
  44. VIRTUAL
  45. POBJECT
  46. GetPrevious(
  47. );
  48. NONVIRTUAL
  49. ULONG
  50. QueryCurrentIndex(
  51. );
  52. protected:
  53. DECLARE_CAST_MEMBER_FUNCTION( ARRAY_ITERATOR );
  54. DECLARE_CONSTRUCTOR( ARRAY_ITERATOR );
  55. NONVIRTUAL
  56. BOOLEAN
  57. Initialize(
  58. IN OUT PARRAY Array
  59. );
  60. NONVIRTUAL
  61. VOID
  62. Construct(
  63. );
  64. private:
  65. PARRAY _Array; // Array
  66. ULONG _CurrentIndex; // Current index
  67. };
  68. INLINE
  69. ULONG
  70. ARRAY_ITERATOR::QueryCurrentIndex(
  71. )
  72. /*++
  73. Routine Description:
  74. Obtains the current index
  75. Arguments:
  76. None
  77. Return Value:
  78. ULONG - The current index
  79. --*/
  80. {
  81. return _CurrentIndex;
  82. }
  83. #endif // _ARRAY_ITERATOR_