bitmap.cc 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: bitmap.cc,v 1.1 1999/11/05 05:47:06 jgg Exp $
  4. /* ######################################################################
  5. Bitmap - A trivial class to implement an 1 bit per element boolean
  6. vector
  7. This is deliberately extremely light weight so that it is fast for
  8. the client.
  9. ##################################################################### */
  10. /*}}}*/
  11. // Include files /*{{{*/
  12. #ifdef __GNUG__
  13. #pragma implementation "dsync/bitmap.h"
  14. #endif
  15. #include <dsync/bitmap.h>
  16. #include <string.h>
  17. /*}}}*/
  18. // BitmapVector::BitmapVector - Constructor /*{{{*/
  19. // ---------------------------------------------------------------------
  20. /* Allocate just enough bytes and 0 it */
  21. BitmapVector::BitmapVector(unsigned long Size) : Size(Size)
  22. {
  23. Vect = new unsigned long[Bytes()];
  24. memset(Vect,0,Bytes());
  25. }
  26. /*}}}*/
  27. // BitmapVector::~BitmapVector - Destructor /*{{{*/
  28. // ---------------------------------------------------------------------
  29. /* */
  30. BitmapVector::~BitmapVector()
  31. {
  32. delete [] Vect;
  33. }
  34. /*}}}*/