71#ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_BIT_MANIP_H
72#define LASS_GUARDIAN_OF_INCLUSION_UTIL_BIT_MANIP_H
84template<
typename T>
inline void setBit(T& a_bits,
size_t a_bit);
85template<
typename T>
inline void clearBit(T& a_bits,
size_t a_bit);
86template<
typename T>
inline void flipBit(T& a_bits,
size_t a_bit);
87template<
typename T>
inline void setBitIf(T& a_bits,
size_t a_bit,
bool a_condition);
88template<
typename T>
inline void clearBitIf(T& a_bits,
size_t a_bit,
bool a_condition);
89template<
typename T>
inline void flipBitIf(T& a_bits,
size_t a_bit,
bool a_condition);
90template<
typename T>
inline void setBitTo(T& a_bits,
size_t a_bit,
bool a_state);
91template<
typename T>
inline bool checkBit(T a_bits,
size_t a_bit);
93template<
typename T>
inline void setMasked(T& a_bits,
const T& a_mask);
94template<
typename T>
inline void clearMasked(T& a_bits,
const T& a_mask);
95template<
typename T>
inline void flipMasked(T& a_bits,
const T& a_mask);
96template<
typename T>
inline void setMaskedIf(T& a_bits,
const T& a_mask,
bool a_condition);
97template<
typename T>
inline void clearMaskedIf(T& a_bits,
const T& a_mask,
bool a_condition);
98template<
typename T>
inline void flipMaskedIf(T& a_bits,
const T& a_mask,
bool a_condition);
99template<
typename T>
inline void setMaskedTo(T& a_bits,
const T& a_mask,
bool a_state);
100template<
typename T>
inline bool checkMaskedAll(T a_bits,
const T& a_mask);
101template<
typename T>
inline bool checkMaskedSome(T a_bits,
const T& a_mask);
103template<
typename T>
inline size_t countBits(T bits);
bool checkBit(T a_bits, size_t a_bit)
return true if a bit is set high.
bool checkMaskedSome(T a_bits, const T &a_mask)
Check the masked bits and return true if at least one is set.
void setBit(T &a_bits, size_t a_bit)
Set a bit high.
void setMaskedIf(T &a_bits, const T &a_mask, bool a_condition)
Set masked bits high if (and only if) a condition is fullfilled.
void setBitTo(T &a_bits, size_t a_bit, bool a_state)
set a bit to a given state.
void flipMaskedIf(T &a_bits, const T &a_mask, bool a_condition)
Flip the masked bits if (and only if) a condition is fullfilled.
bool checkMaskedAll(T a_bits, const T &a_mask)
Check the masked bits and return true if they are ALL set.
void flipBitIf(T &a_bits, size_t a_bit, bool a_condition)
flip a bit if (and only if) a condition is fullfilled (low->high, high->low).
void clearMasked(T &a_bits, const T &a_mask)
Set masked bits low.
void setMasked(T &a_bits, const T &a_mask)
Set masked bits high.
size_t countBits(T bits)
returns number of set bits in bits
void clearMaskedIf(T &a_bits, const T &a_mask, bool a_condition)
Set masked bits low if (and only if) a condition is fullfilled.
void clearBitIf(T &a_bits, size_t a_bit, bool a_condition)
set a bit low if (and only if) a condition is fullfilled is true.
void setBitIf(T &a_bits, size_t a_bit, bool a_condition)
set a bit high if (and only if) a condition is fullfilled.
void flipMasked(T &a_bits, const T &a_mask)
flip masked bits.
void clearBit(T &a_bits, size_t a_bit)
set a bit low.
void flipBit(T &a_bits, size_t a_bit)
flip state of a bit (low->high, high->low).
void setMaskedTo(T &a_bits, const T &a_mask, bool a_state)
Set the masked bits to a given state if (and only if) a condition is fullfilled.
general utility, debug facilities, ...
Library for Assembled Shared Sources.