GP1212A02: Clock support.
1 /***************************************************************************
2 * Arrays of Arbitrary Bit Length
5 * Purpose : Provides object with methods for creation and manipulation of
6 * arbitrary length arrays of bits.
8 * Bit arrays are implemented as vectors of unsigned chars. Bit
9 * 0 is the MSB of char 0, and the last bit is the least
10 * significant (non-spare) bit of the last unsigned char.
12 * Example: array of 20 bits (0 through 19) with 8 bit unsigned
13 * chars requires 3 unsigned chars (0 through 2) to
17 * +--------+--------+--------+
19 * +--------+--------+--------+
20 * bit 01234567 8911111111111XXXX
23 * Author : Michael Dipperstein
24 * Date : July 23, 2004
26 ****************************************************************************
29 * $Id: bitarray.cpp,v 1.7 2010/02/04 03:31:43 michael Exp $
30 * $Log: bitarray.cpp,v $
31 * Revision 1.7 2010/02/04 03:31:43 michael
32 * Replaced vector<unsigned char> with an array of unsigned char.
34 * Made updates for GCC 4.4.
36 * Revision 1.5 2007/08/06 05:23:29 michael
37 * Updated for LGPL Version 3.
39 * All methods that don't modify object have been made
40 * const to increase functionality of const bit_array_c.
42 * All assignment operators return a reference to the object being assigned a value so that operator chaining will work.
44 * Added >> and << operators.
46 * Revision 1.3 2006/04/30 23:34:07 michael
47 * Improved performance by incorporating Benjamin Schindler's
48 * <bschindler@student.ethz.ch> changes to pass arguments as a reference.
50 * Revision 1.2 2004/08/05 22:16:49 michael
51 * Add overloads for bitwise operators returning values.
52 * Add a more natural looking way to set bit values.
54 * Revision 1.1.1.1 2004/08/04 13:28:20 michael
57 ****************************************************************************
59 * Bitarray: An ANSI C++ class for manipulating arbitrary length bit arrays
60 * Copyright (C) 2004, 2006-2007, 2010 by
61 * Michael Dipperstein (mdipper@alumni.engr.ucsb.edu)
63 * This file is part of the bit array library.
65 * The bit array library is free software; you can redistribute it and/or
66 * modify it under the terms of the GNU Lesser General Public License as
67 * published by the Free Software Foundation; either version 3 of the
68 * License, or (at your option) any later version.
70 * The bit array library is distributed in the hope that it will be useful,
71 * but WITHOUT ANY WARRANTY; without even the implied warranty of
72 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
73 * General Public License for more details.
75 * You should have received a copy of the GNU Lesser General Public License
76 * along with this program. If not, see <http://www.gnu.org/licenses/>.
78 ***************************************************************************/
80 /***************************************************************************
82 ***************************************************************************/
89 /***************************************************************************
91 ***************************************************************************/
93 /* make CHAR_BIT 8 if it's not defined in limits.h */
95 #warning CHAR_BIT not defined. Assuming 8 bits.
99 /* position of bit within character */
100 #define BIT_CHAR(bit) ((bit) / CHAR_BIT)
102 /* array index for character containing bit */
103 //SL: We had to change that macro since bits in our frame buffer are the other way around
104 //TODO: Find a solution to tackle that problem
106 //Bits are indexed: 01234567
107 //#define BIT_IN_CHAR(bit) (1 << (CHAR_BIT - 1 - ((bit) % CHAR_BIT)))
109 //Bits are indexed: 76543210
110 //#define BIT_IN_CHAR(bit) (1 << (((bit) % CHAR_BIT)))
112 /* number of characters required to contain number of bits */
113 #define BITS_TO_CHARS(bits) ((((bits) - 1) / CHAR_BIT) + 1)
115 /* most significant bit in a character */
116 #define MS_BIT (1 << (CHAR_BIT - 1))
118 /***************************************************************************
120 ***************************************************************************/
122 /***************************************************************************
123 * Method : bit_array_c - constructor
124 * Description: This is the bit_array_c constructor. It reserves memory
125 * for the vector storing the array.
126 * Parameters : numBits - number of bits in the array
127 * Effects : Allocates vectory for array bits
129 ***************************************************************************/
130 template <TBitInChar F>
131 BitArray<F>::BitArray(const int numBits):
136 m_SizeInBytes = BITS_TO_CHARS(numBits);
139 /* allocate space for bit array */
140 m_Array = new unsigned char[m_SizeInBytes];
142 /* set all bits to 0 */
143 fill_n(m_Array, m_SizeInBytes, 0);
146 /***************************************************************************
147 * Method : bit_array_c - constructor
148 * Description: This is the bit_array_c constructor. It copies the
149 * for contents of a vector of unsigned char into the
151 * Parameters : vect - vector to be copied
152 * numBits - number of bits in the array
153 * Effects : Allocates vectory for array bits
155 ***************************************************************************/
156 template <TBitInChar F>
157 BitArray<F>::BitArray(unsigned char *array, const int numBits,bool aOwnsBuffer):
160 m_OwnsBuffer(aOwnsBuffer)
165 /***************************************************************************
166 * Method : ~bit_array_c - destructor
167 * Description: This is the bit_array_c destructor. At this point it's
168 * just a place holder.
172 ***************************************************************************/
173 template <TBitInChar F>
174 BitArray<F>::~BitArray(void)
183 /***************************************************************************
185 * Description: This method dumps the conents of a bit array to stdout.
186 * The format of the dump is a series of bytes represented in
188 * Parameters : outStream - stream to write to
189 * Effects : Array contents are dumped to stdout
191 ***************************************************************************/
192 template <TBitInChar F>
193 void BitArray<F>::Dump(std::ostream &outStream)
197 size = BITS_TO_CHARS(m_NumBits);
201 outStream << uppercase << hex << (int)(m_Array[0]); /* first byte */
203 for (int i = 1; i < size; i++)
205 /* remaining bytes with a leading space */
209 outStream << (int)(m_Array[i]);
215 /***************************************************************************
217 * Description: This method sets every bit in the bit array to 1. This
218 * method uses UCHAR_MAX to determine what it means to set
219 * all bits in an unsigned char, so it is crucial that the
220 * machine implementation of unsigned char utilizes all of
221 * the bits in the memory allocated for an unsigned char.
223 * Effects : Each of the bits used in the bit array are set to 1.
224 * Unused (spare) bits are set to 0.
226 ***************************************************************************/
227 template <TBitInChar F>
228 void BitArray<F>::SetAll(void)
233 size = BITS_TO_CHARS(m_NumBits);
235 /* set bits in all bytes to 1 */
236 fill_n(m_Array, size, UCHAR_MAX);
238 /* zero any spare bits so increment and decrement are consistent */
239 bits = m_NumBits % CHAR_BIT;
242 mask = UCHAR_MAX << (CHAR_BIT - bits);
243 m_Array[BIT_CHAR(m_NumBits - 1)] = mask;
247 /***************************************************************************
249 * Description: This method sets every bit in the bit array to 0.
251 * Effects : Each of the bits in the bit array are set to 0.
253 ***************************************************************************/
254 template <TBitInChar F>
255 void BitArray<F>::ClearAll(void)
259 size = BITS_TO_CHARS(m_NumBits);
261 /* set bits in all bytes to 0 */
262 fill_n(m_Array, size, 0);
265 /***************************************************************************
267 * Description: This method sets a bit in the bit array to 1.
268 * Parameters : bit - the number of the bit to set
269 * Effects : The specified bit will be set to 1.
271 ***************************************************************************/
272 template <TBitInChar F>
273 void BitArray<F>::SetBit(const unsigned int bit)
275 if (m_NumBits <= bit)
277 return; /* bit out of range */
280 m_Array[BIT_CHAR(bit)] |= F(bit);
285 template <TBitInChar F>
286 void BitArray<F>::SetBitValue(const unsigned int bit, bool aValue)
298 /***************************************************************************
300 * Description: This method sets a bit in the bit array to 0.
301 * Parameters : bit - the number of the bit to clear
302 * Effects : The specified bit will be set to 0.
304 ***************************************************************************/
305 template <TBitInChar F>
306 void BitArray<F>::ClearBit(const unsigned int bit)
310 if (m_NumBits <= bit)
312 return; /* bit out of range */
315 /* create a mask to zero out desired bit */
319 m_Array[BIT_CHAR(bit)] &= mask;
322 /***************************************************************************
323 * Method : operator()
324 * Description: Overload of the () operator. This method approximates
325 * array indices used for assignment. It returns a
326 * bit_array_index_c which includes an = method used to
328 * Parameters : bit - index of array bit
330 * Returned : bit_array_index_c (pointer to bit)
331 ***************************************************************************/
332 template <TBitInChar F>
333 BitArrayIndex<F> BitArray<F>::operator()(const unsigned int bit)
335 BitArrayIndex<F> result(this, bit);
340 /***************************************************************************
341 * Method : operator[]
342 * Description: Overload of the [] operator. This method returns the
343 * value of a bit in the bit array.
344 * Parameters : bit - index of array bit
346 * Returned : The value of the specified bit.
347 ***************************************************************************/
348 template <TBitInChar F>
349 bool BitArray<F>::operator[](const unsigned int bit) const
351 return((m_Array[BIT_CHAR(bit)] & F(bit)) != 0);
354 /***************************************************************************
355 * Method : operator==
356 * Description: overload of the == operator
357 * Parameters : other - bit array to compare
359 * Returned : True if this == other. Otherwise false.
360 ***************************************************************************/
361 template <TBitInChar F>
362 bool BitArray<F>::operator==(const BitArray &other) const
364 if (m_NumBits != other.m_NumBits)
370 return (this->m_Array == other.m_Array);
373 /***************************************************************************
374 * Method : operator!=
375 * Description: overload of the != operator
376 * Parameters : other - bit array to compare
378 * Returned : True if this != other. Otherwise false.
379 ***************************************************************************/
380 template <TBitInChar F>
381 bool BitArray<F>::operator!=(const BitArray &other) const
383 if (m_NumBits != other.m_NumBits)
389 return (this->m_Array != other.m_Array);
392 /***************************************************************************
394 * Description: overload of the < operator
395 * Parameters : other - bit array to compare
397 * Returned : True if this < other. Otherwise false.
398 ***************************************************************************/
399 template <TBitInChar F>
400 bool BitArray<F>::operator<(const BitArray &other) const
402 if (m_NumBits != other.m_NumBits)
408 return (this->m_Array < other.m_Array);
411 /***************************************************************************
412 * Method : operator<=
413 * Description: overload of the <= operator
414 * Parameters : other - bit array to compare
416 * Returned : True if this <= other. Otherwise false.
417 ***************************************************************************/
418 template <TBitInChar F>
419 bool BitArray<F>::operator<=(const BitArray &other) const
421 if (m_NumBits != other.m_NumBits)
427 return (this->m_Array <= other.m_Array);
430 /***************************************************************************
432 * Description: overload of the > operator
433 * Parameters : other - bit array to compare
435 * Returned : True if this > other. Otherwise false.
436 ***************************************************************************/
437 template <TBitInChar F>
438 bool BitArray<F>::operator>(const BitArray &other) const
440 if (m_NumBits != other.m_NumBits)
446 return (this->m_Array > other.m_Array);
449 /***************************************************************************
450 * Method : operator>=
451 * Description: overload of the >= operator
452 * Parameters : other - bit array to compare
454 * Returned : True if this >= other. Otherwise false.
455 ***************************************************************************/
456 template <TBitInChar F>
457 bool BitArray<F>::operator>=(const BitArray &other) const
459 if (m_NumBits != other.m_NumBits)
465 return (this->m_Array >= other.m_Array);
468 /***************************************************************************
470 * Description: overload of the ~ operator. Negates all non-spare bits in
474 * Returned : value of this after bitwise not
475 ***************************************************************************/
476 template <TBitInChar F>
477 BitArray<F> BitArray<F>::operator~(void) const
479 BitArray result(this->m_NumBits);
486 /***************************************************************************
488 * Description: overload of the & operator. Performs a bitwise and
489 * between the source array and this bit array.
490 * Parameters : other - bit array on righthand side of &
492 * Returned : value of bitwise and of this and other.
493 ***************************************************************************/
494 template <TBitInChar F>
495 BitArray<F> BitArray<F>::operator&(const BitArray<F> &other) const
497 BitArray<F> result(this->m_NumBits);
505 /***************************************************************************
507 * Description: overload of the ^ operator. Performs a bitwise xor
508 * between the source array and this bit array.
509 * Parameters : other - bit array on righthand side of ^
511 * Returned : value of bitwise xor of this and other.
512 ***************************************************************************/
513 template <TBitInChar F>
514 BitArray<F> BitArray<F>::operator^(const BitArray<F> &other) const
516 BitArray<F> result(this->m_NumBits);
523 /***************************************************************************
525 * Description: overload of the | operator. Performs a bitwise or
526 * between the source array and this bit array.
527 * Parameters : other - bit array on righthand side of |
529 * Returned : value of bitwise or of this and other.
530 ***************************************************************************/
531 template <TBitInChar F>
532 BitArray<F> BitArray<F>::operator|(const BitArray<F> &other) const
534 BitArray<F> result(this->m_NumBits);
541 /***************************************************************************
542 * Method : operator<<
543 * Description: overload of the << operator. Performs a bitwise left
544 * shift of this bit array.
545 * Parameters : count - the number of bits to shift left
547 * Returned : result of bitwise left shift
548 ***************************************************************************/
549 template <TBitInChar F>
550 BitArray<F> BitArray<F>::operator<<(const unsigned int count) const
552 BitArray<F> result(this->m_NumBits);
559 /***************************************************************************
560 * Method : operator>>
561 * Description: overload of the >> operator. Performs a bitwise right
562 * shift of this bit array.
563 * Parameters : count - the number of bits to shift right
565 * Returned : result of bitwise right shift
566 ***************************************************************************/
567 template <TBitInChar F>
568 BitArray<F> BitArray<F>::operator>>(const unsigned int count) const
570 BitArray<F> result(this->m_NumBits);
577 /***************************************************************************
578 * Method : operator++ (prefix)
579 * Description: overload of the ++ operator. Increments the contents of
580 * a bit array. Overflows cause rollover.
582 * Effects : Bit array contents are incremented
583 * Returned : Reference to this array after increment
584 ***************************************************************************/
585 template <TBitInChar F>
586 BitArray<F>& BitArray<F>::operator++(void)
589 unsigned char maxValue; /* maximum value for current char */
590 unsigned char one; /* least significant bit in current char */
594 return *this; /* nothing to increment */
597 /* handle arrays that don't use every bit in the last character */
598 i = (m_NumBits % CHAR_BIT);
601 maxValue = UCHAR_MAX << (CHAR_BIT - i);
602 one = 1 << (CHAR_BIT - i);
606 maxValue = UCHAR_MAX;
610 for (i = BIT_CHAR(m_NumBits - 1); i >= 0; i--)
612 if (m_Array[i] != maxValue)
614 m_Array[i] = m_Array[i] + one;
619 /* need to carry to next byte */
622 /* remaining characters must use all bits */
623 maxValue = UCHAR_MAX;
631 /***************************************************************************
632 * Method : operator++ (postfix)
633 * Description: overload of the ++ operator. Increments the contents of
634 * a bit array. Overflows cause rollover.
635 * Parameters : dumy - needed for postfix increment
636 * Effects : Bit array contents are incremented
637 * Returned : Reference to this array after increment
638 ***************************************************************************/
639 template <TBitInChar F>
640 BitArray<F>& BitArray<F>::operator++(int dummy)
646 /***************************************************************************
647 * Method : operator-- (prefix)
648 * Description: overload of the -- operator. Decrements the contents of
649 * a bit array. Underflows cause rollover.
651 * Effects : Bit array contents are decremented
653 ***************************************************************************/
654 template <TBitInChar F>
655 BitArray<F>& BitArray<F>::operator--(void)
658 unsigned char maxValue; /* maximum value for current char */
659 unsigned char one; /* least significant bit in current char */
663 return *this; /* nothing to decrement */
666 /* handle arrays that don't use every bit in the last character */
667 i = (m_NumBits % CHAR_BIT);
670 maxValue = UCHAR_MAX << (CHAR_BIT - i);
671 one = 1 << (CHAR_BIT - i);
675 maxValue = UCHAR_MAX;
679 for (i = BIT_CHAR(m_NumBits - 1); i >= 0; i--)
681 if (m_Array[i] >= one)
683 m_Array[i] = m_Array[i] - one;
688 /* need to borrow from the next byte */
689 m_Array[i] = maxValue;
691 /* remaining characters must use all bits */
692 maxValue = UCHAR_MAX;
700 /***************************************************************************
701 * Method : operator-- (postfix)
702 * Description: overload of the -- operator. Decrements the contents of
703 * a bit array. Underflows cause rollover.
704 * Parameters : dumy - needed for postfix decrement
705 * Effects : Bit array contents are decremented
707 ***************************************************************************/
708 template <TBitInChar F>
709 BitArray<F>& BitArray<F>::operator--(int dummy)
715 /***************************************************************************
717 * Description: overload of the = operator. Copies source contents into
719 * Parameters : src - Source bit array
720 * Effects : Source bit array contents are copied into this array
721 * Returned : Reference to this array after copy
722 ***************************************************************************/
723 template <TBitInChar F>
724 BitArray<F>& BitArray<F>::operator=(const BitArray<F> &src)
728 /* don't do anything for a self assignment */
732 if (m_NumBits != src.m_NumBits)
734 /* don't do assignment with different array sizes */
738 if ((m_NumBits == 0) || (src.m_NumBits == 0))
740 /* don't do assignment with unallocated array */
744 /* copy bits from source */
746 size = BITS_TO_CHARS(m_NumBits);
748 copy(src.m_Array, &src.m_Array[size], this->m_Array);
752 /***************************************************************************
753 * Method : operator&=
754 * Description: overload of the &= operator. Performs a bitwise and
755 * between the source array and this bit array. This bit
756 * array will contain the result.
757 * Parameters : src - Source bit array
758 * Effects : Results of bitwise and are stored in this array
759 * Returned : Reference to this array after and
760 ***************************************************************************/
761 template <TBitInChar F>
762 BitArray<F>& BitArray<F>::operator&=(const BitArray<F> &src)
766 size = BITS_TO_CHARS(m_NumBits);
768 if (m_NumBits != src.m_NumBits)
770 /* don't do assignment with different array sizes */
774 /* AND array one unsigned char at a time */
775 for(int i = 0; i < size; i++)
777 m_Array[i] = m_Array[i] & src.m_Array[i];
783 /***************************************************************************
784 * Method : operator^=
785 * Description: overload of the ^= operator. Performs a bitwise xor
786 * between the source array and this bit array. This bit
787 * array will contain the result.
788 * Parameters : src - Source bit array
789 * Effects : Results of bitwise xor are stored in this array
790 * Returned : Reference to this array after xor
791 ***************************************************************************/
792 template <TBitInChar F>
793 BitArray<F>& BitArray<F>::operator^=(const BitArray<F> &src)
797 size = BITS_TO_CHARS(m_NumBits);
799 if (m_NumBits != src.m_NumBits)
801 /* don't do assignment with different array sizes */
805 /* XOR array one unsigned char at a time */
806 for(int i = 0; i < size; i++)
808 m_Array[i] = m_Array[i] ^ src.m_Array[i];
814 /***************************************************************************
815 * Method : operator|=
816 * Description: overload of the |= operator. Performs a bitwise or
817 * between the source array and this bit array. This bit
818 * array will contain the result.
819 * Parameters : src - Source bit array
820 * Effects : Results of bitwise or are stored in this array
821 * Returned : Reference to this array after or
822 ***************************************************************************/
823 template <TBitInChar F>
824 BitArray<F>& BitArray<F>::operator|=(const BitArray<F> &src)
828 size = BITS_TO_CHARS(m_NumBits);
830 if (m_NumBits != src.m_NumBits)
832 /* don't do assignment with different array sizes */
836 /* OR array one unsigned char at a time */
837 for(int i = 0; i < size; i++)
839 m_Array[i] = m_Array[i] | src.m_Array[i];
845 /***************************************************************************
847 * Description: Negates all non-spare bits in bit array.
849 * Effects : Contents of bit array are negated. Any spare bits are
851 * Returned : Reference to this array after not
852 ***************************************************************************/
853 template <TBitInChar F>
854 BitArray<F>& BitArray<F>::Not(void)
860 size = BITS_TO_CHARS(m_NumBits);
864 /* don't do not with unallocated array */
868 /* NOT array one unsigned char at a time */
869 for(int i = 0; i < size; i++)
871 m_Array[i] = ~m_Array[i];
874 /* zero any spare bits so increment and decrement are consistent */
875 bits = m_NumBits % CHAR_BIT;
878 mask = UCHAR_MAX << (CHAR_BIT - bits);
879 m_Array[BIT_CHAR(m_NumBits - 1)] &= mask;
885 /***************************************************************************
886 * Method : operator<<=
887 * Description: overload of the <<= operator. Performs a left shift on
888 * this bit array. This bit array will contain the result.
889 * Parameters : shifts - number of bit positions to shift
890 * Effects : Results of the shifts are stored in this array
891 * Returned : Reference to this array after shift
892 ***************************************************************************/
893 template <TBitInChar F>
894 BitArray<F>& BitArray<F>::operator<<=(const unsigned int shifts)
897 int chars = shifts / CHAR_BIT; /* number of whole byte shifts */
899 if (shifts >= m_NumBits)
901 /* all bits have been shifted off */
906 /* first handle big jumps of bytes */
911 size = BITS_TO_CHARS(m_NumBits);
913 for (i = 0; (i + chars) < size; i++)
915 m_Array[i] = m_Array[i + chars];
918 /* now zero out new bytes on the right */
919 for (i = size; chars > 0; chars--)
921 m_Array[i - chars] = 0;
925 /* now we have at most CHAR_BIT - 1 bit shifts across the whole array */
926 for (i = 0; i < (int)(shifts % CHAR_BIT); i++)
928 for (unsigned int j = 0; j < BIT_CHAR(m_NumBits - 1); j++)
932 /* handle shifts across byte bounds */
933 if (m_Array[j + 1] & MS_BIT)
939 m_Array[BIT_CHAR(m_NumBits - 1)] <<= 1;
945 /***************************************************************************
946 * Method : operator>>=
947 * Description: overload of the >>= operator. Performs a right shift on
948 * this bit array. This bit array will contain the result.
949 * Parameters : shifts - number of bit positions to shift
950 * Effects : Results of the shifts are stored in this array
951 * Returned : Reference to this array after shift
952 ***************************************************************************/
953 template <TBitInChar F>
954 BitArray<F>& BitArray<F>::operator>>=(const unsigned int shifts)
958 int chars = shifts / CHAR_BIT; /* number of whole byte shifts */
960 if (shifts >= m_NumBits)
962 /* all bits have been shifted off */
967 /* first handle big jumps of bytes */
970 for (i = BIT_CHAR(m_NumBits - 1); (i - chars) >= 0; i--)
972 m_Array[i] = m_Array[i - chars];
975 /* now zero out new bytes on the right */
976 for (; chars > 0; chars--)
978 m_Array[chars - 1] = 0;
982 /* now we have at most CHAR_BIT - 1 bit shifts across the whole array */
983 for (i = 0; i < (int)(shifts % CHAR_BIT); i++)
985 for (unsigned int j = BIT_CHAR(m_NumBits - 1); j > 0; j--)
989 /* handle shifts across byte bounds */
990 if (m_Array[j - 1] & 0x01)
992 m_Array[j] |= MS_BIT;
999 /***********************************************************************
1000 * zero any spare bits that are shifted beyond the end of the bit array
1001 * so that increment and decrement are consistent.
1002 ***********************************************************************/
1003 i = m_NumBits % CHAR_BIT;
1006 mask = UCHAR_MAX << (CHAR_BIT - i);
1007 m_Array[BIT_CHAR(m_NumBits - 1)] &= mask;
1013 /***************************************************************************
1014 * Method : bit_array_index_c - constructor
1015 * Description: This is the bit_array_index_c constructor. It stores a
1016 * pointer to the bit array and the bit index.
1017 * Parameters : array - pointer to bit array
1018 * index - index of bit in array
1019 * Effects : Pointer to bit array and bit index are stored.
1021 ***************************************************************************/
1022 template <TBitInChar F>
1023 BitArrayIndex<F>::BitArrayIndex(BitArray<F> *array,
1024 const unsigned int index)
1030 /***************************************************************************
1031 * Method : operator=
1032 * Description: overload of the = operator. Sets the bit array bit to
1034 * Parameters : src - bit value
1035 * Effects : Bit pointed to by this object is set to the value of
1038 ***************************************************************************/
1039 template <TBitInChar F>
1040 void BitArrayIndex<F>::operator=(const bool src)
1042 if (m_BitArray == NULL)
1044 return; /* no array */
1047 if (m_BitArray->SizeInBits() <= m_Index)
1049 return; /* index is out of bounds */
1054 m_BitArray->SetBit(m_Index);
1058 m_BitArray->ClearBit(m_Index);
1063 template class BitArray<HighBitHighIndex>;
1064 template class BitArray<HighBitLowIndex>;
1065 template class BitArrayIndex<HighBitHighIndex>;
1066 template class BitArrayIndex<HighBitLowIndex>;