ROOT logo
ROOT » CORE » CONT » TObjectTable

class TObjectTable: public TObject


This class registers all instances of TObject and its derived
classes in a hash table. The Add() and Remove() members are called
from the TObject ctor and dtor, repectively. Using the Print()
member one can see all currently active objects in the system.
Using the resource (in .rootrc): Root.ObjectStat one can toggle this
feature on or off.
Using the compile option R__NOSTATS one can de-active this feature
for the entire system (for maximum performance in highly time
critical applications).

 The following output has been produced in a ROOT interactive session
 via the command gObjectTable->Print()
   class                     cnt    on heap     size    total size    heap size

   TKey                        4          4       72           288          288
   TClass                     84         84       80          6720         6720
   TDataMember               276        276       24          6624         6624
   TObject                    11         11       12           132          132
   TMethod                  1974       1974       64        126336       126336
   TDataType                  34         34       56          1904         1904
   TList                    2328       2328       36         83808        83808
   TH1F                        1          1      448           448          448
   TText                    2688       2688       56        150528       150528
   TGaxis                      1          0      120           120            0
   TAxis                       6          3       88           528          264
   TBox                       57         57       52          2964         2964
   TLine                     118        118       40          4720         4720
   TWbox                       1          1       56            56           56
   TArrow                      1          1       64            64           64
   TPaveText                  59         59      124          7316         7316
   TPave                       1          1       92            92           92
   TFile                       1          1      136           136          136
   TCanvas                     3          3      444          1332         1332
   TPad                        1          1      312           312          312
   TContextMenu                3          3       48           144          144
   TMethodArg               2166       2166       44         95304        95304
   TPaveLabel                  1          1      120           120          120
   THtml                       1          1       32            32           32
   TROOT                       1          0      208           208            0
   TApplication                1          1       28            28           28
   TFileHandler                1          1       20            20           20
   TColor                    163        163       40          6520         6520
   TStyle                      1          1      364           364          364
   TRealData                 117        117       28          3276         3276
   TBaseClass                 88         88       36          3168         3168
   THashList                   5          5       40           200          200
   THashTable                  5          5       36           180          180
   TGeometry                   1          1       64            64           64
   TLink                       7          7       60           420          420
   TPostScript                 1          1      764           764          764
   TMinuit                     1          1      792           792          792
   TStopwatch                  1          0       56            56            0
   TRootGuiFactory             1          1       28            28           28
   TGX11                       1          1      172           172          172
   TUnixSystem                 1          1      252           252          252
   TSignalHandler              1          1       20            20           20
   TOrdCollection              3          3       40           120          120
   TEnv                        1          1       24            24           24
   TCint                       1          1      208           208          208
   TBenchmark                  1          1       52            52           52
   TClassTable                 1          1       12            12           12
   TObjectTable                1          1       12            12           12

   Total:                  10225      10219     5976        506988       506340


Function Members (Methods)

public:
TObjectTable(Int_t tableSize = 100)
virtual~TObjectTable()
voidTObject::AbstractMethod(const char* method) const
voidAdd(TObject* obj)
static voidAddObj(TObject* obj)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
void*CheckPtrAndWarn(const char* msg, void* vp)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(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 voidDelete(Option_t* opt = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
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 voidTObject::Fatal(const char* method, const char* msgfmt) const
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
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tGetSize() const
virtual const char*TObject::GetTitle() 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() constMENU
Int_tInstances() const
voidInstanceStatistics() 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_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
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)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
Bool_tPtrIsValid(TObject* op)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidRemove(TObject* obj)
voidRemoveQuietly(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
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 = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector&)
voidStatistics()
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
voidTerminate()
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
voidUpdateInstCount() 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:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()

Data Members

private:
Int_tfSize
TObject**fTable
Int_tfTally

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TObjectTable(Int_t tableSize = 100)
 Create an object table.
~TObjectTable()
void Print(Option_t* option = "") const
 Print the object table.
 If option ="all" prints the list of all objects with the format
 object number, pointer, class name, object name
void Add(TObject* obj)
 Add an object to the object table.
void AddObj(TObject* obj)
 Add an object to the global object table gObjectTable. If the global
 table does not exist create it first. This member function may only
 be used by TObject::TObject. Use Add() to add objects to any other
 TObjectTable object. This is a static function.
void Delete(Option_t* opt = "")
 Delete all objects stored in the TObjectTable.
void Remove(TObject* obj)
 Remove an object from the object table.
void RemoveQuietly(TObject* obj)
 Remove an object from the object table. If op is 0 or not in the table
 don't complain. Currently only used by the TClonesArray dtor. Should not
 be used anywhere else, except in places where "special" allocation and
 de-allocation tricks are performed.
void Terminate()
 Deletes the object table (this static class function calls the dtor).
Int_t FindElement(TObject* obj)
 Find an object in the object table. Returns the slot where to put
 the object. To test if the object is actually already in the table
 use PtrIsValid().
void FixCollisions(Int_t index)
 Rehash the object table in case an object has been removed.
void Expand(Int_t newsize)
 Expand the object table.
void InstanceStatistics() const
 Print the object table.
void UpdateInstCount() const
 Histogram all objects according to their classes.
void * CheckPtrAndWarn(const char* msg, void* vp)
 Issue a warning in case an object still appears in the table
 while it should not.
Bool_t HighWaterMark()
{ return (Bool_t) (fTally >= ((3*fSize)/4)); }
Bool_t PtrIsValid(TObject* op)
{ return fTable[FindElement(op)] != 0; }
TObjectTable(const TObjectTable& )
TObjectTable& operator=(const TObjectTable& )
Int_t GetSize() const
{ return fSize; }
Int_t Instances() const
{ return fTally; }
void Statistics()
{ Print(); }