12#ifndef ROOT_TCheckHashRecursiveRemoveConsistency
13#define ROOT_TCheckHashRecursiveRemoveConsistency
55 gROOT->GetListOfCleanups()->Add(
this);
66 if (!
gROOT->MustClean())
67 gROOT->GetListOfCleanups()->Remove(
this);
73 auto hashValue = obj->
Hash();
75 std::unique_lock<std::mutex> lock(
fMutex);
86 std::unique_lock<std::mutex> lock(
fMutex);
89 for (
auto p =
fCont.begin(); p !=
fCont.end(); ++p) {
90 if (p->fObjectPtr == obj) {
93 if (p->fRecordedHash == obj->
Hash())
104 std::unique_lock<std::mutex> lock(
fMutex);
106 for (
auto p =
fCont.begin(); p !=
fCont.end(); ++p) {
107 if (p->fObjectPtr == obj) {
125 auto size =
fCont.size();
136 if (
fCont.size() != size) {
156 TClass *baseCl = base->GetClassPointer();
186 TClass *baseCl = base->GetClassPointer();
223 constexpr const char *funcName =
"ROOT::Internal::TCheckHashRecursiveRemoveConsistency::CheckRecursiveRemove";
226 "The class %s overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor (seen while checking %s).",
229 ::Error(funcName,
"The class %s "
230 "or one of its base classes override TObject::Hash but does not call "
231 "TROOT::CallRecursiveRemoveIfNeeded in its destructor.\n",
TRangeStaticCast is an adaptater class that allows the typed iteration through a TCollection.
EResult HasConsistentHashMember(TClass &classRef)
EResult CheckRecursiveRemove(TClass &classRef)
void RecursiveRemove(TObject *obj)
Recursively remove this object from a list.
static bool Check(TClass &classRef)
TCheckHashRecursiveRemoveConsistency()
void SlowRemove(TObject *obj)
ClassDefInline(TCheckHashRecursiveRemoveConsistency, 0)
bool VerifyRecursiveRemove(TClass &classRef)
~TCheckHashRecursiveRemoveConsistency()
TClass * FindMissingRecursiveRemove(TClass &classRef)
bool VerifyRecursiveRemove(const char *classname)
TClass instances represent classes, structs and namespaces in the ROOT type system.
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
void * DynamicCast(const TClass *base, void *obj, Bool_t up=kTRUE)
Cast obj of this class type up to baseclass cl if up is true.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
Bool_t HasLocalHashMember() const
Returns true if this class has an definition and/or overload of the member function Hash.
Bool_t HasConsistentHashMember()
Return 'true' if we can guarantee that if this class (or any class in this class inheritance hierarch...
Long_t Property() const
Returns the properties of the TClass as a bit field stored as a Long_t value.
Bool_t HasDefaultConstructor(Bool_t testio=kFALSE) const
Return true if we have access to a constructor usable for I/O.
std::atomic< UChar_t > fRuntimeProperties
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.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual UInt_t GetUniqueID() const
Return the unique object id.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual ULong_t Hash() const
Return hash value for this object.
@ kIsReferenced
if object is referenced by a TRef or TRefArray
@ kMustCleanup
if object destructor must call RecursiveRemove()
void SetRequireCleanup(TObject &obj)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...