ROSE 0.11.145.147
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Sawyer::Container::BitVector Class Reference

Description

Bit vectors.

This class implements bit vectors with run-time sizes and a rich set of operations that can be restricted to a contiguous subset of bits. The primary goal of this class is not to provide the utmost performance, but rather a rich, easy-to-use interface. For example,

BitVector bv(128); // a 128-bit vector with all bits cleared
bv.set(BitRange(6,27)); // set (make true) bits 6 through 27, inclusive
bv.fromHex(BitRange::baseSize(32,64), "deadbeef"); // initialize 64 bits beginning at bit 32
bool carry = bv.add(BitRange(5,8), BitRange(5,8)); // double the integer represented by bits 5 through 8
std::cout <<bv.toBinary(BitRange(5,8)) <<"\n"; // print bits 5-8 as a binary string
BitVectorSupport::BitRange BitRange
Describes an inclusive interval of bit indices.
Definition BitVector.h:72
static Interval baseSize(size_t lo, size_t size)
Construct an interval from one endpoint and a size.
Definition Interval.h:173

In general, each method has a number of overloaded varieties: if a BitRange is not specified it generally means the entire bit vector; if a second bit vector is not specified for binary operations it generally means use this vector for both operands. Non-const operations modify this vector in place, and most of them also return a reference so that they can be easily chained:

bv.clear().set(BitRange(24,31)); // clear all bits, then set bits 24-31

When performing an operation that has two operands, the operands are generally permitted to both refer to the same vector, and the range arguments are permitted to overlap in that vector. When this occurs, the semantics are as if a temporary copy was made, then the operation was performed on the temporary copy, then the result was written back to the destination.

BitVector objects manage their own data, but if one needs to operate on an array that is already allocated then the function templates in the BitVectorSupport name space can be used.

Definition at line 69 of file BitVector.h.

#include <Sawyer/BitVector.h>

Public Types

typedef unsigned Word
 Base storage type.
 
typedef BitVectorSupport::BitRange BitRange
 Describes an inclusive interval of bit indices.
 

Public Member Functions

 BitVector ()
 Default construct an empty vector.
 
 BitVector (const BitVector &other)
 Copy constructor.
 
 BitVector (size_t nbits, bool newBits=false)
 Create a vector of specified size.
 
BitVectoroperator= (const BitVector &other)
 Assignment.
 
bool isEmpty () const
 Determines if the vector is empty.
 
size_t size () const
 Size of vector in bits.
 
BitVectorresize (size_t newSize, bool newBits=false)
 Change vector size.
 
size_t capacity () const
 Maximum size before reallocation.
 
BitRange hull () const
 Interval representing the entire vector.
 
bool get (size_t idx) const
 Retrieve one bit.
 
BitVectorclear (const BitRange &range)
 Assign zero to some bits.
 
BitVectorclear ()
 Assign zero to all bits.
 
BitVectorset (const BitRange &range)
 Assign true to some bits.
 
BitVectorset ()
 Assign true to all bits.
 
BitVectorsetValue (const BitRange &range, bool value)
 Assign true/false to some bits.
 
BitVectorsetValue (bool value)
 Assign true/false to all bits.
 
BitVectorcopy (const BitRange &to, const BitVector &other, const BitRange &from)
 Copy some bits.
 
BitVectorcopy (const BitRange &to, const BitRange &from)
 Copy some bits.
 
BitVectorswap (const BitRange &range1, BitVector &other, const BitRange &range2)
 Swap some bits.
 
BitVectorswap (const BitRange &range1, const BitRange &range2)
 Swap some bits.
 
bool equalTo (const BitRange &range1, BitVector &other, const BitRange &range2) const
 Checks whether two ranges are equal.
 
bool equalTo (const BitRange &range1, const BitRange &range2) const
 Checks whether the bits of two ranges are equal.
 
bool equalTo (const BitVector &other) const
 Checks whether the bits of one vector are equal to the bits of the other.
 
Optional< size_t > leastSignificantSetBit (const BitRange &range) const
 Find the least significant set bit.
 
Optional< size_t > leastSignificantSetBit () const
 Find the least significant set bit.
 
Optional< size_t > leastSignificantClearBit (const BitRange &range) const
 Find the least significant clear bit.
 
Optional< size_t > leastSignificantClearBit () const
 Find the least significant clear bit.
 
Optional< size_t > mostSignificantSetBit (const BitRange &range) const
 Find the most significant set bit.
 
Optional< size_t > mostSignificantSetBit () const
 Find the most significant set bit.
 
Optional< size_t > mostSignificantClearBit (const BitRange &range) const
 Find the most significant clear bit.
 
Optional< size_t > mostSignificantClearBit () const
 Find the most significant clear bit.
 
bool isAllSet (const BitRange &range) const
 True if all bits are set.
 
bool isAllSet () const
 True if all bits are set.
 
bool isAllClear (const BitRange &range) const
 True if all bits are clear.
 
bool isAllClear () const
 True if all bits are clear.
 
size_t nSet (const BitRange &range) const
 Number of set bits.
 
size_t nSet () const
 Number of set bits.
 
size_t nClear (const BitRange &range) const
 Number of clear bits.
 
size_t nClear () const
 Number of clear bits.
 
Optional< size_t > mostSignificantDifference (const BitRange &range1, const BitVector &other, const BitRange &range2) const
 Find most significant difference.
 
Optional< size_t > mostSignificantDifference (const BitRange &range1, const BitRange &range2) const
 Find most significant difference.
 
Optional< size_t > mostSignificantDifference (const BitVector &other) const
 Find most significant difference.
 
Optional< size_t > leastSignificantDifference (const BitRange &range1, const BitVector &other, const BitRange &range2) const
 Find least significant difference.
 
Optional< size_t > leastSignificantDifference (const BitRange &range1, const BitRange &range2) const
 Find least significant difference.
 
Optional< size_t > leastSignificantDifference (const BitVector &other) const
 Find least significant difference.
 
BitVectorshiftLeft (const BitRange &range, size_t nShift, bool newBits=0)
 Shift bits left.
 
BitVectorshiftLeft (size_t nShift, bool newBits=0)
 Shift bits left.
 
BitVectorshiftRight (const BitRange &range, size_t nShift, bool newBits=0)
 Shift bits right.
 
BitVectorshiftRight (size_t nShift, bool newBits=0)
 Shift bits right.
 
BitVectorshiftRightArithmetic (const BitRange &range, size_t nShift)
 Shift bits right.
 
BitVectorshiftRightArithmetic (size_t nShift)
 Shift bits right.
 
BitVectorrotateRight (const BitRange &range, size_t nShift)
 Rotate bits right.
 
BitVectorrotateRight (size_t nShift)
 Rotate bits right.
 
BitVectorrotateLeft (const BitRange &range, size_t nShift)
 Rotate bits left.
 
BitVectorrotateLeft (size_t nShift)
 Rotate bits left.
 
BitVectornegate (const BitRange &range1)
 Negates bits as integer.
 
BitVectornegate ()
 Negates bits as integer.
 
bool increment (const BitRange &range1)
 Increment bits as integer.
 
bool increment ()
 Increment bits as integer.
 
bool decrement (const BitRange &range1)
 Decrement bits as integer.
 
bool decrement ()
 Decrement bits as integer.
 
bool add (const BitRange &range1, const BitVector &other, const BitRange &range2)
 Add bits as integers.
 
bool add (const BitRange &range1, const BitRange &range2)
 Add bits as integers.
 
bool add (const BitVector &other)
 Add bits as integers.
 
bool subtract (const BitRange &range1, const BitVector &other, const BitRange &range2)
 Subtract bits as integers.
 
bool subtract (const BitRange &range1, const BitRange &range2)
 Subtract bits as integers.
 
bool subtract (const BitVector &other)
 Subtract bits as integers.
 
BitVectorsignExtend (const BitRange &range1, const BitVector &other, const BitRange &range2)
 Copy bits and sign extend.
 
BitVectorsignExtend (const BitRange &range1, const BitRange &range2)
 Copy bits and sign extend.
 
BitVectorsignExtend (const BitVector &other)
 Copy bits and sign extend.
 
BitVectormultiply10 ()
 Multiply by 10.
 
BitVectormultiply10 (const BitRange &range)
 Multiply by 10.
 
BitVector multiply (const BitVector &other) const
 Multiply two bit vectors.
 
BitVector multiplySigned (const BitVector &other) const
 Multiply two signed integers.
 
BitVectorinvert (const BitRange &range)
 Invert bits.
 
BitVectorinvert ()
 Invert bits.
 
BitVectorbitwiseAnd (const BitRange &range1, const BitVector &other, const BitRange &range2)
 Bit-wise AND.
 
BitVectorbitwiseAnd (const BitRange &range1, const BitRange &range2)
 Bit-wise AND.
 
