ATLAS Offline Software
Loading...
Searching...
No Matches
AbstractErrorCode.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7bool AbstractErrorCode::bitIsSet(unsigned int number) const {
8 unsigned int correspondingNumber = (unsigned int) (1<<number);
9
10 bool isSet( ( m_errorCode & correspondingNumber) > 0);
11
12 return isSet;
13}
14
15void AbstractErrorCode::setBit(unsigned int number, bool value) {
16 bool isSet(bitIsSet(number));
17 unsigned int correspondingNumber = (unsigned int) (1<<number);
18
19 // set bit if not set yet
20 if ((value) && (!isSet)) m_errorCode |= correspondingNumber;
21 // remove bit if bit is set
22 if ((!value) && (isSet)) m_errorCode &= ~correspondingNumber;
23}
bool bitIsSet(unsigned int number) const
void setBit(unsigned int number, bool value)
unsigned int m_errorCode
std::string number(const double &d, const std::string &s)
Definition utils.cxx:186