home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 25 / nopv25.iso / 040A / PBL30DOC.ZIP / BITVECT.TXT < prev    next >
Encoding:
Text File  |  1997-03-12  |  4.6 KB  |  130 lines

  1. zBitVector
  2. ============================================================================
  3.  
  4.     Summary  Non-view class for managing bitmapped vectors.
  5.  
  6.     Remarks  zBitVector provides an implementation of a bit vector object.
  7.              Bit vectors are bit-mapped structures useful for storing
  8.              boolean values. Boolean values are values that can only have
  9.              two states, true and false. zBitVector can hold up to 65535
  10.              different values.
  11.  
  12.  
  13.     ZBITVECTOR::ZBITVECTOR
  14.     -----------------------------------------------------------------------
  15.  
  16.         Summary  Construct bit vectors from bit sets or other objects.
  17.  
  18.         Syntax   zBitVector(size_t aNumBits);
  19.                  zBitVector(const zBitVector &aVector);
  20.  
  21.         Remarks  The extended bit vector class allows you to store up to
  22.                  65,535 bit states.  The constructor needs to know how many
  23.                  flags you need to store before it can create the object.
  24.                  The second constructor is a copy constructor for objects
  25.                  that have aVector as a parent.
  26.  
  27.  
  28.     ZBITVECTOR::~ZBITVECTOR
  29.     ------------------------------------------------------------------------
  30.  
  31.         Summary  Destroys the extended bitmapped vector.
  32.  
  33.         Syntax   ~zBitVector();
  34.  
  35.         Remarks  Destroys the extended vector and frees all memory.
  36.  
  37.  
  38.     ZBITVECTOR::SET, ZBITVECTOR::RESET
  39.     ------------------------------------------------------------------------
  40.  
  41.         Summary  Change the state of a particular bit.
  42.  
  43.         Syntax   void set(size_t aBit);
  44.                  void reset(size_t aBit);
  45.                  void toggle(size_t aBit);
  46.  
  47.         Remarks  The first function sets the 'aBit' bit to on regardless of
  48.                  the current state. The second one sets the 'aBit' bit to
  49.                  off regardless of the current state. The third one changes
  50.                  the state of the bit. If the bit is on, it is turned off.
  51.                  If the bit is off, it is turned on.
  52.  
  53.  
  54.     ZBITVECTOR::HAS
  55.     ------------------------------------------------------------------------
  56.  
  57.         Summary  Checks the state of a bit.
  58.  
  59.         Syntax   Boolean has(size_t aBit) const;
  60.  
  61.         Remarks  Returns True if the 'aBit' bit is set in the vector, False
  62.                  if not. Note that this only checks the state of the bit.
  63.  
  64.  
  65.     ZBITVECTOR::CAPACITY
  66.     ------------------------------------------------------------------------
  67.  
  68.         Summary  Returns the number of bits that can be used.
  69.  
  70.         Syntax   size_t capacity() const;
  71.  
  72.         Remarks  Returns the number of bits that this vector can hold. This
  73.                  number can be predetermined as in the 16 and 32 bit vectors
  74.                  or defined at runtime (as in the extended version).
  75.  
  76.  
  77.     ZBITVECTOR::CLEARALL, ZBITVECTOR::SETALL
  78.     ------------------------------------------------------------------------
  79.  
  80.         Summary  Clear all bits in the vector.
  81.  
  82.         Syntax   void zBitVector::clearAll();
  83.                  void zBitVector::setAll();
  84.  
  85.         Remarks  The first function clears all bits in the extended vector.
  86.                  The second method sets all bits to on.
  87.  
  88.  
  89.     ZBITVECTOR::ERROR
  90.     ------------------------------------------------------------------------
  91.  
  92.         Summary  Returns the error state of the vector.
  93.  
  94.         Syntax   int error();
  95.  
  96.         Remarks  Returns the error state of the vector. It will be 0 or
  97.                  ENOMEM if there wasn't enough memory top perform the
  98.                  requested operation. Note that this resets the error flag.
  99.  
  100.  
  101.     ZBITVECTOR::OPERATOR[]
  102.     ------------------------------------------------------------------------
  103.  
  104.         Summary  Return a state of a particular bit.
  105.  
  106.         Syntax   Boolean operator[](size_t aBit) const;
  107.  
  108.         Remarks  Returns true if the aBit bit is set and False otherwise.
  109.                  This is just an alias for the has() function. Note that
  110.                  a state is retrieved and not a reference to the bit. This
  111.                  means that you cannot use array-like syntax to modify the
  112.                  bit, you can just test it.
  113.  
  114.  
  115.     ZBITVECTOR::OPERATOR=
  116.     ------------------------------------------------------------------------
  117.  
  118.         Summary  Assigns bit-mapped vectors to one another.
  119.  
  120.         Syntax   zBitVector& operator=(const zBitVector &aVector);
  121.  
  122.         Remarks  Assignment operator: assigns values of vectors of the same
  123.                  type. Note that if the capacity of the current object
  124.                  is not enough, the vector will not be expanded, but it will
  125.                  be truncated to fit in. Also note that the assignment
  126.                  operation does reset all flag states before the copying,
  127.                  which means that is the new vector is shorter, the excess
  128.                  bits in the current one will be reset to 0.
  129.  
  130.