Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

BitVector Class Reference

#include <BitVector.H>

List of all members.

Public Member Functions

 BitVector (int sizeHint=0) throw ()
 BitVector (const BitVector *bv) throw ()
 BitVector (RecoveryReader &rd) throw (VestaLog::Error, VestaLog::Eof)
 BitVector (std::istream &ifs) throw (FS::EndOfFile, FS::Failure)
 BitVector (SRPC &srpc) throw (SRPC::failure)
 ~BitVector () throw ()
bool IsEmpty () const throw ()
int Size () const throw ()
int Cardinality () const throw ()
bool Read (int i) const throw ()
bool Write (int i, bool val) throw ()
bool Set (int i) throw ()
bool Reset (int i) throw ()
Word ReadWord (int start, short len) const throw ()
void WriteWord (int start, short len, Word val) throw ()
void WriteInterval (int lo, int hi, bool val) throw ()
void SetInterval (int lo, int hi) throw ()
void ResetInterval (int lo, int hi) throw ()
void ResetAll (bool freeMem=false) throw ()
int NextAvailExcept (BitVector *except=(BitVector *) NULL, bool setIt=true) throw ()
int NextAvail (bool setIt=true) throw ()
int MSB () const throw ()
void Pack (const BitVector &mask) throw ()
void Pack (const BitVector *mask) throw ()
void Log (VestaLog &log) const throw (VestaLog::Error)
void Recover (RecoveryReader &rd) throw (VestaLog::Error, VestaLog::Eof)
void Write (std::ostream &ofs) const throw (FS::Failure)
void Read (std::istream &ifs) throw (FS::EndOfFile, FS::Failure)
void Send (SRPC &srpc) const throw (SRPC::failure)
void Recv (SRPC &srpc) throw (SRPC::failure)
void Print (std::ostream &s, int maxWidth=64) const throw ()
void PrintAll (std::ostream &s, int indent=0, int maxWidth=70) const throw ()
BitVectoroperator= (const BitVector &bv) throw ()
BitVectoroperator &= (const BitVector &bv) throw ()
BitVectoroperator|= (const BitVector &bv) throw ()
BitVectoroperator^= (const BitVector &bv) throw ()
BitVectoroperator-= (const BitVector &bv) throw ()

Private Member Functions

 BitVector (int sizeHint, bool doZero) throw ()
void Init (int sizeHint, bool doZero) throw ()
void Extend (short wordCnt, bool doPreserve=true) throw ()
void ExpandSz (int i, short wx) throw ()
void ReduceSz () throw ()
 BitVector (const BitVector &bv)

Private Attributes

Basics::int16 numWords
Basics::int16 firstAvailWd
Basics::int32 sz
Wordword

Friends

class BVIter
std::ostream & operator<< (std::ostream &os, const BitVector &fv) throw ()
bool operator== (const BitVector &bv1, const BitVector &bv2) throw ()
bool operator!= (const BitVector &bv1, const BitVector &bv2) throw ()
bool operator<= (const BitVector &bv1, const BitVector &bv2) throw ()
bool operator>= (const BitVector &bv1, const BitVector &bv2) throw ()
bool operator< (const BitVector &bv1, const BitVector &bv2) throw ()
bool operator> (const BitVector &bv1, const BitVector &bv2) throw ()
BitVectoroperator & (const BitVector &bv1, const BitVector &bv2) throw ()
BitVectoroperator| (const BitVector &bv1, const BitVector &bv2) throw ()
BitVectoroperator^ (const BitVector &bv1, const BitVector &bv2) throw ()
BitVectoroperator- (const BitVector &bv1, const BitVector &bv2) throw ()


Constructor & Destructor Documentation

BitVector::BitVector int  sizeHint = 0  )  throw () [inline]
 

Definition at line 56 of file BitVector.H.

References Init().

BitVector::BitVector const BitVector bv  )  throw ()
 

Definition at line 185 of file BitVector.C.

BitVector::BitVector RecoveryReader rd  )  throw (VestaLog::Error, VestaLog::Eof) [inline]
 

Definition at line 69 of file BitVector.H.

References Recover().

BitVector::BitVector std::istream &  ifs  )  throw (FS::EndOfFile, FS::Failure) [inline]
 

Definition at line 72 of file BitVector.H.

References Read().

BitVector::BitVector SRPC srpc  )  throw (SRPC::failure) [inline]
 

Definition at line 75 of file BitVector.H.

References Recv().

BitVector::~BitVector  )  throw () [inline]
 

Definition at line 78 of file BitVector.H.

References word.

