84 std::atomic_flag_clear( &
fLock );
102 if (current && current->second ==
this) {
120 ::Warning(
"TProcessID::AddProcessID",
"Maximum number of TProcessID (65535) is almost reached (one left). TRef will stop being functional when the limit is reached.");
122 ::Fatal(
"TProcessID::AddProcessID",
"Maximum number of TProcessID (65535) has been reached. TRef are not longer functional.");
139 snprintf(name,20,
"ProcessID%d",apid);
193 while (
fLock.test_and_set(std::memory_order_acquire));
195 fLock.clear(std::memory_order_release);
266 Int_t pid = (uid>>24)&0xff;
277 if (current && current->first == pid)
278 return current->second;
332 Int_t uid = uidd & 0xffffff;
391 if ( (obj->
GetUniqueID()&0xff000000)==0xff000000 ) {
421 (*fObjects)[uid] = 0;
static TProcessID * GetPID()
static: returns pointer to current TProcessID
static TProcessID * GetProcessID(UShort_t pid)
static function returning a pointer to TProcessID number pid in fgPIDs
virtual UInt_t GetUniqueID() const
Return the unique object id.
ROOT::Internal::TAtomicPointer< TObjArray * > fObjects
Reference count to this object (from TFile)
virtual void RecursiveRemove(TObject *obj)
called by the object destructor remove reference to obj from the current table if it is referenced ...
void PutObjectWithID(TObject *obj, UInt_t uid=0)
stores the object at the uid th slot in the table of objects The object uniqued is set as well as its...
void Remove(ULong64_t hash, Long64_t key)
Remove entry with specified key from the TExMap.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
static UInt_t GetNProcessIDs()
Return the (static) number of process IDs.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual ~TProcessID()
Destructor.
virtual TObject * Remove(TObject *obj)
Remove object from array.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
R__EXTERN TVirtualMutex * gROOTMutex
TObject * At(Int_t idx) const
static std::atomic< TProcessID * > gIsValidCache
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
This class defines a UUID (Universally Unique IDentifier), also known as GUIDs (Globally Unique IDent...
#define R__LOCKGUARD_IMT(mutex)
static TObjArray * GetPIDs()
static: returns array of TProcessIDs
static TObjArray * fgPIDs
static TProcessID * fgPID
Spin lock for initialization of fObjects.
std::pair< Int_t, TProcessID * > PIDCacheContent_t
#define R__WRITE_LOCKGUARD(mutex)
static std::atomic_uint fgNumber
static void SetObjectCount(UInt_t number)
static function to set the current referenced object count fgNumber is incremented every time a new o...
R__EXTERN TVirtualRWMutex * gCoreMutex
static ULong_t Void_Hash(const void *ptr)
Return hash value for this object.
A TProcessID identifies a ROOT job in a unique way in time and space.
static void Cleanup()
static function (called by TROOT destructor) to delete all TProcessIDs
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
#define R__READ_LOCKGUARD(mutex)
Int_t GetLast() const
Return index of last object in array.
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
static TProcessID * GetProcessWithUID(const TObject *obj)
static function returning a pointer to TProcessID with its pid encoded in the highest byte of obj->Ge...
TProcessID()
Default constructor.
std::atomic_flag fLock
Array pointing to the referenced objects.
Int_t IncrementCount()
Increase the reference count to this object.
Int_t GetEntriesFast() const
Int_t DecrementCount()
The reference fCount is used to delete the TProcessID in the TFile destructor when fCount = 0...
static TProcessID * AddProcessID()
Static function to add a new TProcessID to the list of PIDs.
if object destructor must call RecursiveRemove()
TObject * GetObjectWithID(UInt_t uid)
returns the TObject with unique identifier uid in the table of objects
void CheckInit()
Initialize fObjects.
TObject * UncheckedAt(Int_t i) const
static TExMap * fgObjPIDs
virtual void Clear(Option_t *option="")
delete the TObjArray pointing to referenced objects this function is called by TFile::Close("R") ...
Int_t IndexOf(const TObject *obj) const
unsigned long long ULong64_t
static TProcessID * GetSessionProcessID()
static function returning the pointer to the session TProcessID
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
Mother of all ROOT objects.
static UInt_t AssignID(TObject *obj)
static function returning the ID assigned to obj If the object is not yet referenced, its kIsReferenced bit is set and its fUniqueID set to the current number of referenced objects so far.
if object is referenced by a TRef or TRefArray
static UInt_t GetObjectCount()
Return the current referenced object count fgNumber is incremented every time a new object is referen...
Int_t GetEntries() const
Return the number of objects in array (i.e.
static Bool_t IsValid(TProcessID *pid)
static function. return kTRUE if pid is a valid TProcessID
static std::atomic< PIDCacheContent_t * > gGetProcessWithUIDCache
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
This class stores a (key,value) pair using an external hash.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.