BitVectorbitwiseAnd (const BitVector &other)
 Bit-wise AND.
 
BitVectorbitwiseOr (const BitRange &range1, const BitVector &other, const BitRange &range2)
 Bit-wise OR.
 
BitVectorbitwiseOr (const BitRange &range1, const BitRange &range2)
 Bit-wise OR.
 
BitVectorbitwiseOr (const BitVector &other)
 Bit-wise OR.
 
BitVectorbitwiseXor (const BitRange &range1, const BitVector &other, const BitRange &range2)
 Bit-wise XOR.
 
BitVectorbitwiseXor (const BitRange &range1, const BitRange &range2)
 Bit-wise XOR.
 
BitVectorbitwiseXor (const BitVector &other)
 Bit-wise XOR.
 
bool isEqualToZero (const BitRange &range) const
 Compare to zero.
 
bool isEqualToZero () const
 Compare to zero.
 
int compare (const BitRange &range1, const BitVector &other, const BitRange &range2) const
 Compare bits as integers.
 
int compare (const BitRange &range1, const BitRange &range2) const
 Compare bits as integers.
 
int compare (const BitVector &other) const
 Compare bits as integers.
 
int compareSigned (const BitRange &range1, const BitVector &other, const BitRange &range2) const
 Compare bits as signed integers.
 
int compareSigned (const BitRange &range1, const BitRange &range2) const
 Compare bits as signed integers.
 
int compareSigned (const BitVector &other) const
 Compare bits as signed integers.
 
boost::uint64_t toInteger (const BitRange &range) const
 Interpret bits as an unsigned integer.
 
boost::uint64_t toInteger () const
 Interpret bits as an unsigned integer.
 
boost::int64_t toSignedInteger (const BitRange &range) const
 Interpret bits as a signed integer.
 
boost::int64_t toSignedInteger () const
 Interpret bits as a signed integer.
 
std::string toHex (const BitRange &range) const
 Convert to a hexadecimal string.
 
std::string toHex () const
 Convert to a hexadecimal string.
 
std::string toOctal (const BitRange &range) const
 Convert to an octal string.
 
std::string toOctal () const
 Convert to an octal string.
 
std::string toBinary (const BitRange &range) const
 Convert to a binary string.
 
std::string toBinary () const
 Convert to an binary string.
 
BitVectorfromInteger (const BitRange &range, boost::uint64_t value)
 Obtain bits from an integer.
 
BitVectorfromInteger (boost::uint64_t value)
 Obtain bits from an integer.
 
BitVectorfromDecimal (const BitRange &range, const std::string &input)
 Obtains bits from a decimal representation.
 
BitVectorfromDecimal (const std::string &input)
 Obtain bits from a decimal representation.
 
BitVectorfromHex (const BitRange &range, const std::string &input)
 Obtain bits from a hexadecimal representation.
 
BitVectorfromHex (const std::string &input)
 Obtain bits from a hexadecimal representation.
 
BitVectorfromOctal (const BitRange &range, const std::string &input)
 Obtain bits from an octal representation.
 
BitVectorfromOctal (const std::string &input)
 Obtain bits from an octal representation.
 
BitVectorfromBinary (const BitRange &range, const std::string &input)
 Obtain bits from a binary representation.
 
BitVectorfromBinary (const std::string &input)
 Obtain bits from a binary representation.
 
void checkRange (const BitRange &range) const
 Assert valid range.
 
size_t dataSize () const
 Raw data size.
 
std::vector< uint8_t > toBytes () const
 Convert to a vector of bytes.
 
std::vector< uint8_t > toBytes (const BitRange &range) const
 Convert to a vector of bytes.
 
BitVectorfromBytes (const std::vector< uint8_t > &input)
 Obtain bits from a byte vector.
 
BitVectorfromBytes (const BitRange &range, const std::vector< uint8_t > &input)
 Obtain bits from a byte vector.
 
Worddata ()
 Raw data for vector.
 
const Worddata () const
 Raw data for vector.
 

Static Public Member Functions

static BitVector parse (std::string str)
 Create a bit vector by reading a string.
 
static BitRange baseSize (size_t base, size_t size)
 Create a bit range from a starting offset and size.
 
static BitRange hull (size_t minOffset, size_t maxOffset)
 Create a bit range from min and max positions.
 

Member Typedef Documentation

◆ Word

Base storage type.

Definition at line 71 of file BitVector.h.

◆ BitRange

Describes an inclusive interval of bit indices.

Definition at line 72 of file BitVector.h.

Constructor & Destructor Documentation

◆ BitVector() [1/3]

Sawyer::Container::BitVector::BitVector ( )
inline

Default construct an empty vector.

Definition at line 102 of file BitVector.h.

◆ BitVector() [2/3]

Sawyer::Container::BitVector::BitVector ( const BitVector other)
inline

Copy constructor.

Definition at line 105 of file BitVector.h.

◆ BitVector() [3/3]

Sawyer::Container::BitVector::BitVector ( size_t  nbits,
bool  newBits = false 
)
inlineexplicit

Create a vector of specified size.

All bits in this vector will be set to the newBits value.

Definition at line 110 of file BitVector.h.

References resize().

Member Function Documentation

◆ parse()

static BitVector Sawyer::Container::BitVector::parse ( std::string  str)
inlinestatic

Create a bit vector by reading a string.

Reads a bit vector from the string and returns the result. The input string has an optional suffix ("h" for hexadecimal) or optioanl prefix ("0x" for hexadecimal, "0b" or binary, or "0" for octal). It does not have both; if a suffix is present then the parser does not search for a prefix. Lack of both prefix and suffix implies decimal format. Any recognized suffix or prefix is stripped from the value, and the number of valid digits is counted and used to calculate the width of the resulting bit vector. For instance, if three octal digits are found (not counting the "0" prefix) then the resulting bit vector will have nine bits – three per digit. The string is then passed to fromBinary, fromOctal, fromDecimal, or fromHex for parsing.

Definition at line 125 of file BitVector.h.

References fromBinary(), fromDecimal(), fromHex(), and fromOctal().

◆ operator=()

BitVector & Sawyer::Container::BitVector::operator= ( const BitVector other)
inline

Assignment.

Makes this bit vector an exact copy of the other vector.

See also
The copy method is similar but does not change the size of the destination vector.

Definition at line 194 of file BitVector.h.

◆ isEmpty()

bool Sawyer::Container::BitVector::isEmpty ( ) const
inline

Determines if the vector is empty.

Returns true if this vector contains no data.

Definition at line 203 of file BitVector.h.

Referenced by Rose::BinaryAnalysis::SymbolicExpression::Leaf::isConstant().

◆ size()

size_t Sawyer::Container::BitVector::size ( ) const
inline

Size of vector in bits.

Returns the size of this vector in bits.

Definition at line 208 of file BitVector.h.

Referenced by Rose::BinaryAnalysis::SymbolicExpressionParser::Token::Token(), baseSize(), equalTo(), multiply(), multiplySigned(), toInteger(), and toSignedInteger().

◆ resize()

BitVector & Sawyer::Container::BitVector::resize ( size_t  newSize,
bool  newBits = false 
)
inline

Change vector size.

Changes the size of a vector, measured in bits, by either adding or removing bits from the most-significant side of this vector. If new bits are added they are each given the value newBits. Increasing the size of a vector may cause it to reallocate and copy its internal data structures.

Definition at line 215 of file BitVector.h.

References clear(), data(), Sawyer::Container::Interval< size_t >::hull(), and Sawyer::Container::BitVectorSupport::setValue().

Referenced by BitVector(), multiply(), and multiplySigned().

◆ capacity()

size_t Sawyer::Container::BitVector::capacity ( ) const
inline

Maximum size before reallocation.

Returns the maximum number of bits to which this vector could be resized via resize before it becomes necessary to reallocate its internal data structures.

Definition at line 236 of file BitVector.h.

◆ hull() [1/2]

BitRange Sawyer::Container::BitVector::hull ( ) const
inline

◆ baseSize()

static BitRange Sawyer::Container::BitVector::baseSize ( size_t  base,
size_t  size 
)
inlinestatic

Create a bit range from a starting offset and size.

This is just a convenience wrapper around BitRange::baseSize() so that name qualification can be avoided when "using namespace" directives are not employed.

Definition at line 251 of file BitVector.h.

References Sawyer::Container::Interval< size_t >::baseSize(), and size().

◆ hull() [2/2]

static BitRange Sawyer::Container::BitVector::hull ( size_t  minOffset,
size_t  maxOffset 
)
inlinestatic

Create a bit range from min and max positions.

This is just a convenience wrapper around BitRange::hull(size_t,size_t) so that name qualification can be avoided when "using namespace" directives are not employed.

