12#ifndef ROOT_TCheckHashRecursiveRemoveConsistency
13#define ROOT_TCheckHashRecursiveRemoveConsistency
56 gROOT->GetListOfCleanups()->Add(
this);
67 if (!
gROOT->MustClean())
68 gROOT->GetListOfCleanups()->Remove(
this);
74 auto hashValue = obj->
Hash();
76 std::unique_lock<std::mutex> lock(
fMutex);
87 std::unique_lock<std::mutex> lock(
fMutex);
90 for (
auto p =
fCont.begin(); p !=
fCont.end(); ++p) {
91 if (p->fObjectPtr == obj) {
94 if (p->fRecordedHash == obj->
Hash())
105 std::unique_lock<std::mutex> lock(
fMutex);
107 for (
auto p =
fCont.begin(); p !=
fCont.end(); ++p) {
108 if (p->fObjectPtr == obj) {
126 auto size =
fCont.size();
137 if (
fCont.size() != size) {
157 TClass *baseCl = base->GetClassPointer();
187 TClass *baseCl = base->GetClassPointer();
224 constexpr const char *funcName =
"ROOT::Internal::TCheckHashRecursiveRemoveConsistency::CheckRecursiveRemove";
227 "The class %s overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor (seen while checking %s).",
230 ::Error(funcName,
"The class %s "
231 "or one of its base classes override TObject::Hash but does not call "
232 "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)
The ROOT global object gROOT contains a list of all defined classes.
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.
Bool_t HasDefaultConstructor() const
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
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
Set TObject::fBits and fStreamerType to cache information about the class.
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)
Namespace for new ROOT classes and functions.