28 #ifndef CASA_BITVECTOR_H
29 #define CASA_BITVECTOR_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Containers/Block.h>
34 #include <casacore/casa/Utilities/Assert.h>
35 #include <casacore/casa/iosfwd.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));
#define DebugAssert(expr, exception)
Helper class for BitVector.
BitVector * vecPtr_p
Pointer back to the original vector.
BitVectorHelper(const BitVectorHelper &that)
Copy constructor has to be public.
const BitVectorHelper & operator=(const BitVectorHelper &that) const
Set the bit to the state of the bit in the other BitVector.
void operator^=(const BitVector &that)
BitVector operator~() const
Bool operator!=(const BitVector &that) const
Returns True if a bit differs.
Bool toggleBit(uInt pos)
Toggle a bit at the given position (0-relative).
void set(Bool state)
Set all bits of the bit vector to the specified state.
BitVector(uInt length, Bool state)
Create a bit vector with length bits and set all bits to to the specified state.
void setBit(uInt pos)
Set a bit at the given position (0-relative).
uInt nbits() const
Return the number of bits in the bitvector.
uInt size_p
Number of bits in the BitVector object.
void clearBit(uInt pos)
Clear a bit at the given position (0-relative).
BitVector(const BitVector &that)
Copy constructor (copy semantics).
void putBit(uInt pos, Bool state)
Set a bit at the given position (0-relative) to the given state.
void operator|=(const BitVector &that)
BitVector operator&(const BitVector &that) const
Logical operations on whole bit vectors.
BitVector & operator=(const BitVector &that)
Assignment (copy semantics).
void resize(uInt length, Bool state=False, Bool copy=True)
Resize the bit vector to the new length.
BitVector operator^(const BitVector &that) const
Bool getBit(uInt pos) const
Get a bit at the given position (0-relative).
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...
BitVector operator|(const BitVector &that) 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.
Bool operator[](uInt pos) const
Index operator to access the specified bit.
Block< uInt > bits_p
Pointer to the actual bit vector, stored as a contiguous sequence of one or more unsigned integers.
void set(uInt start, uInt length, Bool state)
Set length bits starting at the start position (0-relative) to the given state.
Bool operator==(const BitVector &that) const
Returns True if all bits are equal.
~BitVector()
Delete the bit vector.
friend class BitVectorHelper
BitVectorHelper is a helper class.
BitVector()
Create a bit vector of length 0.
this file contains all the compiler specific defines
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
const uInt WORDSIZE
The size of a unsigned Integer (assumes 8-bit char)
bool Bool
Define the standard types used by Casacore.