Definition at line 259 of file BitVector.h.

References Sawyer::Container::Interval< size_t >::hull().

◆ get()

bool Sawyer::Container::BitVector::get ( size_t  idx) const
inline

Retrieve one bit.

Returns the value of the bit at the specified index in constant time. The index must be a valid index for this vector.

Definition at line 271 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::get().

Referenced by Sawyer::Container::Algorithm::GraphTraversal< G, Order, Direction >::isDiscovered(), Sawyer::Container::Algorithm::GraphTraversal< G, Order, Direction >::isVisited(), multiply(), and multiplySigned().

◆ clear() [1/2]

BitVector & Sawyer::Container::BitVector::clear ( const BitRange range)
inline

Assign zero to some bits.

Clears bits by assigning false to each bit in the specified range. The convention is that "clear" means to assign false to a bit and should not be confused with the STL usage of the word, namely to erase all values from a container. To erase all bits from a vector, use resize(0).

Definition at line 281 of file BitVector.h.

References checkRange(), Sawyer::Container::BitVectorSupport::clear(), and data().

Referenced by resize().

◆ clear() [2/2]

BitVector & Sawyer::Container::BitVector::clear ( )
inline

Assign zero to all bits.

Clears bits by assigning false to all bits in this vector. The convention is that "clear" means to assign false to to a bit and should not be confused with the STL usage of the word, namely to erase all values from a container. To erase all bits from a vector, use resize(0).

Definition at line 292 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::clear(), data(), and hull().

◆ set() [1/2]

BitVector & Sawyer::Container::BitVector::set ( const BitRange range)
inline

Assign true to some bits.

Sets bits by assigning true (or newBits) to each bit in the specified range. The convention is that "set" means to assign true to a bit; to assign a specific value use setValue.

Definition at line 301 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::set().

◆ set() [2/2]

BitVector & Sawyer::Container::BitVector::set ( )
inline

Assign true to all bits.

Sets bits by assigning true (or newBits) to all bits in this vector. The convention is that "set" means to assign true to a bit; to assign a specific value use setValue.

Definition at line 311 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::set().

◆ setValue() [1/2]

BitVector & Sawyer::Container::BitVector::setValue ( const BitRange range,
bool  value 
)
inline

Assign true/false to some bits.

Sets the bits in the specified range to the specified value.

Definition at line 319 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::setValue().

◆ setValue() [2/2]

BitVector & Sawyer::Container::BitVector::setValue ( bool  value)
inline

Assign true/false to all bits.

Sets all bits to the specified value.

Definition at line 328 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::setValue().

◆ copy() [1/2]

BitVector & Sawyer::Container::BitVector::copy ( const BitRange to,
const BitVector other,
const BitRange from 
)
inline

Copy some bits.

Copies bits from other specified by from into this vector specified by to. The ranges must be the same size and must be valid for their respective vectors. The other vector is permitted to be the same vector as this, in which case from is also permitted to overlap with to.

See also
Copy constructor and assignment operator.

Definition at line 340 of file BitVector.h.

References checkRange(), Sawyer::Container::BitVectorSupport::copy(), and data().

◆ copy() [2/2]

BitVector & Sawyer::Container::BitVector::copy ( const BitRange to,
const BitRange from 
)
inline

Copy some bits.

Copies bits from the range from to the range to. Both ranges must be the same size, and they may overlap.

See also
Copy constructor and assignment operator.

Definition at line 352 of file BitVector.h.

References checkRange(), Sawyer::Container::BitVectorSupport::copy(), and data().

◆ swap() [1/2]

BitVector & Sawyer::Container::BitVector::swap ( const BitRange range1,
BitVector other,
const BitRange range2 
)
inline

Swap some bits.

Swaps bits between range1 of this vector and range2 of the other vector. Both ranges must be the same size and must be valid for their respective vectors. The other vector is permitted to be the same vector as this, but range1 and range2 are not permitted to overlap.

Definition at line 364 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::swap().

◆ swap() [2/2]

BitVector & Sawyer::Container::BitVector::swap ( const BitRange range1,
const BitRange range2 
)
inline

Swap some bits.

Swaps bits between range1 and range2 of this vector. Both ranges must be the same size, and must be valid for this vector, and must not overlap.

Definition at line 375 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::swap().

◆ equalTo() [1/3]

bool Sawyer::Container::BitVector::equalTo ( const BitRange range1,
BitVector other,
const BitRange range2 
) const
inline

Checks whether two ranges are equal.

Returns true if the bits of the first range are equal to the bits in the second range.

Definition at line 385 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::equalTo().

◆ equalTo() [2/3]

bool Sawyer::Container::BitVector::equalTo ( const BitRange range1,
const BitRange range2 
) const
inline

Checks whether the bits of two ranges are equal.

Returns true if the bits contained in the first range match the bits contained in the second range. If the ranges are different sizes then returns false.

Definition at line 395 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::equalTo().

◆ equalTo() [3/3]

bool Sawyer::Container::BitVector::equalTo ( const BitVector other) const
inline

Checks whether the bits of one vector are equal to the bits of the other.

If the vectors are different sizes then they are considered to be unequal regardless of their content. See also, compare.

Definition at line 405 of file BitVector.h.

References data(), Sawyer::Container::BitVectorSupport::equalTo(), hull(), and size().

◆ leastSignificantSetBit() [1/2]

Optional< size_t > Sawyer::Container::BitVector::leastSignificantSetBit ( const BitRange range) const
inline

Find the least significant set bit.

Returns the index for the least significant bit that has the value true in the specified range. The range must be valid for this vector. If the range has no such bits, including the case when the range is empty, then nothing is returned.

Definition at line 420 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::leastSignificantSetBit().

◆ leastSignificantSetBit() [2/2]

Optional< size_t > Sawyer::Container::BitVector::leastSignificantSetBit ( ) const
inline

Find the least significant set bit.

Returns the index for the least significant bit that has the value true. If no bit is true, including the case when the vector is empty, then nothing is returned.

Definition at line 429 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::leastSignificantSetBit().

◆ leastSignificantClearBit() [1/2]

Optional< size_t > Sawyer::Container::BitVector::leastSignificantClearBit ( const BitRange range) const
inline

Find the least significant clear bit.

Returns the index for the least significant bit that has the value false in the specified range. The range must be valid for this vector. If the range has no such bits, including the case when the range is empty, then nothing is returned.

Definition at line 438 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::leastSignificantClearBit().

◆ leastSignificantClearBit() [2/2]

Optional< size_t > Sawyer::Container::BitVector::leastSignificantClearBit ( ) const
inline

Find the least significant clear bit.

Returns the index for the least significant bit that has the value false. If no bit is false, including the case when the vector is empty, then nothing is returned.

Definition at line 447 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::leastSignificantClearBit().

◆ mostSignificantSetBit() [1/2]

Optional< size_t > Sawyer::Container::BitVector::mostSignificantSetBit ( const BitRange range) const
inline

Find the most significant set bit.

Returns the index for the most significant bit that has the value true in the specified range. The range must be valid for this vector. If the range has no such bits, including the case when the range is empty, then nothing is returned.

Definition at line 456 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::mostSignificantSetBit().

◆ mostSignificantSetBit() [2/2]

Optional< size_t > Sawyer::Container::BitVector::mostSignificantSetBit ( ) const
inline

Find the most significant set bit.

Returns the index for the most significant bit that has the value true. If no bit is true, including the case when the vector is empty, then nothing is returned.

Definition at line 465 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::mostSignificantSetBit().

◆ mostSignificantClearBit() [1/2]

Optional< size_t > Sawyer::Container::BitVector::mostSignificantClearBit ( const BitRange range) const
inline

Find the most significant clear bit.

Returns the index for the most significant bit that has the value false in the specified range. The range must be valid for this vector. If the range has no such bits, including the case when the range is empty, then nothing is returned.

Definition at line 474 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::mostSignificantClearBit().

◆ mostSignificantClearBit() [2/2]

Optional< size_t > Sawyer::Container::BitVector::mostSignificantClearBit ( ) const
inline

Find the most significant clear bit.

Returns the index for the most significant bit that has the value false. If no bit is false, including the case when the vector is empty, then nothing is returned.

Definition at line 483 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::mostSignificantClearBit().

◆ isAllSet() [1/2]

bool Sawyer::Container::BitVector::isAllSet ( const BitRange range) const
inline

True if all bits are set.

Returns true if all bits are set within the specified range, or if the range is empty. The range must be valid for this vector.

Definition at line 491 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::isAllSet().

◆ isAllSet() [2/2]

bool Sawyer::Container::BitVector::isAllSet ( ) const
inline

True if all bits are set.

Returns true if all bits are set, or if the vector is empty.

Definition at line 499 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::isAllSet().

◆ isAllClear() [1/2]

