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.

52 lines
2.0 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Microsoft WMIOLE DB Provider
  4. // (C) Copyright 1999 Microsoft Corporation. All Rights Reserved.
  5. //
  6. // Class Definitions for Bitarray Class
  7. //
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  9. #ifndef _BITARRAY_H_
  10. #define _BITARRAY_H_
  11. //=================================================================================
  12. // Forward Declaration
  13. //=================================================================================
  14. class FAR CBitArray;
  15. typedef CBitArray FAR *LPBITARRAY;
  16. //=================================================================================
  17. // Allocates and manages a bit array through various methods defined in the class
  18. //
  19. // hungarian bits or pbits
  20. //
  21. //=================================================================================
  22. class FAR CBitArray
  23. {
  24. private:
  25. LONG_PTR m_cslotCurrent; //Count of Slots
  26. LONG_PTR m_cPageMax; //Maximum number of pages
  27. LONG_PTR m_cPageCurrent; //Current number of pages
  28. LONG_PTR m_cbPage; //Number of bytes per page
  29. BYTE m_rgbBitMask[8]; //Mask buffer
  30. BYTE * m_rgbBit; //Bit Array
  31. public:
  32. CBitArray( void ); //Class constructor
  33. ~CBitArray( void ); //Class destructor
  34. STDMETHODIMP FInit(HSLOT cslotMax, ULONG cbPage); //Initialization method
  35. STDMETHODIMP SetSlots(HSLOT islotFirst, HSLOT islotLast); //Set a range of slots
  36. STDMETHODIMP ResetSlots(HSLOT islotFirst, HSLOT islotLast); //Reset a range of slots
  37. VOID ResetAllSlots(void); //Reset all slots
  38. STDMETHODIMP ArrayEmpty(void); //Check if any bits are set
  39. STDMETHODIMP IsSlotSet(HSLOT islot); //Check the status of a particular bit
  40. STDMETHODIMP FindSet(HSLOT islotStart, HSLOT islotLimit, HSLOT* pislot); //Find the first set bit in a range of bits
  41. };
  42. #endif