1 #ifndef SZA_UTIL_BITMASK_H
2 #define SZA_UTIL_BITMASK_H
33 void resize(
unsigned nBit);
38 void setTo(std::valarray<unsigned char>* byteVec);
39 void fillFrom(
unsigned char* bytePtr,
unsigned size);
43 void setBitHigh(
unsigned iBit);
44 void setAllBitsHigh();
48 void setBitLow(
unsigned iBit);
53 bool bitIsHigh(
unsigned iBit);
54 bool bitIsLow(
unsigned iBit);
58 unsigned bitVal(
unsigned iBit);
63 bool allBitsAreLowBut(
unsigned iBit);
67 friend std::ostream& operator<<(std::ostream& os, BitMask& bitMask);
71 void operator=(
const BitMask& bitMask);
72 void operator=(BitMask& bitMask);
76 void operator|=(BitMask& bitMask);
77 void operator|=(
const BitMask& bitMask);
78 BitMask operator|(BitMask& bitMask);
79 BitMask operator|(
const BitMask& bitMask);
83 void operator&=(BitMask& bitMask);
84 void operator&=(
const BitMask& bitMask);
85 BitMask operator&(BitMask& bitMask);
86 BitMask operator&(
const BitMask& bitMask);
90 BitMask operator~ (
void);
92 void operator=(std::string bitMaskStr);
96 void getBitAndByte(
unsigned iBit);
100 unsigned iBitInByte_;
102 bool internalMemory_;
104 std::valarray<unsigned char>* byteVecPtr_;
108 std::ostream& operator<<(std::ostream& os, BitMask& bitMask);
115 #endif // End #ifndef SZA_UTIL_BITMASK_H