bool Sawyer::Container::BitVector::isAllClear ( const BitRange range) const
inline

True if all bits are clear.

Returns true if all bits are clear within the specified range, or if the range is empty. The range must be valid for this vector.

See also
isEqualToZero

Definition at line 509 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::isAllClear().

◆ isAllClear() [2/2]

bool Sawyer::Container::BitVector::isAllClear ( ) const
inline

True if all bits are clear.

Returns true if all bits are clear, or if the vector is empty.

See also
isEqualToZero

Definition at line 519 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::isAllClear().

◆ nSet() [1/2]

size_t Sawyer::Container::BitVector::nSet ( const BitRange range) const
inline

Number of set bits.

Returns the number of bits that are set in the specified range. The range must be valid for this vector.

Definition at line 526 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::nSet().

◆ nSet() [2/2]

size_t Sawyer::Container::BitVector::nSet ( ) const
inline

Number of set bits.

Returns the number of bits that are set.

Definition at line 534 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::nSet().

◆ nClear() [1/2]

size_t Sawyer::Container::BitVector::nClear ( const BitRange range) const
inline

Number of clear bits.

Returns the number of bits that are clear in the specified range. The range must be valid for this vector.

Definition at line 541 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::nClear().

◆ nClear() [2/2]

size_t Sawyer::Container::BitVector::nClear ( ) const
inline

Number of clear bits.

Returns the number of bits that are clear.

Definition at line 549 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::nClear().

◆ mostSignificantDifference() [1/3]

Optional< size_t > Sawyer::Container::BitVector::mostSignificantDifference ( const BitRange range1,
const BitVector other,
const BitRange range2 
) const
inline

Find most significant difference.

Finds the most significant bit that differs between range1 of this vector and range2 of the other vector and returns its offset from the beginning of the ranges. Both ranges must be the same size and must be valid for their respective vectors. If no bits differ, including the case when both ranges are empty, then nothing is returned. The other vector is permitted to be the same as this vector, in which case the ranges are also permitted to overlap.

Note that the return value is not a vector index, but rather an offset with respect to the starting index in each of the ranges.

Definition at line 563 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::mostSignificantDifference().

◆ mostSignificantDifference() [2/3]

Optional< size_t > Sawyer::Container::BitVector::mostSignificantDifference ( const BitRange range1,
const BitRange range2 
) const
inline

Find most significant difference.

Finds the most significant bit that differs between the two specified ranges of this vector and returns its offset from the beginning of the ranges. Both ranges must be the same size and must be valid for this vector. If no bits differ, including the case when both ranges are empty, then nothing is returned. The ranges are permitted to overlap.

Note that the return value is not a vector index, but rather an offset with respect to the starting index in each of the ranges.

Definition at line 578 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::mostSignificantDifference().

◆ mostSignificantDifference() [3/3]

Optional< size_t > Sawyer::Container::BitVector::mostSignificantDifference ( const BitVector other) const
inline

Find most significant difference.

Finds the most significant bit that differs between this vector and the other vector and return its index. Both vectors must be the same size. If no bits differ, including the case when this vector is empty, then nothing is returned.

Definition at line 589 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::mostSignificantDifference().

◆ leastSignificantDifference() [1/3]

Optional< size_t > Sawyer::Container::BitVector::leastSignificantDifference ( const BitRange range1,
const BitVector other,
const BitRange range2 
) const
inline

Find least significant difference.

Finds the least significant bit that differs between range1 of this vector and range2 of the other vector and returns its offset from the beginning of the ranges. Both ranges must be the same size and must be valid for their respective vectors. If no bits differ, including the case when both ranges are empty, then nothing is returned. The other vector is permitted to be the same as this vector, in which case the ranges are also permitted to overlap.

Note that the return value is not a vector index, but rather an offset with respect to the starting index in each of the ranges.

Definition at line 603 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::leastSignificantDifference().

◆ leastSignificantDifference() [2/3]

Optional< size_t > Sawyer::Container::BitVector::leastSignificantDifference ( const BitRange range1,
const BitRange range2 
) const
inline

Find least significant difference.

Finds the least significant bit that differs between the two specified ranges of this vector and returns its offset from the beginning of the ranges. Both ranges must be the same size and must be valid for this vector. If no bits differ, including the case when both ranges are empty, then nothing is returned. The ranges are permitted to overlap.

Note that the return value is not a vector index, but rather an offset with respect to the starting index in each of the ranges.

Definition at line 618 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::leastSignificantDifference().

◆ leastSignificantDifference() [3/3]

Optional< size_t > Sawyer::Container::BitVector::leastSignificantDifference ( const BitVector other) const
inline

Find least significant difference.

Finds the least significant bit that differs between this vector and the other vector and return its index. Both vectors must be the same size. If no bits differ, including the case when this vector is empty, then nothing is returned.

Definition at line 629 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::leastSignificantDifference().

◆ shiftLeft() [1/2]

BitVector & Sawyer::Container::BitVector::shiftLeft ( const BitRange range,
size_t  nShift,
bool  newBits = 0 
)
inline

Shift bits left.

Shifts the bits in the specified range of this vector left (to more significant positions) by nShift bits. Bits shifted off the left of the range are discarded; new bits shifted into the right of the range are introduced with the value newBits. The range must be valid for this vector. If nShift is zero or the range is empty then no operation is performed. Specifying an nShift value equal to or greater than the size of the range has the same effect as filling the range with newBits (see also, set and clear, which are probably more efficient).

Definition at line 644 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::shiftLeft().

Referenced by multiply(), and multiplySigned().

◆ shiftLeft() [2/2]

BitVector & Sawyer::Container::BitVector::shiftLeft ( size_t  nShift,
bool  newBits = 0 
)
inline

Shift bits left.

Shifts all bits of this vector left (to more significant positions) by nShift bits. Bits shifted off the left of this vector are discarded; new bits shifted into the right of this vector are introduced with the value newBits. If nShift is zero or the vector is empty then no operation is performed. Specifying an nShift value equal to or greater than the size of this vector has the same effect as filling the vector with newBits (see also, set and clear, which are probably more efficient).

Definition at line 657 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::shiftLeft().

◆ shiftRight() [1/2]

BitVector & Sawyer::Container::BitVector::shiftRight ( const BitRange range,
size_t  nShift,
bool  newBits = 0 
)
inline

Shift bits right.

Shifts the bits in the specified range of this vector right (to less significant positions) by nShift bits. Bits shifted off the right of the range are discarded; new bits shifted into the left of the range are introduced with the value newBits. The range must be valid for this vector. If nShift is zero or the range is empty then no operation is performed. Specifying an nShift value equal to or greater than the size of the range has the same effect as filling the range with newBits (see also, set and clear, which are probably more efficient).

Definition at line 669 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::shiftRight().

◆ shiftRight() [2/2]

BitVector & Sawyer::Container::BitVector::shiftRight ( size_t  nShift,
bool  newBits = 0 
)
inline

Shift bits right.

Shifts all bits of this vector right (to less significant positions) by nShift bits. Bits shifted off the right of this vector are discarded; new bits shifted into the left of this vector are introduced with the value newBits. If nShift is zero or the vector is empty then no operation is performed. Specifying an nShift value equal to or greater than the size of this vector has the same effect as filling the vector with newBits (see also, set and clear, which are probably more efficient).

Definition at line 682 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::shiftRight().

◆ shiftRightArithmetic() [1/2]

BitVector & Sawyer::Container::BitVector::shiftRightArithmetic ( const BitRange range,
size_t  nShift 
)
inline

Shift bits right.

Shifts the bits in the specified range of this vector right (to less significant positions) by nShift bits. Bits shifted off the right of the range are discarded; new bits shifted into the left of the range are introduced with the same value as the original most-significant bit of the range. The range must be valid for this vector. If nShift is zero or the range is empty or a singleton then no operation is performed. Specifying an nShift value equal to or greater than the size of the range has the same effect as filling the range with its original most-significant bit (see also, set and clear, which are probably more efficient).

Definition at line 695 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::shiftRightArithmetic().

◆ shiftRightArithmetic() [2/2]

BitVector & Sawyer::Container::BitVector::shiftRightArithmetic ( size_t  nShift)
inline

Shift bits right.

Shifts the bits in this vector right (to less significant positions) by nShift bits. Bits shifted off the right of this vector are discarded; new bits shifted into the left of this vector are introduced with the same value as the original most-significant bit of this vector. If nShift is zero or the vector is empty or only a single bit then no operation is performed. Specifying an nShift value equal to or greater than the size of this vector has the same effect as filling the vector with its original most-significant bit (see also, set and clear, which are probably more efficient).

Definition at line 709 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::shiftRightArithmetic().

◆ rotateRight() [1/2]

