#include <vbitset.hh>
Collaboration diagram for vBitset_base:
Public Types | |
typedef W | WordType |
typedef A | AllocatorType |
typedef WordType* | Mptr |
typedef WordType& | Mref |
typedef size_t | SizeType |
Public Methods | |
vBitset_base (SizeType len_=1) | |
vBitset_base (const vBitset_base &o) | |
vBitset_base& | operator= (const vBitset_base &o) |
~vBitset_base () | |
reference | operator[] (SizeType n) |
reference | begin () |
reference | end () |
void | resize (SizeType n) |
SizeType | size () const |
SizeType | length () const |
SizeType | capacity () const |
bool | all0 () const |
bool | all1 () const |
SizeType | count1 () const |
SizeType | count0 () const |
void | flip () |
void | doOr (const vBitset_base &o) |
vBitset_base& | operator|= (const vBitset_base &o) |
void | doAnd (const vBitset_base &o) |
vBitset_base& | operator &= (const vBitset_base &o) |
bool | operator== (const vBitset_base &o) const |
bool | operator!= (const vBitset_base &o) const |
void | clear () |
Static Public Methods | |
SizeType | whichWord (SizeType bits) |
SizeType | whichBit (SizeType bits) |
WordType | maskBit (SizeType bits) |
Static Public Attributes | |
const SizeType | WORDBITS = sizeof(WordType) * 8 |
const SizeType | WORDBYTES = sizeof(WordType) |
Protected Methods | |
Mptr | getWord (SizeType n) const |
void | grow (SizeType n) |
void | grow_fill (SizeType n, Mptr d) |
void | updateLimits () |
Private Attributes | |
Mptr | data |
Mptr | endOfData |
SizeType | len |
reference | _begin |
reference | _end |
Static Private Attributes | |
AllocatorType | M_alloc |
Template argument X is the word type to be used for the storage allocation.
Template argument A is the allocator to be used by the class.
Variable-length means that, as each operation is performed between two bitsets, the shortest one is grown to accomodate extra bits resulting from the operations. Shrinking is not yet implemented, and a call to resize with a length that is smaller that the actual bitset's size will cause certain operations to yield funny results.
Definition at line 99 of file vbitset.hh.
|
The word type used for allocating memory. Each bit in the set is mapped to a single bit inside a word. It is essential for this type to be unsiged, as we do quite a bit of shifting on it. Definition at line 116 of file vbitset.hh. |
|
Definition at line 118 of file vbitset.hh. |
|
Storage pointer type. Definition at line 123 of file vbitset.hh. |
|
Storage reference type. Definition at line 128 of file vbitset.hh. |
|
The containers' size_type equivalent (size_t is a good choice). Definition at line 133 of file vbitset.hh. |
|
Creates a new vBitSet of the given length and intializes it with 0.
Definition at line 304 of file vbitset.hh. |
|
Definition at line 317 of file vbitset.hh. |
|
Definition at line 341 of file vbitset.hh. |
|
Definition at line 142 of file vbitset.hh. Referenced by getWord(), grow(), grow_fill(), and vBitset_base().
|
|
Definition at line 147 of file vbitset.hh. Referenced by maskBit().
|
|
Definition at line 152 of file vbitset.hh. Referenced by vBitset_base::reference::move().
|
|
Definition at line 330 of file vbitset.hh. |
|
Returns a "bit reference". All the bit-level operations are implemented through bit refs. Definition at line 351 of file vbitset.hh. |
|
Definition at line 356 of file vbitset.hh. Referenced by BasicDfaGenerator::createBasicDfa(), LaParserWriter::makeLaCondition(), FollowPosGen::operator()(), and operator<<().
|
|
Definition at line 361 of file vbitset.hh. Referenced by BasicDfaGenerator::createBasicDfa(), LaParserWriter::makeLaCondition(), FollowPosGen::operator()(), and operator<<().
|
|
Changes the size of this bitset to n. If n > length(), the new extra space is 0 filled. Definition at line 370 of file vbitset.hh. |
|
Returns the number of bits in this betset. Definition at line 378 of file vbitset.hh. Referenced by length().
|
|
Alias for size. Definition at line 386 of file vbitset.hh. Referenced by count0(), doAnd(), doOr(), EbnfLaNode::dumpAttributes(), and EbnfLl1CheckAlgo::warn().
|
|
Returns the number of storage words allocated for this bitset. The result satisfies the invarian: capacity() * WORDBITS >= size(). Definition at line 395 of file vbitset.hh. Referenced by doAnd(), doOr(), grow(), grow_fill(), operator=(), operator==(), vBitset_base(), and ~vBitset_base().
|
|
True is all bits are 0. Definition at line 403 of file vbitset.hh. Referenced by all1(), BasicDfaGenerator::createBasicDfa(), and EbnfLl1CheckAlgo::operator()().
|
|
Returns true if all bits are 1. Definition at line 411 of file vbitset.hh. |
|
Returns the number of bits that are set. Definition at line 419 of file vbitset.hh. Referenced by all0(), count0(), and DfaReNodeBuilder::createCharListNode().
|
|
Returns the number of bits that are not set. Definition at line 435 of file vbitset.hh. |
|
Flips every bit in this bitset. Definition at line 443 of file vbitset.hh. Referenced by DfaReNodeBuilder::createCharListNode().
|
|
Definition at line 448 of file vbitset.hh. Referenced by operator|=().
|
|
Definition at line 463 of file vbitset.hh. |
|
Definition at line 469 of file vbitset.hh. Referenced by operator &=().
|
|
Definition at line 485 of file vbitset.hh. |
|
*this == o if any of these conditions are true:
Definition at line 497 of file vbitset.hh. |
|
Definition at line 510 of file vbitset.hh. |
|
Definition at line 515 of file vbitset.hh. |
|
returns a pointer to the word containing the n'th bit. Definition at line 527 of file vbitset.hh. Referenced by vBitset_base::reference::move().
|
|
Ensures we have enough storage for holding n bits, by eventually growing the storage. Newly extra space is 0 filled. Definition at line 536 of file vbitset.hh. Referenced by doAnd(), and resize().
|
|
Ensures we have enough storage for n bits, by eventually growing the storage. The newly extra space is filled with bits copied from d[]. Definition at line 559 of file vbitset.hh. Referenced by doOr().
|
|
Updates the _begin and _end iterators after allocating data. Definition at line 581 of file vbitset.hh. Referenced by clear(), doAnd(), doOr(), grow(), grow_fill(), operator=(), and vBitset_base().
|
|
How many bits long our storage word is. Definition at line 138 of file vbitset.hh. |
|
Definition at line 140 of file vbitset.hh. |
|
The internal storage Definition at line 592 of file vbitset.hh. |
|
First word past allocated storage. Definition at line 597 of file vbitset.hh. |
|
The length of the bitvector in bits (this is what size() returns). Definition at line 602 of file vbitset.hh. |
|
Always points to the first element. Definition at line 607 of file vbitset.hh. |
|
Always points to the last element. Definition at line 612 of file vbitset.hh. |
|
Initial value: allocator<unsigned long>() Definition at line 614 of file vbitset.hh. |