BitVector::BitVector int  sizeHint,
bool  doZero
throw () [inline, private]
 

Definition at line 266 of file BitVector.H.

References Init().

BitVector::BitVector const BitVector bv  )  [private]
 


Member Function Documentation

int BitVector::Cardinality  )  const throw ()
 

Definition at line 286 of file BitVector.C.

References firstAvailWd, and WdCnt().

Referenced by WeederC::GetLeases(), main(), Weeder::MarkWork(), CacheS::RecoverCILog(), WeederC::StartMark(), and Weeder::WriteWeeded().

void BitVector::ExpandSz int  i,
short  wx
throw () [private]
 

Definition at line 220 of file BitVector.C.

References max().

void BitVector::Extend short  wordCnt,
bool  doPreserve = true
throw () [private]
 

Definition at line 194 of file BitVector.C.

References max(), and NEW_PTRFREE_ARRAY.

void BitVector::Init int  sizeHint,
bool  doZero
throw () [private]
 

Definition at line 170 of file BitVector.C.

References WdCnt().

Referenced by BitVector().

bool BitVector::IsEmpty  )  const throw ()
 

Definition at line 245 of file BitVector.C.

References WdCnt().

Referenced by VPKFile::CycleDeletedNamesInList(), PickleDPSSize(), VPKFile::Update(), and SPKFile::Update().

void BitVector::Log VestaLog log  )  const throw (VestaLog::Error)
 

Definition at line 1096 of file BitVector.C.

References WdCnt().

int BitVector::MSB  )  const throw ()
 

Definition at line 595 of file BitVector.C.

References numWords, WdCnt(), and word.

int BitVector::NextAvail bool  setIt = true  )  throw () [inline]
 

Definition at line 149 of file BitVector.H.

References NextAvailExcept().

Referenced by SPKFile::Update().

int BitVector::NextAvailExcept BitVector except = (BitVector *) NULL,
bool  setIt = true
throw ()
 

Definition at line 526 of file BitVector.C.

References max(), min(), and WdCnt().

Referenced by NextAvail().

BitVector & BitVector::operator &= const BitVector bv  )  throw ()
 

Definition at line 867 of file BitVector.C.

References min(), and WdCnt().

BitVector & BitVector::operator-= const BitVector bv  )  throw ()
 

Definition at line 1073 of file BitVector.C.

References min(), and WdCnt().

BitVector & BitVector::operator= const BitVector bv  )  throw ()
 

Definition at line 696 of file BitVector.C.

References WdCnt().

BitVector & BitVector::operator^= const BitVector bv  )  throw ()
 

Definition at line 1009 of file BitVector.C.

References max(), min(), and WdCnt().

BitVector & BitVector::operator|= const BitVector bv  )  throw ()
 

Definition at line 935 of file BitVector.C.

References max(), min(), and WdCnt().

void BitVector::Pack const BitVector mask  )  throw () [inline]
 

Definition at line 162 of file BitVector.H.

References Pack().

void BitVector::Pack const BitVector mask  )  throw ()
 

Definition at line 621 of file BitVector.C.

References BV_DEBUG, min(), and WdCnt().

Referenced by Pack().

void BitVector::Print std::ostream &  s,
int  maxWidth = 64
const throw ()
 

Definition at line 1182 of file BitVector.C.

References min(), and WdCnt().

void BitVector::PrintAll std::ostream &  s,
int  indent = 0,
int  maxWidth = 70
const throw ()
 

Definition at line 1233 of file BitVector.C.

References ExtendRow(), Indent(), BVIter::Next(), and Basics::OBufStream::str().

Referenced by WeederC::GetLeases(), main(), Weeder::MarkWork(), WeederC::StartMark(), and Weeder::WriteWeeded().

void BitVector::Read std::istream &  ifs  )  throw (FS::EndOfFile, FS::Failure)
 

Definition at line 1137 of file BitVector.C.

References NEW_PTRFREE_ARRAY, and FS::Read().

bool BitVector::Read int  i  )  const throw ()
 

Definition at line 302 of file BitVector.C.

References BitIndex(), and WdIndex().

Referenced by BitVector(), Leases::IsLeased(), PickleDPSSize(), and CacheS::RecoverHitFilter().

Word BitVector::ReadWord int  start,
short  len
const throw ()
 

Definition at line 310 of file BitVector.C.

References BitIndex(), and WdIndex().

void BitVector::Recover RecoveryReader rd  )  throw (VestaLog::Error, VestaLog::Eof)
 

Definition at line 1108 of file BitVector.C.

References NEW_PTRFREE_ARRAY.

