TObject
class description - source file - inheritance tree
protected:
void MakeZombie()
public:
TObject TObject()
TObject TObject(TObject& object)
virtual void ~TObject()
void AbstractMethod(char* method)
void AppendPad(Option_t* option)
virtual void Browse(TBrowser* b)
TClass* Class()
virtual const Text_t* ClassName()
virtual void Clear(Option_t*)
virtual TObject* Clone()
virtual void Close(Option_t* option)
virtual Int_t Compare(TObject* obj)
virtual void Copy(TObject& object)
Int_t DecreaseDirLevel()
virtual void Delete(Option_t* option)
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
virtual void Draw(Option_t* option)
virtual void DrawClass()
virtual void DrawClone(Option_t* option)
virtual void Dump()
void Error(char* method, char* msgfmt, int)
virtual void Execute(Text_t* method, Text_t* params)
virtual void Execute(TMethod* method, TObjArray* params)
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
void Fatal(char* method, char* msgfmt, int)
Int_t GetDirLevel()
virtual Option_t* GetDrawOption()
Long_t GetDtorOnly()
virtual const Text_t* GetIconName()
virtual const Text_t* GetName()
virtual Text_t* GetObjectInfo(Int_t px, Int_t py)
Bool_t GetObjectStat()
virtual Option_t* GetOption()
virtual const Text_t* GetTitle()
virtual UInt_t GetUniqueID()
virtual Bool_t HandleTimer(TTimer* timer)
virtual ULong_t Hash()
Int_t IncreaseDirLevel()
void IndentLevel()
virtual Bool_t InheritsFrom(Text_t* classname)
virtual Bool_t InheritsFrom(TClass* cl)
virtual void Inspect()
void InvertBit(UInt_t f)
virtual Bool_t Is3D()
virtual TClass* IsA()
virtual Bool_t IsEqual(TObject* obj)
virtual Bool_t IsFolder()
virtual Bool_t IsModified()
Bool_t IsOnHeap()
virtual Bool_t IsSortable()
Bool_t IsZombie()
virtual void ls(Option_t* option)
void MayNotUse(char* method)
virtual void Modified(Bool_t flag = kTRUE)
void operator delete(void* ptr)
void* operator new(size_t sz)
void* operator new(size_t sz, void* vp)
TObject& operator=(TObject& rhs)
virtual void Paint(Option_t* option)
virtual void Pop()
virtual void Print(Option_t* option)
virtual void Read(Text_t* name)
virtual void RecursiveRemove(TObject* obj)
void ResetBit(UInt_t f)
virtual void SavePrimitive(ofstream& out, Option_t* option)
void SetBit(UInt_t f, Bool_t set)
void SetBit(UInt_t f)
void SetDirLevel(Int_t level = 0)
virtual void SetDrawOption(Option_t* option)
void SetDtorOnly(void* obj)
void SetObjectStat(Bool_t stat)
virtual void SetUniqueID(UInt_t uid)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Sizeof3D()
virtual void Streamer(TBuffer& b)
void SysError(char* method, char* msgfmt, int)
Bool_t TestBit(UInt_t f)
virtual void UseCurrentStyle()
void Warning(char* method, char* msgfmt, int)
virtual void Write(Text_t* name = 0, Int_t option = 0, Int_t bufsize = 0)
private:
UInt_t fUniqueID object unique identifier
UInt_t fBits bit field status word
static Long_t fgDtorOnly object for which to call dtor only (i.e. no delete)
static Int_t fgDirLevel indentation level for ls()
static Bool_t fgObjectStat if true keep track of objects in TObjectTable
public:
static const enum TObject:: kIsOnHeap
static const enum TObject:: kNotDeleted
static const enum TObject:: kZombie
static const enum TObject:: kBitMask
static const enum TObject:: kSingleKey
static const enum TObject:: kOverwrite
See also
-
Event, TApplication, TBox, TBuffer, TClassTable, TCollection, TDictionary, TEllipse, TEnv, TExMap, TFree, TGClient, TGLayoutHints, TGLayoutManager, TGMimeTypes, TGObject, TGPicture, TGPicturePool, THtml, TInetAddress, TLazyMatrix, TLego, TLine, TLorentzRotation, TLorentzVector, TMCParticle, TMapFile, TMarker, TMarker3DBox, TMatrix, TMatrixColumn, TMatrixDiag, TMatrixRow, TMethodCall, TMonitor, TNamed, TObjString, TObjectTable, TPacketGenerator, TParticle, TPoints3DABC, TPolyLine, TPolyLine3D, TPolyMarker, TPolyMarker3D, TPrimary, TProof, TRealData, TRotation, TSlave, TStopwatch, TSysEvtHandler, TUrl, TVector, TVector2, TVector3, TView, Track
TObject
Mother of all ROOT objects.
The TObject class provides default behaviour and protocol for all
objects in the ROOT system. It provides protocol for object I/O,
error handling, sorting, inspection, printing, drawing, etc.
Every object which inherits from TObject can be stored in the
ROOT collection classes.
TObject()
TObject constructor. It sets the two data words of TObject to their
initial values. The unique ID is set to 0 and the status word is
set depending if the object is created on the stack or allocated
on the heap. Of the status word the high 8 bits are reserved for
system usage and the low 24 bits are user settable. Depending on
the ROOT environment variable "Root.MemStat" (see TEnv.h) the object
is added to the global TObjectTable for bookkeeping.
TObject(const TObject &obj)
TObject copy ctor.
void Copy(TObject &obj)
Copy this to obj.
~TObject()
TObject destructor. Removes object from all canvases and object browsers
iff observer bit is on and remove from the global object table.
void AppendPad(Option_t *option)
Append graphics object to current pad. In case no current pad is set
yet, create a default canvas with the name "c1".
void Browse(TBrowser *)
Browse object (by default we inspect). May be overridden for other default action
const Text_t* ClassName() const
Returns name of class to which the object belongs.
TObject* Clone()
Make a clone of an object using the Streamer facility.
void Close(Option_t *)
Close abstract method. Must be overridden in case an object needs to
to something in case it is being removed from collections.
Int_t Compare(TObject *)
Compare abstract method. Must be overridden if a class wants to be able
to compare itself with other objects. Must return -1 if this is smaller
than obj, 0 if objects are equal and 1 if this is larger than obj.
void Delete(Option_t *)
Delete this object. Typically called as a command via the interpreter.
Normally use "delete" operator.
Int_t DistancetoPrimitive(Int_t, Int_t)
Computes distance from point (px,py) to the object.
This member function must be implemented for each graphics primitive.
This default function returns a big number (999999).
void Draw(Option_t *option)
Default Draw method for all objects
void DrawClass()
Draw class inheritance tree of the class to which this object belongs.
If a class B inherits from a class A, description of B is drawn
on the right side of description of A.
Member functions overridden by B are shown in class A with a blue line
crossing-out the corresponding member function.
The following picture is the class inheritance tree of class TPaveLabel:
/*
*/
void DrawClone(Option_t *option)
Draw a clone of this object in the current pad
void Dump()
Dump contents of object on stdout.
Using the information in the object dictionary (class TClass)
each data member is interpreted.
If a data member is a pointer, the pointer value is printed
The following output is the Dump of a TArrow object:
fAngle 0 Arrow opening angle (degrees)
fArrowSize 0.2 Arrow Size
fOption.*fData
fX1 0.1 X of 1st point
fY1 0.15 Y of 1st point
fX2 0.67 X of 2nd point
fY2 0.83 Y of 2nd point
fUniqueID 0 object unique identifier
fBits 50331648 bit field status word
fLineColor 1 line color
fLineStyle 1 line style
fLineWidth 1 line width
fFillColor 19 fill area color
fFillStyle 1001 fill area style
void Execute(Text_t *method, Text_t *params)
Execute method on this object with the given parameter string, e.g.
"3.14,1,"text"".
void Execute(TMethod *method, TObjArray *params)
Execute method on this object with parameters stored in the TObjArray.
The TObjArray should contain an argv vector like:
argv[0] ... argv[n] = the list of TObjString parameters
void ExecuteEvent(Int_t, Int_t, Int_t)
Execute action corresponding to an event at (px,py). This method
must be overridden if an object can react to graphics events.
Option_t* GetDrawOption() const
Get option used by the graphics system to draw this object.
const Text_t* GetName() const
Returns name of object. This default method returns the class name.
Classes that give objects a name should override this method.
const Text_t* GetIconName() const
Returns mime type name of object. Used by the TBrowser (via TGMimeTypes
class). Override for class of which you would like to have different
icons for objects of the same class.
UInt_t GetUniqueID() const
Return the unique object id.
Text_t* GetObjectInfo(Int_t px, Int_t py)
Returns string containing info about the object at position (px,py).
This method is typically overridden by classes of which the objects
can report peculiarities for different positions.
Returned string will be re-used (lock in MT environment).
const Text_t* GetTitle() const
Returns title of object. This default method returns the class title
(i.e. description). Classes that give objects a title should override
this method.
Bool_t HandleTimer(TTimer *)
Execute action corresponding to an event at (px,py). This method
must be overridden if an object can react to graphics events.
ULong_t Hash()
Return hash value for this object.
Bool_t InheritsFrom(const Text_t *classname)
Returns kTRUE if object inherits from class "classname".
Bool_t InheritsFrom(const TClass *cl)
Returns kTRUE if object inherits from TClass cl.
void Inspect()
Dump contents of this object in a graphics canvas.
Same action as Dump but in a graphical form.
In addition pointers to other objects can be followed.
The following picture is the Inspect of a histogram object:
/*
*/
Bool_t IsFolder()
Returns kTRUE in case object contains browsable objects (like containers
or lists of other objects).
Bool_t Is3D()
Returns kTRUE in case object is a 3D graphics object, in which case
it can be displayed in a 3D viewer (like X3D or OpenGL).
Bool_t IsEqual(TObject *obj)
Default equal comparison (objects are equal if they have the same
address in memory). More complicated classes might want to override
this function.
void ls(Option_t *)
The ls function lists the contents of a class on stdout. Ls output
is typically much less verbose then Dump().
void Paint(Option_t *)
This method must be overridden if a class wants to paint itself.
The difference between Paint() and Draw() is that when a object
draws itself it is added to the display list of the pad in
which it is drawn (and automatically redrawn whenever the pad is
redrawn). While paint just draws the object without adding it to
the pad display list.
void Pop()
Pop on object drawn in a pad to the top of the display list. I.e. it
will be drawn last and on top of all other primitives.
void Print(Option_t *)
This method must be overridden when a class wants to print itself.
void Read(const Text_t *name)
Read contents of object with specified name from the current directory.
First the key with the given name is searched in the current directory,
next the key buffer is deserialized into the object.
The object must have been created before via the default constructor.
See TObject::Write().
void RecursiveRemove(TObject *)
Recursively remove this object from a list. Typically implemented
by classes that can contain mulitple references to a same object.
void SavePrimitive(ofstream &out, Option_t *)
Save a primitive as a C++ statement(s) on output stream "out".
void SetDrawOption(Option_t *option)
Set drawing option for object. This option only affects
the drawing style and is stored in the option field of the
TObjOptLink supporting a TPad's primitive list (TList).
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
void SetUniqueID(UInt_t uid)
Set the unique object id.
void Sizeof3D() const
Set total size of this 3D object (used by X3D interface).
void UseCurrentStyle()
Set current style settings in this object
This function is called when either TCanvas::UseCurrentStyle
or TROOT::ForceStyle have been invoked.
void Write(const Text_t *name, Int_t option, Int_t bufsize)
Write this object to the current directory
The data structure corresponding to this object is serialized.
The corresponding buffer is written to the current directory
with an associated key with name "name".
Writing an object to a file involves the following steps:
-Creation of a support TKey object in the current directory.
The TKey object creates a TBuffer object.
-The TBuffer object is filled via the class::Streamer function.
-If the file is compressed (default) a second buffer is created to
hold the compressed buffer.
-Reservation of the corresponding space in the file by looking
in the TFree list of free blocks of the file.
-The buffer is written to the file.
Bufsize can be given to force a given buffer size to write this object.
By default, the buffersize will be taken from the average buffer size
of all objects written to the current file so far.
If a name is specified, it will be the name of the key.
If name is not given, the name of the key will be the name as returned
by GetName().
The option can be a combination of:
kSingleKey and kOverwrite
Using the kOverwrite option a previous key with the same name is
overwritten.
The kSingleKey option is only used by TCollection::Write() to write
a container with a single key instead of each object in the container
with its own key.
An object is read from the file into memory via TKey::Read() or
via TObject::Read().
void Warning(const char *location, const char *va_(fmt), ...) const
Issue warning message. Use "location" to specify the method where the
warning occured. Accepts standard printf formatting arguments.
void Error(const char *location, const char *va_(fmt), ...) const
Issue error message. Use "location" to specify the method where the
error occured. Accepts standard printf formatting arguments.
void SysError(const char *location, const char *va_(fmt), ...) const
Issue system error message. Use "location" to specify the method where
the system error occured. Accepts standard printf formatting arguments.
void Fatal(const char *location, const char *va_(fmt), ...) const
Issue fatal error message. Use "location" to specify the method where the
fatal error occured. Accepts standard printf formatting arguments.
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't
want to leave purely abstract.
void MayNotUse(const char *method) const
Use this method to signal that a method (defined in a base class)
may not be called in a derived class (in principle against good
design since a child class should not provide less functionality
than its parent, however, sometimes it is necessary).
Bool_t GetObjectStat()
Get status of object stat flag.
void SetObjectStat(Bool_t stat)
Turn on/off tracking of objects in the TObjectTable.
void IndentLevel()
Functions used by ls() to indent an object hierarchy.
Int_t GetDirLevel()
Int_t DecreaseDirLevel()
Int_t IncreaseDirLevel()
void SetDirLevel(Int_t level)
Long_t GetDtorOnly()
void SetDtorOnly(void *obj)
Inline Functions
void MakeZombie()
TObject& operator=(TObject& rhs)
void Clear(Option_t*)
Option_t* GetOption()
Bool_t IsSortable()
Bool_t IsModified()
Bool_t IsOnHeap()
Bool_t IsZombie()
void Modified(Bool_t flag = kTRUE)
void* operator new(size_t sz)
void* operator new(size_t sz, void* vp)
void operator delete(void* ptr)
void SetBit(UInt_t f)
void ResetBit(UInt_t f)
Bool_t TestBit(UInt_t f)
void InvertBit(UInt_t f)
TClass* Class()
TClass* IsA()
void ShowMembers(TMemberInspector& insp, char* parent)
void Streamer(TBuffer& b)
Author: Rene Brun 26/12/94
Last update: 2.22/04 01/06/99 19.05.39 by Fons Rademakers
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *
ROOT page - Class index - 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.