BitVector & Sawyer::Container::BitVector::rotateRight ( const BitRange range,
size_t  nShift 
)
inline

Rotate bits right.

Rotates the bits in the specified range to the right (to less significant positions) by shifting right and reintroducing the bits shifted off the right end into the left end. The range must be valid for this vector. If nShift is zero modulo the range size, or the range is empty, then no operation is performed.

Definition at line 719 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::rotateRight().

◆ rotateRight() [2/2]

BitVector & Sawyer::Container::BitVector::rotateRight ( size_t  nShift)
inline

Rotate bits right.

Rotates all bits in this vector to the right (to less significant positions) by shifting right and reintroducing the bits shifted off the right end into the left end. If nShift is zero modulo this vector size, or this vector is empty, then no operation is performed.

Definition at line 730 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::rotateRight().

◆ rotateLeft() [1/2]

BitVector & Sawyer::Container::BitVector::rotateLeft ( const BitRange range,
size_t  nShift 
)
inline

Rotate bits left.

Rotates the bits in the specified range to the left (to more significant positions) by shifting left and reintroducing the bits shifted off the left end into the right end. The range must be valid for this vector. If nShift is zero modulo the range size, or the range is empty, then no operation is performed.

Definition at line 740 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::rotateLeft().

◆ rotateLeft() [2/2]

BitVector & Sawyer::Container::BitVector::rotateLeft ( size_t  nShift)
inline

Rotate bits left.

Rotates all bits in this vector to the left (to more significant positions) by shifting left and reintroducing the bits shifted off the left end into the right end. If nShift is zero modulo this vector size, or this vector is empty, then no operation is performed.

Definition at line 751 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::rotateLeft().

◆ negate() [1/2]

BitVector & Sawyer::Container::BitVector::negate ( const BitRange range1)
inline

Negates bits as integer.

Treats range1 of this vector as a two's complement integer and negates it, storing the result back into the same range of bits. The range must be valid for this vector.

Definition at line 764 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::negate().

Referenced by multiplySigned().

◆ negate() [2/2]

BitVector & Sawyer::Container::BitVector::negate ( )
inline

Negates bits as integer.

Treats all bits of this vector as a two's complement integer and negates it, storing the result back into this vector.

Definition at line 774 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::negate().

◆ increment() [1/2]

bool Sawyer::Container::BitVector::increment ( const BitRange range1)
inline

Increment bits as integer.

Treats range1 of this vector as an integer and adds one to it, storing the result back into this vector. The range must be valid for this vector. Returns true if all bits were originally set and the result is all clear (i.e., returns the carry-out value) .

Definition at line 784 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::increment().

◆ increment() [2/2]

bool Sawyer::Container::BitVector::increment ( )
inline

Increment bits as integer.

Treats the entire vector as an integer and adds one to it, storing the result back into the vector. Returns true if all bits were originally set and the result is all clear (i.e., returns the carry-out value).

Definition at line 793 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::increment().

◆ decrement() [1/2]

bool Sawyer::Container::BitVector::decrement ( const BitRange range1)
inline

Decrement bits as integer.

Treats range1 of this vector as an integer and subtracts one from it, storing the result back into this vector. The range must be valid for this vector. Returns true if all bits were originally clear and the result is all set (i.e., returns the overflow bit) .

Definition at line 802 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::decrement().

◆ decrement() [2/2]

bool Sawyer::Container::BitVector::decrement ( )
inline

Decrement bits as integer.

Treats the entire vector as an integer and subtracts one from it, storing the result back into the vector. Returns true if all bits were originally clear and the result is all set (i.e., returns the overflow bit).

Definition at line 811 of file BitVector.h.

References data(), Sawyer::Container::BitVectorSupport::decrement(), and hull().

◆ add() [1/3]

bool Sawyer::Container::BitVector::add ( const BitRange range1,
const BitVector other,
const BitRange range2 
)
inline

Add bits as integers.

Treats range1 of this vector and range2 of the other vector as integers, sums them, and stores the result in range1 of this vector. The ranges must be valid for their respective vectors, and both ranges must be the same size. The other vector is permitted to be the same vector as this, in which case the ranges are also permitted to overlap. Returns the final carry-out value which is not stored in the result.

Definition at line 821 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::add(), checkRange(), and data().

Referenced by multiply(), and multiplySigned().

◆ add() [2/3]

bool Sawyer::Container::BitVector::add ( const BitRange range1,
const BitRange range2 
)
inline

Add bits as integers.

Treats range1 and range2 of this vector as integers, sums them, and stores the result in range1. The ranges must be valid for this vector and both ranges must be the same size. The are permitted to overlap. Returns the final carry-out value which is not stored in the result.

Definition at line 832 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::add(), checkRange(), and data().

◆ add() [3/3]

bool Sawyer::Container::BitVector::add ( const BitVector other)
inline

Add bits as integers.

Treats this vector and the other vector as integers, sums them, and stores the result in this vector. Both vectors must be the same size. The other vector is permitted to be the same as this vector, in which case it numerically doubles the value (like a left shift by one bit). Returns the final carry-out value which is not stored in the result.

Definition at line 844 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::add(), data(), and hull().

◆ subtract() [1/3]

bool Sawyer::Container::BitVector::subtract ( const BitRange range1,
const BitVector other,
const BitRange range2 
)
inline

Subtract bits as integers.

Treats range1 of this vector and range2 of the other vector as integers, subtracts other from this, and stores the result in range1 of this vector. The ranges must be valid for their respective vectors, and both ranges must be the same size. The other vector is permitted to be the same vector as this, in which case the ranges are also permitted to overlap. Returns false only when an overflow occurs (i.e., the integer interpretation of this vector is unsigned-greater-than the integer from the other vector). If the vectors are interpreted as two's complement signed integers then an overflow is indicated when both operands have the same sign and the result has a different sign.

Definition at line 857 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::subtract().

◆ subtract() [2/3]

bool Sawyer::Container::BitVector::subtract ( const BitRange range1,
const BitRange range2 
)
inline

Subtract bits as integers.

Treats range1 and range2 of this vector as integers, subtracts the integer in range2 from the integer in range1, and stores the result in range1 of this vector. The ranges must be valid for this vector, and both ranges must be the same size. The ranges are permitted to overlap. Returns false only when an overflow occurs (i.e., the integer interpretation of range1 is unsigned-greater-than the integer from range2). If the ranges are interpreted as containing two's complement signed integers then an overflow is indicated when both operands have the same sign and the result has a different sign.

Definition at line 871 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::subtract().

◆ subtract() [3/3]

bool Sawyer::Container::BitVector::subtract ( const BitVector other)
inline

Subtract bits as integers.

Treats this vector and the other vector as integers, subtracts other from this, and stores the result in this vector. Both vectors must be the same size. The other vector is permitted to be the same as this vector, in which case this vector is filled with zero.

Definition at line 882 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::subtract().

◆ signExtend() [1/3]

BitVector & Sawyer::Container::BitVector::signExtend ( const BitRange range1,
const BitVector other,
const BitRange range2 
)
inline

Copy bits and sign extend.

Copies bits from range2 of the other vector to range1 of this vector while sign extending. That is, if the destination is larger than the source, the most significant bit of the source is repeated to fill the high order bits of the destination. Both ranges must be valid for their respective vectors. The other vector is permitted to be the same as this vector, in which case the ranges are also permitted to overlap.

Definition at line 892 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::signExtend().

◆ signExtend() [2/3]

BitVector & Sawyer::Container::BitVector::signExtend ( const BitRange range1,
const BitRange range2 
)
inline

Copy bits and sign extend.

Copies bits from range2 of this vector to range1 of this vector while sign extending. That is, if the destination is larger than the source, the most significant bit of the source is repeated to fill the high order bits of the destination. Both ranges must be valid for this vector, and are permitted to overlap.

Definition at line 904 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::signExtend().

◆ signExtend() [3/3]

BitVector & Sawyer::Container::BitVector::signExtend ( const BitVector other)
inline

Copy bits and sign extend.

Copies bits from the other vector to this vector while sign extending. That is, if the destination is larger than the source, the most significant bit of the source is repeated to fill the high order bits of the destination.

Definition at line 915 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::signExtend().

◆ multiply10() [1/2]

BitVector & Sawyer::Container::BitVector::multiply10 ( )
inline

Multiply by 10.

Threats this vector as an unsigned integer and multiplies it by 10. If the product doesn't fit in the same vector then the high order bits of the product are truncated.

Definition at line 924 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::multiply10().

◆ multiply10() [2/2]

BitVector & Sawyer::Container::BitVector::multiply10 ( const BitRange range)
inline

Multiply by 10.

Treats range of this vector as an unsigned integer and multiplies it by 10, storing the result back into the same range, possibly truncating the result in the process.

