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.00001f) {
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);
142 for (
auto constant : TRangeStaticCast<TEnumConstant>(*eStatusBits->
GetConstants())) {
145 bool intentionalDup = exceptionBits && exceptionBits->
GetConstant(constant->GetName());
153 if (reg.fOwner == &classRef) {
161 fRegister[bit].emplace_back(classRef, std::string(constant->GetName()), intentionalDup);
168 for (
auto base : TRangeStaticCast<TBaseClass>(*lb)) {
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;
196 for (
auto cursor : fRegister) {
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.
static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName)
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.
static bool Check(TClass &classRef, bool verbose=false)
R__EXTERN TClassTable * gClassTable
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
const TSeqCollection * GetConstants() const
virtual TObject * FindObject(const char *name) const
Delete a TObjLink object.
void RegisterBits(TClass &classRef)
static bool CheckAllClasses(bool verbosity=false)
void Info(const char *location, const char *msgfmt,...)
bool Check(TClass &classRef, bool verbose=false)
The ROOT global object gROOT contains a list of all defined classes.
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