library: libCore
#include "TRefTable.h"

TRefTable


class description - header file - source file - inheritance tree (.pdf)

class TRefTable : public TObject

Inheritance Chart:
TObject
<-
TRefTable

    protected:
Int_t AddInternalIdxForPID(TProcessID* procid) virtual Int_t ExpandForIID(Int_t iid, Int_t newsize) void ExpandPIDs(Int_t numpids) Int_t FindPIDGUID(const char* guid) const Int_t GetInternalIdxForPID(TProcessID* procid) const Int_t GetInternalIdxForPID(Int_t pid) const public:
TRefTable() TRefTable(TObject* owner, Int_t size) TRefTable(const TRefTable&) virtual ~TRefTable() virtual Int_t Add(Int_t uid, TProcessID* context = 0) static TClass* Class() virtual void Clear(Option_t* = "") virtual Int_t Expand(Int_t pid, Int_t newsize) virtual void FillBuffer(TBuffer& b) Int_t GetN(Int_t pid) const Int_t GetNumPIDs() const TObject* GetOwner() const TObject* GetParent(Int_t uid, TProcessID* context = 0) const TObjArray* GetParents() const static TRefTable* GetRefTable() Int_t GetSize(Int_t pid) const UInt_t GetUID() const TProcessID* GetUIDContext() const virtual TClass* IsA() const virtual Bool_t Notify() TRefTable& operator=(const TRefTable&) virtual void ReadBuffer(TBuffer& b) virtual void Reset(Option_t* = "") virtual Int_t SetParent(const TObject* parent) static void SetRefTable(TRefTable* table) virtual void SetUID(UInt_t uid, TProcessID* context = 0) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members


    protected:
Int_t fNumPIDs !number of known ProcessIDs Int_t* fAllocSize ![fNumPIDs] allocated size of array fParentIDs for each ProcessID Int_t* fN ![fNumPIDs] current maximum number of IDs in array fParentIDs for each ProcessID Int_t** fParentIDs ![fNumPIDs][fAllocSize] array of Parent IDs Int_t fParentID !current parent ID in fParents (latest call to SetParent) Int_t fDefaultSize !default size for a new PID array UInt_t fUID !Current uid (set by TRef::GetObject) TProcessID* fUIDContext !TProcessID the current uid is referring to Int_t fSize dummy for backward compatibility TObjArray* fParents array of Parent objects (eg TTree branch) holding the referenced objects TObject* fOwner Object owning this TRefTable vector<std::string> fProcessGUIDs UUIDs of TProcessIDs used in fParentIDs vector<Int_t> fMapPIDtoInternal ! cache of pid to index in fProcessGUIDs static TRefTable* fgRefTable Pointer to current TRefTable public:
static const enum TRefTable:: kHaveWarnedReadingOld

Class Description

                                                                      
 A TRefTable maintains the association between a referenced object    
 and the parent object supporting this referenced object.             
                                                                      
 The parent object is typically a branch of a TTree. For each object  
 referenced in a TTree entry, the corresponding entry in the TTree's  
 TBranchRef::fRefTable contains the index of the branch that          
 needs to be loaded to bring the object into memory.                  
                                                                      
 Persistency of a TRefTable is split into two parts:                  
 * entry specific information is stored (read) by FillBuffer          
   (ReadBuffer). For each referenced object the object's fUniqueID    
   and the referencing TRef::fPID is stored (to allow the TRefTable   
   to autoload references created by different processes).            
 * non-entry specific, i.e. global information is stored (read) by    
   the Streamer function. This comprises all members marked as        
   persistent.                                                        
                                                                      
 As TObject::fUniqueID is only unique for a given TProcessID, a table 
 of unique IDs is kept for each used TProcessID. There is no natural  
 order of TProcessIDs, so TRefTable stores a vector of the TGUID of   
 all known TProcessIDs in fProcessGUIDs; the index of a TProcessID in 
 this vector defines the index of the auto-loading info in fParentIDs 
 for that TProcessID. The mapping of TProcessID* to index is cached   
 for quick non-persistent lookup.                                     
                                                                      

TRefTable()
 Default constructor for I/O.
TRefTable(TObject *owner, Int_t size)
 Create a TRefTable with initial size.
~TRefTable()
 Destructor.
Int_t Add(Int_t uid, TProcessID *context)
 Add a new uid to the table.
 we add a new pair (uid,fparent) to the map
 This function is called by TObject::Streamer or TStreamerInfo::WriteBuffer
Int_t AddInternalIdxForPID(TProcessID *procid)
 Add the internal index for fProcessIDs, fAllocSize, etc given a PID.
Int_t Expand(Int_t pid, Int_t newsize)
 Expand fParentIDs to newsize for ProcessID pid.
Int_t ExpandForIID(Int_t iid, Int_t newsize)
 Expand fParentIDs to newsize for internel ProcessID index iid.
void ExpandPIDs(Int_t numpids)
 Expand the arrays of managed PIDs
void FillBuffer(TBuffer & b)
 Fill buffer b with the fN elements in fParentdIDs.
 This function is called by TBranchRef::FillLeaves.
Int_t FindPIDGUID(const char *guid)
 Get fProcessGUIDs' index of the TProcessID with GUID guid
Int_t GetInternalIdxForPID(TProcessID *procid)
 Get the index for fProcessIDs, fAllocSize, etc given a PID.
 Uses fMapPIDtoInternal and the pid's GUID / fProcessGUID
Int_t GetInternalIdxForPID(Int_t pid)
 Get the index for fProcessIDs, fAllocSize, etc given a PID.
 Uses fMapPIDtoInternal and the pid's GUID / fProcessGUID
TRefTable * GetRefTable()
 Static function returning the current TRefTable.
Bool_t Notify()
 This function is called by TRef::Streamer or TStreamerInfo::ReadBuffer
 when reading a reference.
 This function, in turns, notifies the TRefTable owner for action.
 eg, when the owner is a TBranchRef, TBranchRef::Notify is called
 to read the branch containing the referenced object.
void ReadBuffer(TBuffer &b)
 Fill buffer b with the fN elements in fParentdIDs.
 This function is called by TBranchRef::ReadLeaves
Int_t SetParent(const TObject *parent)
 Set Current parent object.
 The parent object is typically a branch of a Tree.
 This function is called by TBranchElement::Fill.
void SetRefTable(TRefTable *table)
 Static function setting the current TRefTable.
TRefTable()
void Clear(Option_t * /*option*/ ="")
Int_t GetNumPIDs()
Int_t GetSize(Int_t pid)
Int_t GetN(Int_t pid)
UInt_t GetUID()
void Reset(Option_t * /* option */ ="")
void SetUID(UInt_t uid, TProcessID* context = 0)

Author: Rene Brun 28/09/2001
Last update: root/cont:$Name: $:$Id: TRefTable.cxx,v 1.12 2006/05/14 08:25:47 brun Exp $
Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.