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.

70 lines
1.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1990 - 1999
  6. //
  7. // File: sset.hxx
  8. //
  9. //--------------------------------------------------------------------------
  10. /* --------------------------------------------------------------------
  11. File : sset.hxx
  12. Title : Simple set implementation.
  13. Description :
  14. History :
  15. -------------------------------------------------------------------- */
  16. #ifndef __SSET_HXX__
  17. #define __SSET_HXX__
  18. #define INITIALSETSLOTS 32
  19. class SIMPLE_SET
  20. {
  21. private:
  22. void * * SetSlots;
  23. int cSetSlots;
  24. int iNextItem;
  25. void * InitialSetSlots[INITIALSETSLOTS];
  26. public:
  27. SIMPLE_SET ( // Constructor.
  28. );
  29. ~SIMPLE_SET ( // Destructor.
  30. );
  31. int // Indicates success (0), or an error (-1);
  32. Insert ( // Insert the item into the set.
  33. void * Item
  34. );
  35. int // Indicates success (0), or an error (-1);
  36. Delete ( // Delete the item from the set.
  37. void * Item
  38. );
  39. int // Returns (1) if the item is a member of the set, and (0) otherwise.
  40. MemberP (
  41. void * Item
  42. );
  43. void
  44. Reset ( // Resets the set, so that when Next is called, the first
  45. // item will be returned.
  46. ) {iNextItem = 0;}
  47. void * // Returns the next item or 0 if at the end.
  48. Next (
  49. );
  50. };
  51. #endif // __SSET_HXX__