Definition at line 933 of file BitVector.h.

References data(), and Sawyer::Container::BitVectorSupport::multiply10().

◆ multiply()

BitVector Sawyer::Container::BitVector::multiply ( const BitVector other) const
inline

Multiply two bit vectors.

Multiplies this bit vector with other, both interpreted as unsigned integer, to produce a result bit vector whose width is the sum of the two input widths.

Definition at line 942 of file BitVector.h.

References add(), get(), resize(), shiftLeft(), and size().

◆ multiplySigned()

BitVector Sawyer::Container::BitVector::multiplySigned ( const BitVector other) const
inline

Multiply two signed integers.

Multiplies this bit vector with other, both interpreted as signed integers, to produce a result bit vector whose width is the sum of the two input widths.

Definition at line 958 of file BitVector.h.

References add(), get(), negate(), resize(), shiftLeft(), and size().

◆ invert() [1/2]

BitVector & Sawyer::Container::BitVector::invert ( const BitRange range)
inline

Invert bits.

Each bit in the specified range is inverted. The range must be valid for this vector.

Definition at line 1004 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::invert().

◆ invert() [2/2]

BitVector & Sawyer::Container::BitVector::invert ( )
inline

Invert bits.

Each bit in this vector is inverted.

Definition at line 1013 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::invert().

◆ bitwiseAnd() [1/3]

BitVector & Sawyer::Container::BitVector::bitwiseAnd ( const BitRange range1,
const BitVector other,
const BitRange range2 
)
inline

Bit-wise AND.

Computes the bit-wise AND of range1 from this vector and range2 of the other vector, storing the result in range1. The ranges must be valid for their respective vectors and must be the same size. The other vector is permitted to refer to this vector, in which case the ranges are also permitted to overlap.

Definition at line 1023 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::bitwiseAnd(), checkRange(), and data().

◆ bitwiseAnd() [2/3]

BitVector & Sawyer::Container::BitVector::bitwiseAnd ( const BitRange range1,
const BitRange range2 
)
inline

Bit-wise AND.

Computes the bit-wise AND of range1 and range2 of this vector, storing the result in range1. The ranges must be valid for this vector and must be the same size. They are permitted to overlap.

Definition at line 1034 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::bitwiseAnd(), checkRange(), and data().

◆ bitwiseAnd() [3/3]

BitVector & Sawyer::Container::BitVector::bitwiseAnd ( const BitVector other)
inline

Bit-wise AND.

Computes the bit-wise AND of this vector and the other vector, storing the result in this vector. The vectors must be the same size.

Definition at line 1045 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::bitwiseAnd(), data(), and hull().

◆ bitwiseOr() [1/3]

BitVector & Sawyer::Container::BitVector::bitwiseOr ( const BitRange range1,
const BitVector other,
const BitRange range2 
)
inline

Bit-wise OR.

Computes the bit-wise OR of range1 from this vector and range2 of the other vector, storing the result in range1. The ranges must be valid for their respective vectors and must be the same size. The other vector is permitted to refer to this vector, in which case the ranges are also permitted to overlap.

Definition at line 1055 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::bitwiseOr(), checkRange(), and data().

◆ bitwiseOr() [2/3]

BitVector & Sawyer::Container::BitVector::bitwiseOr ( const BitRange range1,
const BitRange range2 
)
inline

Bit-wise OR.

Computes the bit-wise OR of range1 and range2 of this vector, storing the result in range1. The ranges must be valid for this vector and must be the same size. They are permitted to overlap.

Definition at line 1066 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::bitwiseOr(), checkRange(), and data().

◆ bitwiseOr() [3/3]

BitVector & Sawyer::Container::BitVector::bitwiseOr ( const BitVector other)
inline

Bit-wise OR.

Computes the bit-wise OR of this vector and the other vector, storing the result in this vector. The vectors must be the same size.

Definition at line 1077 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::bitwiseOr(), data(), and hull().

◆ bitwiseXor() [1/3]

BitVector & Sawyer::Container::BitVector::bitwiseXor ( const BitRange range1,
const BitVector other,
const BitRange range2 
)
inline

Bit-wise XOR.

Computes the bit-wise XOR of range1 from this vector and range2 of the other vector, storing the result in range1. The ranges must be valid for their respective vectors and must be the same size. The other vector is permitted to refer to this vector, in which case the ranges are also permitted to overlap.

Definition at line 1087 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::bitwiseXor(), checkRange(), and data().

◆ bitwiseXor() [2/3]

BitVector & Sawyer::Container::BitVector::bitwiseXor ( const BitRange range1,
const BitRange range2 
)
inline

Bit-wise XOR.

Computes the bit-wise XOR of range1 and range2 of this vector, storing the result in range1. The ranges must be valid for this vector and must be the same size. They are permitted to overlap.

Definition at line 1098 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::bitwiseXor(), checkRange(), and data().

◆ bitwiseXor() [3/3]

BitVector & Sawyer::Container::BitVector::bitwiseXor ( const BitVector other)
inline

Bit-wise XOR.

Computes the bit-wise XOR of this vector and the other vector, storing the result in this vector. The vectors must be the same size.

Definition at line 1109 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::bitwiseXor(), data(), and hull().

◆ isEqualToZero() [1/2]

bool Sawyer::Container::BitVector::isEqualToZero ( const BitRange range) const
inline

Compare to zero.

Compares the integer value referred to by the specified range with zero. Returns true if the value is equal to zero the range is empty.

See also
isAllClear

Definition at line 1124 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::isEqualToZero().

◆ isEqualToZero() [2/2]

bool Sawyer::Container::BitVector::isEqualToZero ( ) const
inline

Compare to zero.

Returns true if this vector is empty all bits are false.

See also
isAllClear

Definition at line 1134 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::isEqualToZero().

◆ compare() [1/3]

int Sawyer::Container::BitVector::compare ( const BitRange range1,
const BitVector other,
const BitRange range2 
) const
inline

Compare bits as integers.

Compares range1 from this vector with range2 from the other vector as integers and returns a value whose sign indicates the ordering relationship between the two ranges. Returns negative if the range1 value is less than the range2 value, returns zero if they are equal, and returns positive if the range1 value is greater than the range2 value. The ranges must be valid for their respective vectors, and need not be the same size (the smaller range will be temporarily zero extended on its most significant end). An empty range is treated as zero. The other vector is permitted to refer to this vector, in which case the ranges are also permitted to overlap.

Definition at line 1146 of file BitVector.h.

References checkRange(), Sawyer::Container::BitVectorSupport::compare(), and data().

◆ compare() [2/3]

int Sawyer::Container::BitVector::compare ( const BitRange range1,
const BitRange range2 
) const
inline

Compare bits as integers.

Compares range1 and range2 from this vector as integers and returns a value whose sign indicates the ordering relationship between the two ranges. Returns negative if the range1 value is less than the range2 value, returns zero if they are equal, and returns positive if the range1 value is greater than the range2 value. The ranges must be valid for this vector, and need not be the same size (the smaller range will be temporarily zero extended on its most significant end). An empty range is interpreted as zero. The ranges are permitted to overlap.

Definition at line 1159 of file BitVector.h.

References checkRange(), Sawyer::Container::BitVectorSupport::compare(), and data().

◆ compare() [3/3]

int Sawyer::Container::BitVector::compare ( const BitVector other) const
inline

Compare bits as integers.

Compares the bits of this vector with the bits of other as integers and returns a value whose sign indicates the ordering relationship between the two ranges. Returns negative if this value is less than the other value, returns zero if they are equal, and returns positive if this value is greater than the other value. The vectors need not be the same size (the smaller vector will be temporarily zero extended on its most significant end). An empty vector is treated as zero.

Definition at line 1172 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::compare(), data(), and hull().

◆ compareSigned() [1/3]

int Sawyer::Container::BitVector::compareSigned ( const BitRange range1,
const BitVector other,
const BitRange range2 
) const
inline

Compare bits as signed integers.

Compares range1 from this vector with range2 from the other vector as signed, two's complement integers and returns a value whose sign indicates the ordering relationship between the two ranges. Returns negative if the range1 value is less than the range2 value, returns zero if they are equal, and returns positive if the range1 value is greater than the range2 value. The ranges must be valid for their respective vectors, and need not be the same size (the smaller range will be temporarily zero extended on its most significant end). An empty range is treated as zero. The other vector is permitted to refer to this vector, in which case the ranges are also permitted to overlap.

Definition at line 1185 of file BitVector.h.

References checkRange(), Sawyer::Container::BitVectorSupport::compareSigned(), and data().

◆ compareSigned() [2/3]

int Sawyer::Container::BitVector::compareSigned ( const BitRange range1,
const BitRange range2 
) const
inline

Compare bits as signed integers.

