HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_BitArray Class Reference

#include <UT_BitArray.h>

Classes

class  iterator
 Iterate over bits that are turned on. More...
 

Public Types

typedef iterator const_iterator
 

Public Member Functions

 UT_BitArray ()
 
 UT_BitArray (const UT_BitArray &src)
 
 UT_BitArray (UT_BitArray &&src) SYS_NOEXCEPT
 
 UT_BitArray (exint size)
 
 ~UT_BitArray ()
 
void insert (exint index, bool value)
 
void append (bool value)
 
void remove (exint index)
 
void cycle (exint shift_offset)
 
exint size () const
 
void setSize (exint new_size)
 
void clear ()
 
exint getSize () const
 
void resize (exint size)
 
const BlockType * data () const
 
exint numBitsSet () const
 
exint numBitsClear () const
 
bool allBitsSet () const
 
bool allBitsClear () const
 
bool getBit (exint index) const
 
bool setBit (exint index, bool value)
 
bool toggleBit (exint index)
 
bool getBitFast (exint index) const
 
void setBitFast (exint index, bool value)
 
void toggleBitFast (exint index)
 
void setBits (exint index, exint nbits, bool value)
 
void toggleBits (exint index, exint nbits)
 
void setAllBits (bool value)
 
void toggleAllBits ()
 
int save (std::ostream &os, bool binary=false) const
 
bool load (UT_IStream &is)
 
exint findFirstBit () const
 
exint findLastBit () const
 
bool operator() (exint index) const
 
bool operator[] (exint index) const
 
UT_BitArrayoperator&= (const UT_BitArray &inMap)
 
UT_BitArrayoperator|= (const UT_BitArray &inMap)
 
UT_BitArrayoperator^= (const UT_BitArray &inMap)
 
UT_BitArrayoperator-= (const UT_BitArray &inMap)
 
UT_BitArrayoperator= (const UT_BitArray &inMap)
 
UT_BitArrayoperator= (UT_BitArray &&src)
 
bool operator== (const UT_BitArray &inMap) const
 
bool operator!= (const UT_BitArray &inMap) const
 
void swap (UT_BitArray &other)
 
bool intersects (const UT_BitArray &inMap) const
 Returns whether there are any intersections between the two arrays. More...
 
int64 getMemoryUsage (bool inclusive=true) const
 
uint computeHash () const
 
iterator begin () const
 
iterator end () const
 
exint iterateInit () const
 
exint iterateNext (exint currentBit) const
 
void iterateInit (exint &i) const
 

Friends

std::ostream & operator<< (std::ostream &os, const UT_BitArray &map)
 

Detailed Description

Definition at line 29 of file UT_BitArray.h.

Member Typedef Documentation

Definition at line 203 of file UT_BitArray.h.

Constructor & Destructor Documentation

UT_BitArray::UT_BitArray ( )
UT_BitArray::UT_BitArray ( const UT_BitArray src)
UT_BitArray::UT_BitArray ( UT_BitArray &&  src)
UT_BitArray::UT_BitArray ( exint  size)
explicit
UT_BitArray::~UT_BitArray ( )

Member Function Documentation

bool UT_BitArray::allBitsClear ( ) const
bool UT_BitArray::allBitsSet ( ) const
void UT_BitArray::append ( bool  value)
inline

Definition at line 40 of file UT_BitArray.h.

iterator UT_BitArray::begin ( void  ) const
inline

Definition at line 205 of file UT_BitArray.h.

void UT_BitArray::clear ( void  )
inline

Definition at line 49 of file UT_BitArray.h.

uint UT_BitArray::computeHash ( ) const
void UT_BitArray::cycle ( exint  shift_offset)
const BlockType* UT_BitArray::data ( ) const
inline

Definition at line 57 of file UT_BitArray.h.

iterator UT_BitArray::end ( void  ) const
inline

Definition at line 206 of file UT_BitArray.h.

exint UT_BitArray::findFirstBit ( ) const

Find first or last bit in the array. The functions will return -1 if no bits are set (i.e. equivalent to allBitsClear())

