52 TRefTable::
TRefTable() : fNumPIDs(0), fAllocSize(0), fN(0), fParentIDs(0), fParentID(-1),
53 fDefaultSize(10), fUID(0), fUIDContext(0), fSize(0), fParents(0), fOwner(0)
62 fNumPIDs(0), fAllocSize(0), fN(0), fParentIDs(0), fParentID(-1),
63 fDefaultSize(size<10 ? 10 : size), fUID(0), fUIDContext(0), fSize(0), fParents(new
TObjArray(1)), fOwner(owner)
97 newsize = uid + uid / 2;
103 Error(
"Add",
"Cannot allocate space to store uid=%d", uid);
107 Error(
"Add",
"SetParent must be called before adding uid=%d", uid);
111 if (uid >=
fN[iid])
fN[iid] = uid + 1;
150 memset(
fN, 0,
sizeof(
Int_t) * fNumPIDs);
160 if (iid < 0)
return -1;
169 if (newsize < 0)
return newsize;
210 if (temp) memcpy(
fN, temp, oldNumPIDs *
sizeof(
Int_t));
240 std::vector<std::string>::const_iterator posPID
257 uid = uid & 0xFFFFFF;
258 if (uid < 0 || uid >=
fN[iid])
return 0;
261 if (pnumber < 0 || pnumber >= nparents)
return 0;
315 if (firstInt < 0) numIids = -firstInt;
323 if (startIid == -1) {
331 for (
Int_t iid = startIid; iid < numIids; ++iid) {
333 if (firstInt < 0) b >> newN;
334 else newN = firstInt;
363 if (branchID != -1) {
391 void TRefTable::Streamer(
TBuffer &R__b)
403 for (
Int_t i = 0; i < npid2; i++) {
405 for (
Int_t ipid = 0;ipid<npids;ipid++) {
Int_t fParentID
[fNumPIDs][fAllocSize] array of Parent IDs
virtual const char * GetTitle() const
Returns title of object.
static TProcessID * GetProcessID(UShort_t pid)
static function returning a pointer to TProcessID number pid in fgPIDs
virtual Int_t WriteClassBuffer(const TClass *cl, void *pointer)=0
virtual void Clear(Option_t *option="")
Remove all objects from the array.
static UInt_t GetNProcessIDs()
Return the (static) number of process IDs.
TObject * GetParent(Int_t uid, TProcessID *context=0) const
Return object corresponding to uid.
Buffer base class used for serializing objects.
virtual Int_t Add(Int_t uid, TProcessID *context=0)
Add a new uid to the table.
ClassImp(TRefTable) TRefTable
Default constructor for I/O.
Int_t GetEntriesFast() const
virtual void Clear(Option_t *="")
Clear all entries in the table.
static void SetRefTable(TRefTable *table)
Static function setting the current TRefTable.
void ExpandPIDs(Int_t numpids)
Expand the arrays of managed PIDs.
static TObjArray * GetPIDs()
static: returns array of TProcessIDs
virtual Bool_t Notify()
This method must be overridden to handle object notification.
Int_t * fN
[fNumPIDs] allocated size of array fParentIDs for each ProcessID
A TProcessID identifies a ROOT job in a unique way in time and space.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual UShort_t WriteProcessID(TProcessID *pid)=0
Always return 0 (current processID).
virtual TProcessID * GetLastProcessID(TRefTable *reftable) const =0
Int_t AddInternalIdxForPID(TProcessID *procid)
Add the internal index for fProcessIDs, fAllocSize, etc given a PID.
TObject * UncheckedAt(Int_t i) const
static TRefTable * fgRefTable
cache of pid to index in fProcessGUIDs
virtual ~TRefTable()
Destructor.
Int_t IndexOf(const TObject *obj) const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
virtual void Reset(Option_t *="")
Clear all entries in the table.
virtual void ReadBuffer(TBuffer &b)
Fill buffer b with the fN elements in fParentdIDs.
std::vector< Int_t > fMapPIDtoInternal
virtual Int_t ExpandForIID(Int_t iid, Int_t newsize)
Expand fParentIDs to newsize for internel ProcessID index iid.
std::vector< std::string > fProcessGUIDs
Int_t * fAllocSize
number of known ProcessIDs
virtual void ReadFastArray(Bool_t *b, Int_t n)=0
virtual void WriteFastArray(const Bool_t *b, Int_t n)=0
Int_t fDefaultSize
current parent ID in fParents (latest call to SetParent)
virtual Int_t ReadClassBuffer(const TClass *cl, void *pointer, const TClass *onfile_class=0)=0
static TRefTable * GetRefTable()
Static function returning the current TRefTable.
virtual Int_t Expand(Int_t pid, Int_t newsize)
Expand fParentIDs to newsize for ProcessID pid.
virtual Int_t SetParent(const TObject *parent, Int_t branchID)
– Set current parent object, typically a branch of a tree.
A TRefTable maintains the association between a referenced object and the parent object supporting th...
Int_t FindPIDGUID(const char *guid) const
Get fProcessGUIDs' index of the TProcessID with GUID guid.
Int_t GetEntries() const
Return the number of objects in array (i.e.
static TProcessID * GetSessionProcessID()
static function returning the pointer to the session TProcessID
virtual void FillBuffer(TBuffer &b)
Fill buffer b with the fN elements in fParentdIDs.
virtual UInt_t GetUniqueID() const
Return the unique object id.
Mother of all ROOT objects.
TObject * At(Int_t idx) const
Int_t ** fParentIDs
[fNumPIDs] current maximum number of IDs in array fParentIDs for each ProcessID
Int_t GetInternalIdxForPID(TProcessID *procid) const
Get the index for fProcessIDs, fAllocSize, etc given a PID.
virtual Bool_t Notify()
This function is called by TRef::Streamer or TStreamerInfo::ReadBuffer when reading a reference...