Compares range1 and range2 from this vector as signed, two's complement integers and returns a value whose sign indicates the ordering relationship between the two ranges. Returns negative if the range1 value is less than the range2 value, returns zero if they are equal, and returns positive if the range1 value is greater than the range2 value. The ranges must be valid for this vector, and need not be the same size (the smaller range will be temporarily zero extended on its most significant end). An empty range is interpreted as zero. The ranges are permitted to overlap.

Definition at line 1199 of file BitVector.h.

References checkRange(), Sawyer::Container::BitVectorSupport::compareSigned(), and data().

◆ compareSigned() [3/3]

int Sawyer::Container::BitVector::compareSigned ( const BitVector other) const
inline

Compare bits as signed integers.

Compares the bits of this vector with the bits of other as signed, two's complement integers and returns a value whose sign indicates the ordering relationship between the two ranges. Returns negative if this value is less than the other value, returns zero if they are equal, and returns positive if this value is greater than the other value. The vectors need not be the same size (the smaller vector will be temporarily zero extended on its most significant end). An empty vector is treated as zero.

Definition at line 1212 of file BitVector.h.

References Sawyer::Container::BitVectorSupport::compareSigned(), data(), and hull().

◆ toInteger() [1/2]

boost::uint64_t Sawyer::Container::BitVector::toInteger ( const BitRange range) const
inline

Interpret bits as an unsigned integer.

Returns the bits of the specified range by interpreting them as an unsigned integer. The range must be valid for this vector. If the range contains more than 64 bits then only the low-order 64 bits are considered.

Definition at line 1224 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::toInteger().

◆ toInteger() [2/2]

boost::uint64_t Sawyer::Container::BitVector::toInteger ( ) const
inline

Interpret bits as an unsigned integer.

Returns the bits of this vector by interpreting them as an unsigned integer. If this vector contains more than 64 bits then only the low-order 64 bits are considered.

Definition at line 1233 of file BitVector.h.

References data(), hull(), size(), and Sawyer::Container::BitVectorSupport::toInteger().

◆ toSignedInteger() [1/2]

boost::int64_t Sawyer::Container::BitVector::toSignedInteger ( const BitRange range) const
inline

Interpret bits as a signed integer.

Returns the bits of the specified range by interpreting them as a two's complement signed integer, sign extended to the width of the return value. The range must be valid for this vector. If the range size is one bit then the value zero or one is returned; if the range size is less than 64 bits then the bits are sign extended to a width of 64; if the range is larger than 64 bits then only the low-order 64 bits are returned.

Definition at line 1245 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::toInteger().

◆ toSignedInteger() [2/2]

boost::int64_t Sawyer::Container::BitVector::toSignedInteger ( ) const
inline

Interpret bits as a signed integer.

Returns the bits of the specified range by interpreting them as a two's complement signed integer, sign extended to the width of the return value. The range must be valid for this vector. If the range size is one bit then the value zero or one is returned; if the range size is less than 64 bits then the bits are sign extended to a width of 64; if the range is larger than 64 bits then only the low-order 64 bits are returned.

Definition at line 1256 of file BitVector.h.

References data(), hull(), size(), and Sawyer::Container::BitVectorSupport::toSignedInteger().

◆ toHex() [1/2]

std::string Sawyer::Container::BitVector::toHex ( const BitRange range) const
inline

Convert to a hexadecimal string.

Returns a string which is the hexadecimal representation of the bits in the specified range. The range must be valid for this vector. No prefix or suffix is added (e.g., no leading "0x" or trailing "h"). The number of digits in the return value is the minimum required to explicitly represent each bit of the range, including leading zeros; an empty range will return an empty string. The returned string is lower case.

Definition at line 1268 of file BitVector.h.

References data(), and Sawyer::Container::BitVectorSupport::toHex().

Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::print().

◆ toHex() [2/2]

std::string Sawyer::Container::BitVector::toHex ( ) const
inline

Convert to a hexadecimal string.

Returns a string which is the hexadecimal representation of the bits in this vector. No prefix or suffix is added (e.g., no leading "0x" or trailing "h"). The number of digits in the return value is the minimum required to explicitly represent each bit of the vector, including leading zeros; an empty vector will return an empty string. The returned string is lower case.

Definition at line 1278 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::toHex().

◆ toOctal() [1/2]

std::string Sawyer::Container::BitVector::toOctal ( const BitRange range) const
inline

Convert to an octal string.

Returns a string which is the octal representation of the bits in the specified range. The range must be valid for this vector. No prefix or suffix is added (e.g., no extra leading "0" or trailing "o"). The number of digits in the return value is the minimum required to explicitly represent each bit of the range, including leading zeros; an empty range will return an empty string.

Definition at line 1288 of file BitVector.h.

References data(), and Sawyer::Container::BitVectorSupport::toOctal().

◆ toOctal() [2/2]

std::string Sawyer::Container::BitVector::toOctal ( ) const
inline

Convert to an octal string.

Returns a string which is the octal representation of the bits in this vector. No prefix or suffix is added (e.g., no leading "0" or trailing "o"). The number of digits in the return value is the minimum required to explicitly represent each bit of the vector, including leading zeros; an empty vector will return an empty string.

Definition at line 1297 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::toOctal().

◆ toBinary() [1/2]

std::string Sawyer::Container::BitVector::toBinary ( const BitRange range) const
inline

Convert to a binary string.

Returns a string which is the binary representation of the bits in the specified range. The range must be valid for this vector. No prefix or suffix is added (e.g., no extra leading or trailing "b"). The number of digits in the return value is the minimum required to explicitly represent each bit of the range, including leading zeros; an empty range will return an empty string.

Definition at line 1307 of file BitVector.h.

References data(), and Sawyer::Container::BitVectorSupport::toBinary().

◆ toBinary() [2/2]

std::string Sawyer::Container::BitVector::toBinary ( ) const
inline

Convert to an binary string.

Returns a string which is the binary representation of the bits in this vector. No prefix or suffix is added (e.g., no leading or trailing "b"). The number of digits in the return value is the minimum required to explicitly represent each bit of the vector, including leading zeros; an empty vector will return an empty string.

Definition at line 1316 of file BitVector.h.

References data(), hull(), and Sawyer::Container::BitVectorSupport::toBinary().

◆ toBytes() [1/2]

std::vector< uint8_t > Sawyer::Container::BitVector::toBytes ( ) const
inline

Convert to a vector of bytes.

The returned vector is in little endian order. The size of the returned vector is rounded up to the next whole byte and any extra bits in the return value are cleared. For instance, if this bit vector contains 13 bits, then the return value will be two bytes with the highest order three bits of the second byte cleared.

Definition at line 1327 of file BitVector.h.

References data(), and hull().

◆ toBytes() [2/2]

std::vector< uint8_t > Sawyer::Container::BitVector::toBytes ( const BitRange range) const
inline

Convert to a vector of bytes.

The returned vector is in little endian order. The size of the returned vector is rounded up to the next whole byte and any extra bits in the return value are cleared. For instance, if this bit vector contains 13 bits, then the return value will be two bytes with the highest order three bits of the second byte cleared.

Definition at line 1330 of file BitVector.h.

References data().

◆ fromInteger() [1/2]

BitVector & Sawyer::Container::BitVector::fromInteger ( const BitRange range,
boost::uint64_t  value 
)
inline

Obtain bits from an integer.

Assigns the specified value to the bits indicated by range of this vector. If the range contains fewer than 64 bits then only the low order bits of value are used; if the range contains more than 64 bits then the high-order bits are cleared. The range must be a valid range for this vector.

Definition at line 1340 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::fromInteger().

Referenced by Sawyer::Container::AddressMapConstraints< AddressMap >::print().

◆ fromInteger() [2/2]

BitVector & Sawyer::Container::BitVector::fromInteger ( boost::uint64_t  value)
inline

Obtain bits from an integer.

Assigns the specified value to this vector. If this vector contains fewer than 64 bits then only the low order bits of value are used; if this vector contains more than 64 bits then the high-order bits are cleared. The size of this vector is not changed by this operation.

See also
The assignment operator.

Definition at line 1353 of file BitVector.h.

References data(), Sawyer::Container::BitVectorSupport::fromInteger(), and hull().

◆ fromDecimal() [1/2]

BitVector & Sawyer::Container::BitVector::fromDecimal ( const BitRange range,
const std::string &  input 
)
inline

Obtains bits from a decimal representation.

Assigns the specified value, represented in decimal, to the specified range of this vector. The input string must contain only valid decimal digits '0' through '9' or the underscore character (to make long strings more readable), or else an std::runtime_error is thrown. The range must be valid for this vector. If the number of supplied digits is larger than what is required to initialize the specified range then the extra data is discarded. On the other hand, if the length of the string is insufficient to initialize the entire range then the high order bits of the range are cleared.

