TStatusBitsChecker::Check and TStatusBitsChecker::CheckAllClasses will determine if the set of "status bit" declared in the class and its base classes presents any overlap.
The status bit are declared in a given class by declaring an enum type named EStatusBits. If some of the duplication is intentional, those duplication can be registered in an enum type named EStatusBitsDupExceptions.
~~~ {.cpp} // TStreamerElement status bits enum EStatusBits { kHasRange = BIT(6), kCache = BIT(9), kRepeat = BIT(10), kRead = BIT(11), kWrite = BIT(12), kDoNotDelete = BIT(13), kWholeObject = BIT(14) };
enum class EStatusBitsDupExceptions { // This bit duplicates TObject::kInvalidObject. As the semantic of kDoNotDelete is a persistent, // we can not change its value without breaking forward compatibility. // Furthermore, TObject::kInvalidObject and its semantic is not (and should not be) // used in TStreamerElement kDoNotDelete = TStreamerElement::kDoNotDelete,
// This bit duplicates TObject::kCannotPick. As the semantic of kHasRange is a persistent, // we can not change its value without breaking forward compatibility. // Furthermore, TObject::kCannotPick and its semantic is not (and should not be) // used in TStreamerElement kHasRange = TStreamerElement::kHasRange }; ~~~ {.cpp}
Without the EStatusBitsDupExceptions enum you would see
~~~ {.cpp} TStatusBitsChecker::Check("TStreamerElement");
Error in <TStatusBitsChecker>
: In TStreamerElement class hierarchy, there are duplicates bits: Error in <TStatusBitsChecker>
: Bit 6 used in TStreamerElement as kHasRange Error in <TStatusBitsChecker>
: Bit 6 used in TObject as kCannotPick Error in <TStatusBitsChecker>
: Bit 13 used in TStreamerElement as kDoNotDelete Error in <TStatusBitsChecker>
: Bit 13 used in TObject as kInvalidObject ~~~ {.cpp}