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 uint64 BlockType
 
typedef iterator const_iterator
 

Public Member Functions

 UT_BitArray ()
 
 UT_BitArray (const UT_BitArray &src)
 
 UT_BitArray (UT_BitArray &&src) 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 BlockTypedata () 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 &in_map)
 
UT_BitArrayoperator|= (const UT_BitArray &in_map)
 
UT_BitArrayoperator^= (const UT_BitArray &in_map)
 
UT_BitArrayoperator-= (const UT_BitArray &in_map)
 
UT_BitArrayoperator= (const UT_BitArray &in_map)
 
UT_BitArrayoperator= (UT_BitArray &&src)
 
bool operator== (const UT_BitArray &in_map) const
 
bool operator!= (const UT_BitArray &in_map) const
 
void swap (UT_BitArray &other)
 
bool intersects (const UT_BitArray &in_map) 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
 
void unsafeShareData (BlockType *bits, exint bit_count)
 
void unsafeClearData ()
 
exint iterateInit () const
 
exint iterateNext (exint current_bit) const
 
void iterateInit (exint &i) const
 

Static Public Member Functions

static exint numWords (exint size_in_bits)
 

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 31 of file UT_BitArray.h.

Definition at line 205 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)
noexcept
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 207 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 208 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 273 of file UT_BitArray.h.

bool UT_BitArray::getBitFast ( exint  index) const
inline

Definition at line 333 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 in_map) const

Returns whether there are any intersections between the two arrays.

exint UT_BitArray::iterateInit ( ) 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 377 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  current_bit) 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 383 of file UT_BitArray.h.

bool UT_BitArray::load ( UT_IStream is)
exint UT_BitArray::numBitsClear ( ) const
exint UT_BitArray::numBitsSet ( ) const
static exint UT_BitArray::numWords ( exint  size_in_bits)
inlinestatic

Definition at line 226 of file UT_BitArray.h.

bool UT_BitArray::operator!= ( const UT_BitArray in_map) const
inline

Definition at line 115 of file UT_BitArray.h.

UT_BitArray& UT_BitArray::operator&= ( const UT_BitArray in_map)
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 in_map)
UT_BitArray& UT_BitArray::operator= ( const UT_BitArray in_map)
UT_BitArray& UT_BitArray::operator= ( UT_BitArray &&  src)
bool UT_BitArray::operator== ( const UT_BitArray in_map) 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 in_map)
UT_BitArray& UT_BitArray::operator|= ( const UT_BitArray in_map)
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 288 of file UT_BitArray.h.

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

Definition at line 342 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 311 of file UT_BitArray.h.

void UT_BitArray::toggleBitFast ( exint  index)
inline

Definition at line 351 of file UT_BitArray.h.

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

Definition at line 217 of file UT_BitArray.h.

void UT_BitArray::unsafeShareData ( BlockType bits,
exint  bit_count 
)
inline

Definition at line 210 of file UT_BitArray.h.

Friends And Related Function Documentation

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

Definition at line 260 of file UT_BitArray.h.


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