Definition at line 1367 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::fromDecimal().

Referenced by parse().

◆ fromDecimal() [2/2]

BitVector & Sawyer::Container::BitVector::fromDecimal ( const std::string &  input)
inline

Obtain bits from a decimal representation.

Assigns the specified value, represented in decimal, to this vector. The input string must contain only valid decimal digits '0' through '9' or the underscore character (to make long strings more readable), or else an std::runtime_error is thrown. If the number of supplied digits is larger than what is required to initialize this vector then the extra data is discarded. On the other hand, if the length of the string is insufficient to initialize the entire vector then the high order bits of the vector are cleared. The size of this vector is not changed by this operation.

Definition at line 1381 of file BitVector.h.

References data(), Sawyer::Container::BitVectorSupport::fromDecimal(), and hull().

◆ fromHex() [1/2]

BitVector & Sawyer::Container::BitVector::fromHex ( const BitRange range,
const std::string &  input 
)
inline

Obtain bits from a hexadecimal representation.

Assigns the specified value, represented in hexadecimal, to the specified range of this vector. The input string must contain only valid hexadecimal digits '0' through '9', 'a' through 'f', and 'A' through 'F', or the underscore character (to make long strings more readable), or else an std::runtime_error is thrown. The range must be valid for this vector. If the number of supplied digits is larger than what is required to initialize the specified range then the extra data is discarded. On the other hand, if the length of the string is insufficient to initialize the entire range then the high order bits of the range are cleared.

Definition at line 1394 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::fromHex().

Referenced by parse().

◆ fromHex() [2/2]

BitVector & Sawyer::Container::BitVector::fromHex ( const std::string &  input)
inline

Obtain bits from a hexadecimal representation.

Assigns the specified value, represented in hexadecimal, to this vector. The input string must contain only valid hexadecimal digits '0' through '9', 'a' through 'f', and 'A' through 'F', or the underscore character (to make long strings more readable), or else an std::runtime_error is thrown. If the number of supplied digits is larger than what is required to initialize this vector then the extra data is discarded. On the other hand, if the length of the string is insufficient to initialize the entire vector then the high order bits of the vector are cleared. The size of this vector is not changed by this operation.

Definition at line 1408 of file BitVector.h.

References data(), Sawyer::Container::BitVectorSupport::fromHex(), and hull().

◆ fromOctal() [1/2]

BitVector & Sawyer::Container::BitVector::fromOctal ( const BitRange range,
const std::string &  input 
)
inline

Obtain bits from an octal representation.

Assigns the specified value, represented in octal, to the specified range of this vector. The input string must contain only valid octal digits '0' through '7' or the underscore character (to make long strings more readable), or else an std::runtime_error is thrown. The range must be valid for this vector. If the number of supplied digits is larger than what is required to initialize the specified range then the extra data is discarded. On the other hand, if the length of the string is insufficient to initialize the entire range then the high order bits of the range are cleared.

Definition at line 1421 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::fromOctal().

Referenced by parse().

◆ fromOctal() [2/2]

BitVector & Sawyer::Container::BitVector::fromOctal ( const std::string &  input)
inline

Obtain bits from an octal representation.

Assigns the specified value, represented in octal, to this vector. The input string must contain only valid octal digits '0' through '7' or the underscore character (to make long strings more readable), or else an std::runtime_error is thrown. If the number of supplied digits is larger than what is required to initialize this vector then the extra data is discarded. On the other hand, if the length of the string is insufficient to initialize the entire vector then the high order bits of the vector are cleared. The size of this vector is not changed by this operation.

Definition at line 1435 of file BitVector.h.

References data(), Sawyer::Container::BitVectorSupport::fromOctal(), and hull().

◆ fromBinary() [1/2]

BitVector & Sawyer::Container::BitVector::fromBinary ( const BitRange range,
const std::string &  input 
)
inline

Obtain bits from a binary representation.

Assigns the specified value, represented in binary, to the specified range of this vector. The input string must contain only valid binary digits '0' and '1' or the underscore character (to make long strings more readable), or else an std::runtime_error is thrown. The range must be valid for this vector. If the number of supplied digits is larger than what is required to initialize the specified range then the extra data is discarded. On the other hand, if the length of the string is insufficient to initialize the entire range then the high order bits of the range are cleared.

Definition at line 1448 of file BitVector.h.

References checkRange(), data(), and Sawyer::Container::BitVectorSupport::fromBinary().

Referenced by parse().

◆ fromBinary() [2/2]

BitVector & Sawyer::Container::BitVector::fromBinary ( const std::string &  input)
inline

Obtain bits from a binary representation.

Assigns the specified value, represented in binary, to this vector. The input string must contain only valid binary digits '0' and '1' or the underscore character (to make long strings more readable), or else an std::runtime_error is thrown. If the number of supplied digits is larger than what is required to initialize this vector then the extra data is discarded. On the other hand, if the length of the string is insufficient to initialize the entire vector then the high order bits of the vector are cleared. The size of this vector is not changed by this operation.

Definition at line 1462 of file BitVector.h.

References data(), Sawyer::Container::BitVectorSupport::fromBinary(), and hull().

◆ fromBytes() [1/2]

BitVector & Sawyer::Container::BitVector::fromBytes ( const std::vector< uint8_t > &  input)
inline

Obtain bits from a byte vector.

Reads bits from the little-endian byte vector and copies them into the specified range of this bit vector. If no range is specified, then this entire bit vector is initialized. The byte vector must be long enough to initialize the specified range or the whole bit vector.

Definition at line 1474 of file BitVector.h.

References data(), and hull().

◆ fromBytes() [2/2]

BitVector & Sawyer::Container::BitVector::fromBytes ( const BitRange range,
const std::vector< uint8_t > &  input 
)
inline

Obtain bits from a byte vector.

Reads bits from the little-endian byte vector and copies them into the specified range of this bit vector. If no range is specified, then this entire bit vector is initialized. The byte vector must be long enough to initialize the specified range or the whole bit vector.

Definition at line 1478 of file BitVector.h.

References data().

◆ checkRange()

void Sawyer::Container::BitVector::checkRange ( const BitRange range) const
inline

◆ data() [1/2]

Word * Sawyer::Container::BitVector::data ( )
inline

Raw data for vector.

Returns a pointer to the raw data for the vector. This is mostly for internal use so that the raw data can be passed to the BitVectorSupport functions.

Definition at line 1502 of file BitVector.h.

Referenced by add(), add(), add(), bitwiseAnd(), bitwiseAnd(), bitwiseAnd(), bitwiseOr(), bitwiseOr(), bitwiseOr(), bitwiseXor(), bitwiseXor(), bitwiseXor(), clear(), clear(), compare(), compare(), compare(), compareSigned(), compareSigned(), compareSigned(), copy(), copy(), decrement(), decrement(), equalTo(), equalTo(), equalTo(), fromBinary(), fromBinary(), fromBytes(), fromBytes(), fromDecimal(), fromDecimal(), fromHex(), fromHex(), fromInteger(), fromInteger(), fromOctal(), fromOctal(), get(), increment(), increment(), invert(), invert(), isAllClear(), isAllClear(), isAllSet(), isAllSet(), isEqualToZero(), isEqualToZero(), leastSignificantClearBit(), leastSignificantClearBit(), leastSignificantDifference(), leastSignificantDifference(), leastSignificantDifference(), leastSignificantSetBit(), leastSignificantSetBit(), mostSignificantClearBit(), mostSignificantClearBit(), mostSignificantDifference(), mostSignificantDifference(), mostSignificantDifference(), mostSignificantSetBit(), mostSignificantSetBit(), multiply10(), multiply10(), nClear(), nClear(), negate(), negate(), nSet(), nSet(), resize(), rotateLeft(), rotateLeft(), rotateRight(), rotateRight(), set(), set(), setValue(), setValue(), shiftLeft(), shiftLeft(), shiftRight(), shiftRight(), shiftRightArithmetic(), shiftRightArithmetic(), signExtend(), signExtend(), signExtend(), subtract(), subtract(), subtract(), swap(), swap(), toBinary(), toBinary(), toBytes(), toBytes(), toHex(), toHex(), toInteger(), toInteger(), toOctal(), toOctal(), toSignedInteger(), and toSignedInteger().

◆ data() [2/2]

const Word * Sawyer::Container::BitVector::data ( ) const
inline

Raw data for vector.

Returns a pointer to the raw data for the vector. This is mostly for internal use so that the raw data can be passed to the BitVectorSupport functions.

Definition at line 1506 of file BitVector.h.

◆ dataSize()

size_t Sawyer::Container::BitVector::dataSize ( ) const
inline

Raw data size.

Returns the number of elements of type Word in the array returned by the data method.

Definition at line 1514 of file BitVector.h.


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