library: libCore
#include "TRefTable.h"

TRefTable


class description - header file - source file
viewCVS header - viewCVS source

class TRefTable: public TObject

Inheritance Inherited Members Includes Libraries
Class Charts

Function Members (Methods)

Display options:
Show inherited
Show non-public
public:
TRefTable()
TRefTable(const TRefTable&)
TRefTable(TObject* owner, Int_t size)
virtual~TRefTable()
voidTObject::AbstractMethod(const char* method) const
virtual Int_tAdd(Int_t uid, TProcessID* context = 0)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual Int_tExpand(Int_t pid, Int_t newsize)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidFillBuffer(TBuffer& b)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
Int_tGetN(Int_t pid) const
virtual const char*TObject::GetName() const
Int_tGetNumPIDs() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TObject*GetOwner() const
TObject*GetParent(Int_t uid, TProcessID* context = 0) const
TObjArray*GetParents() const
static TRefTable*GetRefTable()
Int_tGetSize(Int_t pid) const
virtual const char*TObject::GetTitle() const
UInt_tGetUID() const
TProcessID*GetUIDContext() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tNotify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TRefTable&operator=(const TRefTable&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidReadBuffer(TBuffer& b)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidReset(Option_t* = "")
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual Int_tSetParent(const TObject* parent)
static voidSetRefTable(TRefTable* table)
virtual voidSetUID(UInt_t uid, TProcessID* context = 0)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = "0", Int_t option = 0, Int_t bufsize = 0) const
protected:
Int_tAddInternalIdxForPID(TProcessID* procid)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual Int_tExpandForIID(Int_t iid, Int_t newsize)
voidExpandPIDs(Int_t numpids)
Int_tFindPIDGUID(const char* guid) const
Int_tGetInternalIdxForPID(TProcessID* procid) const
Int_tGetInternalIdxForPID(Int_t pid) const
voidTObject::MakeZombie()

Data Members

public:
enum { kHaveWarnedReadingOld
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
Int_tfNumPIDs!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_tfParentID!current parent ID in fParents (latest call to SetParent)
Int_tfDefaultSize!default size for a new PID array
UInt_tfUID!Current uid (set by TRef::GetObject)
TProcessID*fUIDContext!TProcessID the current uid is referring to
Int_tfSizedummy for backward compatibility
TObjArray*fParentsarray of Parent objects (eg TTree branch) holding the referenced objects
TObject*fOwnerObject owning this TRefTable
vector<std::string>fProcessGUIDsUUIDs of TProcessIDs used in fParentIDs
vector<Int_t>fMapPIDtoInternal! cache of pid to index in fProcessGUIDs
static TRefTable*fgRefTablePointer to current TRefTable

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.
void Clear(Option_t * /*option*/ )
 Clear all entries in the table.
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
TObject * GetParent(Int_t uid, TProcessID *context /* =0 */ )
 Return object corresponding to uid.
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
void Reset(Option_t * /*option*/ )
 Clear all entries in the table.
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()
Int_t GetNumPIDs()
{return fNumPIDs;}
Int_t GetSize(Int_t pid)
{return fAllocSize[GetInternalIdxForPID(pid)];}
Int_t GetN(Int_t pid)
{return fN[GetInternalIdxForPID(pid)];}
TObject * GetOwner()
{return fOwner;}
TObjArray * GetParents()
{return fParents;}
UInt_t GetUID()
{return fUID;}
TProcessID * GetUIDContext()
{return fUIDContext;}
void SetUID(UInt_t uid, TProcessID* context = 0)
{fUID=uid; fUIDContext = context;}

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.