66 const char*
ClassName ()
const {
return "BitString";}
160 void CalcByteAndBitOffsets (
kkuint32 bitNum,
168 static uchar bitMasks [8];
169 static uchar bitMasksRev [8];
170 static uchar* bitCounts;
176 static void BuildBitCounts ();
kkuint32 Count() const
Returns number of bits set to '1'.
BitString & operator&=(const BitString &right)
Performs a bitwise AND against the left operand.
std::vector< kkuint32 > VectorUint32
Vector of unsigned 32 bit integers.
void ReSet(kkuint32 bitNum)
Set the bit indicated by 'bitNum' to '0'.
virtual BitString * Duplicate() const
static BitString FromHexStr(const KKStr &hexStr, bool &validHexStr)
Create a bit-string from a Hex String.
void Set()
Set all bits to '1'.
virtual void ReadXML(XmlStream &s, XmlTagConstPtr tag, VolConstBool &cancelFlag, RunLog &log)
KKStr HexStr() const
Returns a Hex-String representation.
void ReSet()
Set all bits to '0'.
virtual void WriteXML(const KKStr &varName, std::ostream &o) const
bool operator!=(const BitString &right) const
void PopulateVectorBool(VectorBool &boolVector) const
Populates a boolean vector where each element reflects whether the corresponding bit is set...
BitString & operator^=(const BitString &right)
Performs a bitwise XOR against the left operand.
unsigned __int16 kkuint16
16 bit unsigned integer.
bool operator>(const BitString &right) const
BitString & operator|=(const BitString &right)
Performs a bitwise OR against the left operand.
XmlElementTemplate< BitString > XmlElementBitString
BitString operator^(const BitString &right)
Performs a bitwise XOR between two operands returning a new BitString.
BitString & operator+=(const BitString &right)
Performs a bitwise OR against the left operand.
bool operator<=(const BitString &right) const
bool Test(kkuint32 bitNum) const
unsigned __int32 kkuint32
std::vector< bool > VectorBool
bool operator==(const BitString &right) const
Allows you to manage very long bit strings.
BitString(const BitString &b)
Copy constructor.
kkuint32 BitLen() const
Returns the length of the bit-string.
Manages the reading and writing of objects in a simple XML format. For a class to be supported by Xml...
BitString & operator=(const BitString &right)
unsigned char uchar
Unsigned character.
static KKStr Concat(const std::vector< std::string > &values)
Concatenates the list of 'std::string' strings.
Base class of all other classes that are meant to be managed by 'KKBase'.
void ListOfSetBits16(VectorUint16 &setBits) const
void Set(kkuint32 bitNum)
Set the bit indicated by 'bitNum' to '1'.
BitString()
Instantiates a empty bit-string of length 0; needed for ReadXML.
BitString & operator*=(const BitString &right)
Performs a bitwise AND against the left operand.
BitString(kkuint32 _bitLen, kkuint16 *_bitNums, kkuint32 _bitNumsLen)
Construct a BitString of length _bitLen with bits indicated by '_bitNums' set to '1'.
bool operator<(const BitString &right) const
Used for logging messages.
BitString(kkuint32 _bitLen)
Construct a bit string of length _binLen with all bits set to '0'.
std::vector< kkuint16 > VectorUint16
Vector of unsigned 16 bit integers.
const char * ClassName() const
void ListOfSetBits32(VectorUint32 &setBits) const
bool operator>=(const BitString &right) const
volatile const bool VolConstBool