80 Info(
TClass &o, std::string &&
n,
bool intentionalDup) : fOwner(&o), fConstantName(
n), fIntentionalDup(intentionalDup)
87 std::string fConstantName;
88 bool fIntentionalDup =
false;
103 Error(
"TStatusBitsChecker::ConvertBit",
"In %s the value of %s is %lld which was not produced by BIT macro.",
104 classRef.
GetName(), constantName, constant);
109 double fraction = std::frexp(constant, &backshift);
116 if (backshift < 0 || std::abs(0.5 - fraction) > 0.00001
f) {
117 Error(
"TStatusBitsChecker::ConvertBit",
"In %s the value of %s is %lld which was not produced by BIT macro.",
118 classRef.
GetName(), constantName, constant);
122 if (backshift > 24) {
123 Error(
"TStatusBitsChecker::ConvertBit",
"In %s the value of %s is %lld (>23) which is ignored by SetBit.",
124 classRef.
GetName(), constantName, constant);
145 bool intentionalDup = exceptionBits && exceptionBits->
GetConstant(constant->GetName());
153 if (reg.fOwner == &classRef) {
161 fRegister[bit].emplace_back(classRef, std::string(constant->GetName()), intentionalDup);
169 TClass *bcl = base->GetClassPointer();
187 for (
auto constant : cursor.second) {
188 Printf(
"Bit %3d declared in %s as %s", cursor.first, constant.fOwner->GetName(),
189 constant.fConstantName.c_str());
194 bool issuedHeader =
false;
197 unsigned int nDuplicate = 0;
198 for (
auto constant : cursor.second) {
199 if (!constant.fIntentionalDup)
202 if (nDuplicate > 1) {
204 Error(
"TStatusBitsChecker",
"In %s class hierarchy, there are duplicates bits:", classRef.
GetName());
207 for (
auto constant : cursor.second) {
208 if (!constant.fIntentionalDup) {
209 Error(
"TStatusBitsChecker",
" Bit %3d used in %s as %s", cursor.first, constant.fOwner->GetName(),
210 constant.fConstantName.c_str());
226 return Registry().Check(classRef, verbose);
237 return Check(*cl, verbose);
254 std::set<std::string> rootLibs;
255 TList classesDeclFileNotFound;
256 TList classesImplFileNotFound;
259 for (
Int_t i = 0; i < totalNumberOfClasses; i++) {
272 result =
Check(*classPtr, verbosity) && result;
virtual const char * GetName() const
Returns name of object.
The TEnum class implements the enum type.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Namespace for new ROOT classes and functions.
R__EXTERN TClassTable * gClassTable
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
const TSeqCollection * GetConstants() const
TRangeStaticCast is an adaptater class that allows the typed iteration through a TCollection.
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
void RegisterBits(TClass &classRef)
Add to fRegister the Info about the bits in this class and its base classes.
static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName)
Figure out which bit the constant has been set from/to.
~Registry()
Default destructor. Implemented in source file to allow hiding of the Info struct.
void Info(const char *location, const char *msgfmt,...)
static bool CheckAllClasses(bool verbosity=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in any of th...
bool Check(TClass &classRef, bool verbose=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in the class...
The ROOT global object gROOT contains a list of all defined classes.
static bool Check(TClass &classRef, bool verbose=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in the class...
Registry()
Default constructor. Implemented in source file to allow hiding of the Info struct.
static char * Next()
Returns next class from sorted class table.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
Long64_t GetValue() const
std::map< UChar_t, std::list< Info > > fRegister
! Register of bits seen so far.
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.
const TEnumConstant * GetConstant(const char *name) const