Referenced by BitVector(), and CacheS::RecoverCILog().

void BitVector::Recv SRPC srpc  )  throw (SRPC::failure)
 

Definition at line 1166 of file BitVector.C.

Referenced by BitVector().

void BitVector::ReduceSz  )  throw () [private]
 

Definition at line 233 of file BitVector.C.

References min(), numWords, sz, and WdCnt().

Referenced by operator &(), and operator-().

bool BitVector::Reset int  i  )  throw ()
 

Definition at line 390 of file BitVector.C.

References BitIndex(), min(), and WdIndex().

Referenced by Write().

void BitVector::ResetAll bool  freeMem = false  )  throw ()
 

Definition at line 495 of file BitVector.C.

References WdCnt().

Referenced by CacheS::ClearStableHitFilter(), Weeder::DeletionPhase(), Leases::Expire(), and CacheS::RecoverCILog().

void BitVector::ResetInterval int  lo,
int  hi
throw ()
 

Definition at line 452 of file BitVector.C.

References BitIndex(), min(), and WdIndex().

Referenced by WriteInterval().

void BitVector::Send SRPC srpc  )  const throw (SRPC::failure)
 

Definition at line 1153 of file BitVector.C.

References WdCnt().

Referenced by ExpCache::GetLeases(), and ExpCache::StartMark().

bool BitVector::Set int  i  )  throw ()
 

Definition at line 380 of file BitVector.C.

References BitIndex(), and WdIndex().

Referenced by VPKFile::NewEntry(), Leases::NewLease(), and Write().

void BitVector::SetInterval int  lo,
int  hi
throw ()
 

Definition at line 407 of file BitVector.C.

References BitIndex(), max(), and WdIndex().

Referenced by SPKFile::Update(), and WriteInterval().

int BitVector::Size  )  const throw () [inline]
 

Definition at line 84 of file BitVector.H.

References sz.

Referenced by CE::T::UncommonFPIsUnlazied(), and SPKFile::Update().

void BitVector::Write std::ostream &  ofs  )  const throw (FS::Failure)
 

Definition at line 1124 of file BitVector.C.

References WdCnt(), and FS::Write().

bool BitVector::Write int  i,
bool  val
throw () [inline]
 

Definition at line 98 of file BitVector.H.

References Reset(), and Set().

Referenced by CacheS::ChkptUsedCIs(), CacheS::WriteHitFilter(), and Weeder::WriteWeeded().

void BitVector::WriteInterval int  lo,
int  hi,
bool  val
throw () [inline]
 

Definition at line 124 of file BitVector.H.

References ResetInterval(), and SetInterval().

Referenced by CacheS::RecoverCILog().

void BitVector::WriteWord int  start,
short  len,
Word  val
throw ()
 

Definition at line 339 of file BitVector.C.

References BitIndex(), min(), and WdIndex().


Friends And Related Function Documentation

friend class BVIter [friend]
 

Definition at line 231 of file BitVector.H.

BitVector* operator & const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 828 of file BitVector.C.

bool operator!= const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 201 of file BitVector.H.

BitVector* operator- const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 1036 of file BitVector.C.

bool operator< const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 796 of file BitVector.C.

std::ostream& operator<< std::ostream &  os,
const BitVector fv
throw () [friend]
 

Definition at line 184 of file BitVector.H.

bool operator<= const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 764 of file BitVector.C.

bool operator== const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 733 of file BitVector.C.

bool operator> const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 209 of file BitVector.H.

bool operator>= const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 205 of file BitVector.H.

BitVector* operator^ const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 968 of file BitVector.C.

BitVector* operator| const BitVector bv1,
const BitVector bv2
throw () [friend]
 

Definition at line 891 of file BitVector.C.


Member Data Documentation

Basics::int16 BitVector::firstAvailWd [private]
 

Definition at line 235 of file BitVector.H.

Referenced by Cardinality(), operator &(), operator-(), operator^(), and operator|().

Basics::int16 BitVector::numWords [private]
 

Definition at line 234 of file BitVector.H.

Referenced by MSB(), operator &(), operator|(), and ReduceSz().

Basics::int32 BitVector::sz [private]
 

Definition at line 236 of file BitVector.H.

Referenced by operator &(), operator-(), operator^(), operator|(), ReduceSz(), and Size().

Word* BitVector::word [private]
 

Definition at line 237 of file BitVector.H.

Referenced by MSB(), operator &(), operator-(), operator^(), operator|(), and ~BitVector().


The documentation for this class was generated from the following files:
Generated on Mon May 8 00:49:07 2006 for Vesta by  doxygen 1.4.2