Source code of Windows XP (NT5)
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.

76 lines
1.8 KiB

  1. /****************************************************************************/
  2. /** Microsoft OS/2 LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1990 **/
  4. /****************************************************************************/
  5. /****************************************************************************\
  6. iter.hxx
  7. LM 3.0 abstract iterator class
  8. This file contains the definition for the abstract iterator class that
  9. other iterators should inherit from and emulate.
  10. FILE HISTORY:
  11. johnl 27-Jun-1990 Created
  12. \****************************************************************************/
  13. /****************************************************************************\
  14. *
  15. *NAME: ITER
  16. *
  17. *WORKBOOK: ITER
  18. *
  19. *SYNOPSIS: Abstract iterator class
  20. *
  21. *INTERFACE: ITER_OF(type) - Defines an abstract iterator of type (generally
  22. * used by child classes).
  23. *
  24. * DECLARE_ITER_OF(type) - Produces declaration for an iterator
  25. * of type "type".
  26. *
  27. * virtual void Reset( ) - Puts iterator in the "initial"
  28. * state (i.e., as if it had just
  29. * been declared).
  30. *
  31. * virtual type* Next( ) - Returns "next" item in collection,
  32. * returns NULL if the coll. is empty
  33. * or we have iterated past last item.
  34. *
  35. * virtual type* operator()() - Synonym for Next()
  36. *
  37. *PARENT:
  38. *
  39. *USES: NONE
  40. *
  41. *CAVEATS: NONE
  42. *
  43. *
  44. *
  45. *HISTORY:
  46. * Johnl 27-Jun-1990
  47. *
  48. *
  49. \****************************************************************************/
  50. #ifndef _ITER_HXX_
  51. #define _ITER_HXX_
  52. #define ITER_OF(type) iter_of_##type
  53. #define DECL_ITER_OF(type,dec) \
  54. class dec ITER_OF(type) \
  55. { \
  56. public: \
  57. virtual void Reset( void ) = 0 ; \
  58. virtual type* Next( void ) = 0 ; \
  59. \
  60. }; \
  61. #define DECLARE_ITER_OF(type) \
  62. DECL_ITER_OF(type,DLL_TEMPLATE)
  63. #endif //_ITER_HXX_