exint UT_BitArray::findLastBit ( ) const
bool UT_BitArray::getBit ( exint  index) const
inline

Definition at line 257 of file UT_BitArray.h.

bool UT_BitArray::getBitFast ( exint  index) const
inline

Definition at line 317 of file UT_BitArray.h.

int64 UT_BitArray::getMemoryUsage ( bool  inclusive = true) const
inline

Definition at line 123 of file UT_BitArray.h.

exint UT_BitArray::getSize ( ) const
inline

Definition at line 52 of file UT_BitArray.h.

void UT_BitArray::insert ( exint  index,
bool  value 
)
bool UT_BitArray::intersects ( const UT_BitArray inMap) const

Returns whether there are any intersections between the two arrays.

exint UT_BitArray::iterateInit ( void  ) const
inline

Iterate over set bits

eg. for (i = bits.iterateInit(); i >= 0; i = bits.iterateNext(i)) ... do something with bits(i)

Definition at line 361 of file UT_BitArray.h.

void UT_BitArray::iterateInit ( exint i) const
inline

Iterate over set bits

eg. for (i = bits.iterateInit(); i >= 0; i = bits.iterateNext(i)) ... do something with bits(i)

Definition at line 95 of file UT_BitArray.h.

exint UT_BitArray::iterateNext ( exint  currentBit) const
inline

Iterate over set bits

eg. for (i = bits.iterateInit(); i >= 0; i = bits.iterateNext(i)) ... do something with bits(i)

Definition at line 367 of file UT_BitArray.h.

bool UT_BitArray::load ( UT_IStream is)
exint UT_BitArray::numBitsClear ( ) const
exint UT_BitArray::numBitsSet ( ) const
bool UT_BitArray::operator!= ( const UT_BitArray inMap) const
inline

Definition at line 115 of file UT_BitArray.h.

UT_BitArray& UT_BitArray::operator&= ( const UT_BitArray inMap)
bool UT_BitArray::operator() ( exint  index) const
inline

Definition at line 106 of file UT_BitArray.h.

UT_BitArray& UT_BitArray::operator-= ( const UT_BitArray inMap)
UT_BitArray& UT_BitArray::operator= ( const UT_BitArray inMap)
UT_BitArray& UT_BitArray::operator= ( UT_BitArray &&  src)
bool UT_BitArray::operator== ( const UT_BitArray inMap) const
bool UT_BitArray::operator[] ( exint  index) const
inline

Definition at line 107 of file UT_BitArray.h.

UT_BitArray& UT_BitArray::operator^= ( const UT_BitArray inMap)
UT_BitArray& UT_BitArray::operator|= ( const UT_BitArray inMap)
void UT_BitArray::remove ( exint  index)
void UT_BitArray::resize ( exint  size)
inline

Definition at line 55 of file UT_BitArray.h.

int UT_BitArray::save ( std::ostream &  os,
bool  binary = false 
) const
void UT_BitArray::setAllBits ( bool  value)
bool UT_BitArray::setBit ( exint  index,
bool  value 
)
inline

Definition at line 272 of file UT_BitArray.h.

void UT_BitArray::setBitFast ( exint  index,
bool  value 
)
inline

Definition at line 326 of file UT_BitArray.h.

void UT_BitArray::setBits ( exint  index,
exint  nbits,
bool  value 
)
void UT_BitArray::setSize ( exint  new_size)
exint UT_BitArray::size ( void  ) const
inline

Definition at line 46 of file UT_BitArray.h.

void UT_BitArray::swap ( UT_BitArray other)
void UT_BitArray::toggleAllBits ( )
bool UT_BitArray::toggleBit ( exint  index)
inline

Definition at line 295 of file UT_BitArray.h.

void UT_BitArray::toggleBitFast ( exint  index)
inline

Definition at line 335 of file UT_BitArray.h.

void UT_BitArray::toggleBits ( exint  index,
exint  nbits 
)

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const UT_BitArray map 
)
friend

Definition at line 244 of file UT_BitArray.h.


The documentation for this class was generated from the following file: