28 #ifndef CASA_BITVECTOR_H
29 #define CASA_BITVECTOR_H
40 class BitVectorHelper;
269 operator Bool()
const;
309 : bitNumber_p (bitNumber),
319 : bitNumber_p (that.bitNumber_p),
320 vecPtr_p (that.vecPtr_p)
329 inline BitVectorHelper::operator
Bool()
const
331 return vecPtr_p->getBit (bitNumber_p);
337 vecPtr_p->putBit (bitNumber_p, that.vecPtr_p->getBit (that.bitNumber_p));
BitVector operator^(const BitVector &that) const
~BitVector()
Delete the bit vector.
void operator^=(const BitVector &that)
uInt size_p
Number of bits in the BitVector object.
Bool operator!=(const BitVector &that) const
Returns True if a bit differs.
void putBit(uInt pos, Bool state)
Set a bit at the given position (0-relative) to the given state.
BitVector operator&(const BitVector &that) const
Logical operations on whole bit vectors.
const uInt WORDSIZE
The size of a unsigned Integer (assumes 8-bit char)
BitVector operator|(const BitVector &that) const
uInt nbits() const
Return the number of bits in the bitvector.
void copy(uInt thisStart, uInt length, const BitVector &that, uInt thatStart)
Copy length bits starting at thatStart in the other BitVector to this BitVector starting at thisStart...
Bool toggleBit(uInt pos)
Toggle a bit at the given position (0-relative).
BitVector & operator=(const BitVector &that)
Assignment (copy semantics).
BitVector operator~() const
friend ostream & operator<<(ostream &, const BitVector &vector)
Write a representation of the bit vector (a list of zeros and ones enclosed in square parentheses) to...
void operator&=(const BitVector &that)
Logical in-place operations on whole bit vectors.
void setBit(uInt pos)
Set a bit at the given position (0-relative).
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
#define DebugAssert(expr, exception)
BitVectorHelper(const BitVectorHelper &that)
Copy constructor has to be public.
bool Bool
Define the standard types used by Casacore.
Bool operator==(const BitVector &that) const
Returns True if all bits are equal.
friend class BitVectorHelper
BitVectorHelper is a helper class.
Bool operator[](uInt pos) const
Index operator to access the specified bit.
void set(Bool state)
Set all bits of the bit vector to the specified state.
const BitVectorHelper & operator=(const BitVectorHelper &that) const
Set the bit to the state of the bit in the other BitVector.
Bool getBit(uInt pos) const
Get a bit at the given position (0-relative).
Base class for all Casacore library errors.
Block< uInt > bits_p
Pointer to the actual bit vector, stored as a contiguous sequence of one or more unsigned integers...
BitVector()
Create a bit vector of length 0.
void clearBit(uInt pos)
Clear a bit at the given position (0-relative).
void resize(uInt length, Bool state=False, Bool copy=True)
Resize the bit vector to the new length.
Helper class for BitVector.
BitVector * vecPtr_p
Pointer back to the original vector.
void operator|=(const BitVector &that)