KDevelop API Documentation

BitSet Class Reference

A BitSet to replace java.util.BitSet. More...

#include <BitSet.hpp>

List of all members.

Public Member Functions

 BitSet (unsigned int nbits=64)
 BitSet (const unsigned long *bits_, unsigned int nlongs)
 ~BitSet ()
void add (unsigned int el)
bool member (unsigned int el) const
std::vector< unsigned int > toArray () const

Private Attributes

std::vector< boolstorage


Detailed Description

A BitSet to replace java.util.BitSet.

Primary differences are that most set operators return new sets as opposed to oring and anding "in place". Further, a number of operations were added. I cannot contain a BitSet because there is no way to access the internal bits (which I need for speed) and, because it is final, I cannot subclass to add functionality. Consider defining set degree. Without access to the bits, I must call a method n times to test the ith bit...ack!

Also seems like or() from util is wrong when size of incoming set is bigger than this.length.

This is a C++ version of the Java class described above, with only a handful of the methods implemented, because we don't need the others at runtime. It's really just a wrapper around vector<bool>, which should probably be changed to a wrapper around bitset, once bitset is more widely available.

Author:
Terence Parr, MageLang Institute


Pete Wells

Definition at line 45 of file BitSet.hpp.


Constructor & Destructor Documentation

BitSet::BitSet unsigned int  nbits = 64  ) 
 

Definition at line 14 of file BitSet.cpp.

References BitSet(), and storage.

Referenced by BitSet().

BitSet::BitSet const unsigned long *  bits_,
unsigned int  nlongs
 

Definition at line 21 of file BitSet.cpp.

References BitSet(), and storage.

BitSet::~BitSet  ) 
 

Definition at line 28 of file BitSet.cpp.


Member Function Documentation

void BitSet::add unsigned int  el  ) 
 

Definition at line 32 of file BitSet.cpp.

References add(), and storage.

Referenced by add(), TokenStreamBasicFilter::discard(), and TokenStreamHiddenTokenFilter::hide().

bool BitSet::member unsigned int  el  )  const
 

Definition at line 40 of file BitSet.cpp.

References member(), and storage.

Referenced by TokenStreamHiddenTokenFilter::consumeFirst(), Parser::consumeUntil(), CharScanner::consumeUntil(), TreeParser::match(), Parser::match(), CharScanner::match(), member(), TokenStreamHiddenTokenFilter::nextToken(), and TokenStreamBasicFilter::nextToken().

std::vector< unsigned int > BitSet::toArray  )  const
 

Definition at line 48 of file BitSet.cpp.

References ANTLR_USE_NAMESPACE.


Member Data Documentation

std ::vector<bool> BitSet::storage [private]
 

Definition at line 47 of file BitSet.hpp.

Referenced by add(), BitSet(), and member().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:01:59 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003