|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef TRIGT1INTERFACES_BITOP_H
6 #define TRIGT1INTERFACES_BITOP_H
34 static void printBinN(
unsigned int uintValue,
int nbits );
35 static void printBinN(
int intValue,
int nbits );
38 static const std::string
printBits(
const int value,
const int startbit,
47 inline static bool isSet(
const unsigned int *uintValue,
int bit ) {
48 return ( *uintValue == ( *uintValue | ( 1 << bit ) ) );
51 inline static bool isSet(
const int *intValue,
int bit ) {
52 return ( *intValue == ( *intValue | ( 1 << bit ) ) );
59 inline static void setBit(
unsigned int *uintValue,
int bit ) {
60 *uintValue |= ( 1 << bit );
62 inline static void setBit(
int *intValue,
int bit ) {
63 *intValue |= ( 1 << bit );
70 inline static void clearBit(
unsigned int *uintValue,
int bit ) {
71 *uintValue |= ( 1 << bit ); *uintValue ^= ( 1 << bit );
73 inline static void clearBit(
int *intValue,
int bit ) {
74 *intValue |= ( 1 << bit ); *intValue ^= ( 1 << bit );
83 inline static void sImposeNBits(
unsigned int *uintValue,
int stbit,
int wrd ) {
84 *uintValue |= ( wrd << stbit );
86 inline static void sImposeNBits(
int *intValue,
int stbit,
int wrd ) {
87 *intValue |= ( wrd << stbit );
89 inline static void sImposeNBits(
unsigned int *uintValue,
int stbit,
91 *uintValue |= ( wrd << stbit );
93 inline static void sImposeNBits(
int *intValue,
int stbit,
unsigned int wrd ) {
94 *intValue |= ( wrd << stbit );
98 static unsigned int alignBits(
int value,
int startbit,
int endbit );
100 static unsigned int createMask(
int startbit,
int endbit );
106 static unsigned int getValue(
const unsigned int * uintValue,
107 const unsigned int mask );
111 #endif // TRIGT1INTERFACES_BITOP_H
static void clearBit(int *intValue, int bit)
static bool isSet(const int *intValue, int bit)
static void printBin(unsigned int uintValue)
Utitlity function to print out the binary representation of an input int or unsigned int value.
static void clearBit(unsigned int *uintValue, int bit)
Clear the given bit in the given integer.
Utility class for integer bit operations.
static void printBinN(unsigned int uintValue, int nbits)
static void printBin(int intValue)
static void sImposeNBits(int *intValue, int stbit, int wrd)
static const std::string printBits(const int value, const int startbit, const int endbit)
print selected bit range into string
static void setBit(int *intValue, int bit)
static bool isSet(const unsigned int *uintValue, int bit)
Check if a the given bit in the given unsigned int or int value is set.
static void sImposeNBits(int *intValue, int stbit, unsigned int wrd)
static void setBit(unsigned int *uintValue, int bit)
Set the given bit in the given unsigned int or int value.
static unsigned int createMask(int startbit, int endbit)
create a 32 bit long mask with 1s from given start to end position
static void sImposeNBits(unsigned int *uintValue, int stbit, int wrd)
Superimpose the given integer wrd starting at bit stbit onto integer or unsigned interger value.
static unsigned int alignBits(int value, int startbit, int endbit)
align given bits using start and end position into 32 bits
static void sImposeNBits(unsigned int *uintValue, int stbit, unsigned int wrd)
static unsigned int getValue(const unsigned int *uintValue, const unsigned int mask)
get the value in the input word represented by a bit pattern given as a bitmask