BitArray.h 794 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*-------------------------------------------------------------------------
  2. * BitArray.h
  3. *
  4. * Class for bit matching.
  5. *
  6. * Owner:
  7. *
  8. * Copyright 1986-1999 Microsoft Corporation, All Rights Reserved
  9. *-----------------------------------------------------------------------*/
  10. #ifndef _BIT_ARRAY_
  11. #define _BIT_ARRAY_
  12. class CBitArray
  13. {
  14. public:
  15. CBitArray(int nBits);
  16. CBitArray(int nBitsMin, int nBitsMax); // minimum is inclusive, maximum is exclusive
  17. ~CBitArray();
  18. bool FIsSet(int x, int y);
  19. bool Set(int x, int y, bool b);
  20. void ClearRow(int x);
  21. void ClearColumn(int y);
  22. void CBitArray::Dump(int min, int max);
  23. private:
  24. unsigned int * m_pargBits;
  25. int m_nBits;
  26. int m_nMin;
  27. int m_cElemsPerRow; // how many m_pargBits's we need per row
  28. };
  29. #endif // _BIT_ARRAY_