Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TObject.h
Go to the documentation of this file.
1// @(#)root/base:$Id$
2// Author: Rene Brun 26/12/94
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TObject
13#define ROOT_TObject
14
15
16// #include "RConfigure.h" // included via Rtypes.h
17#include "Rtypes.h"
18#include "TStorage.h"
19#include "TVersionCheck.h"
20
21#include <cstdarg>
22#include <string>
23#include <iosfwd>
24
25#ifdef WIN32
26#undef RemoveDirectory
27#endif
28
29class TList;
30class TBrowser;
31class TBuffer;
32class TObjArray;
33class TMethod;
34class TTimer;
35
36namespace ROOT {
37namespace Internal {
40}}
41
42class TObject {
44
45private:
46 UInt_t fUniqueID; ///< object unique identifier
47 UInt_t fBits; ///< bit field status word
48
49 static Longptr_t fgDtorOnly; ///< object for which to call dtor only (i.e. no delete)
50 static Bool_t fgObjectStat; ///< if true keep track of objects in TObjectTable
51
52 static void AddToTObjectTable(TObject *);
53
54protected:
55 void MakeZombie() { fBits |= kZombie; }
56 virtual void DoError(int level, const char *location, const char *fmt, va_list va) const;
57
58 static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs = "", Bool_t empty_line = kTRUE);
59
60 static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag = 0);
61
62 static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option = nullptr);
63
64public:
65 //----- Global bits (can be set for any object and should not be reused).
66 //----- Bits 0 - 13 are reserved as global bits. Bits 14 - 23 can be used
67 //----- in different class hierarchies (make sure there is no overlap in
68 //----- any given hierarchy).
70 kCanDelete = BIT(0), ///< if object in a list can be deleted
71 // 2 is taken by TDataMember
72 kMustCleanup = BIT(3), ///< if object destructor must call RecursiveRemove()
73 kIsReferenced = BIT(4), ///< if object is referenced by a TRef or TRefArray
74 kHasUUID = BIT(5), ///< if object has a TUUID (its fUniqueID=UUIDNumber)
75 kCannotPick = BIT(6), ///< if object in a pad cannot be picked
76 // 7 is taken by TAxis and TClass.
77 kNoContextMenu = BIT(8), ///< if object does not want context menu
78 // 9, 10 are taken by TH1, TF1, TAxis and a few others
79 // 12 is taken by TAxis
80 kInvalidObject = BIT(13) ///< if object ctor succeeded but object should not be used
81 };
82
84 kObjInCanvas = BIT(3) ///< for backward compatibility only, use kMustCleanup
85 };
86
87 //----- Private bits, clients can only test but not change them
88 enum {
89 kIsOnHeap = 0x01000000, ///< object is on heap
90 kNotDeleted = 0x02000000, ///< object has not been deleted
91 kZombie = 0x04000000, ///< object ctor failed
92 kInconsistent = 0x08000000, ///< class overload Hash but does call RecursiveRemove in destructor
93 // kCheckedHash = 0x10000000, ///< CheckedHash has check for the consistency of Hash/RecursiveRemove
94 kBitMask = 0x00ffffff
95 };
96
97 //----- Write() options
98 enum {
99 kSingleKey = BIT(0), ///< write collection with single key
100 kOverwrite = BIT(1), ///< overwrite existing object with same name
101 kWriteDelete = BIT(2), ///< write object, then delete previous key with same name
102 };
103
104protected:
105 enum { // DeprectatedWriteOptions
106 ///< Used to request that the class specific implementation of `TObject::Write`
107 ///< just prepare the objects to be ready to be written but do not actually write
108 ///< them into the TBuffer. This is just for example by TBufferMerger to request
109 ///< that the TTree inside the file calls `TTree::FlushBaskets` (outside of the merging lock)
110 ///< and TBufferMerger will later ask for the write (inside the merging lock).
111 ///< To take advantage of this feature the class needs to overload `TObject::Write`
112 ///< and use this enum value accordingly. (See `TTree::Write` and `TObject::Write`)
113 ///< Do not use, this feature will be migrate to the Merge function (See TClass and TTree::Merge)
114 kOnlyPrepStep = BIT(3)
115 };
116
117public:
118
119 TObject();
120 TObject(const TObject &object) noexcept;
121 TObject &operator=(const TObject &rhs) noexcept;
122 virtual ~TObject();
123
124 virtual void AppendPad(Option_t *option="");
125 virtual void Browse(TBrowser *b);
126 virtual const char *ClassName() const;
127 virtual void Clear(Option_t * /*option*/ ="") { }
128 ULong_t CheckedHash(); // Not virtual
129 virtual TObject *Clone(const char *newname="") const;
130 virtual Int_t Compare(const TObject *obj) const;
131 virtual void Copy(TObject &object) const;
132 virtual void Delete(Option_t *option=""); // *MENU*
133 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
134 virtual void Draw(Option_t *option="");
135 virtual void DrawClass() const; // *MENU*
136 virtual TObject *DrawClone(Option_t *option="") const; // *MENU*
137 virtual void Dump() const; // *MENU*
138 virtual void Execute(const char *method, const char *params, Int_t *error = nullptr);
139 virtual void Execute(TMethod *method, TObjArray *params, Int_t *error = nullptr);
140 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
141 virtual TObject *FindObject(const char *name) const;
142 virtual TObject *FindObject(const TObject *obj) const;
143 virtual Option_t *GetDrawOption() const;
144 virtual UInt_t GetUniqueID() const;
145 virtual const char *GetName() const;
146 virtual const char *GetIconName() const;
147 virtual Option_t *GetOption() const { return ""; }
148 virtual char *GetObjectInfo(Int_t px, Int_t py) const;
149 virtual const char *GetTitle() const;
150 virtual Bool_t HandleTimer(TTimer *timer);
152 virtual ULong_t Hash() const;
153 virtual Bool_t InheritsFrom(const char *classname) const;
154 virtual Bool_t InheritsFrom(const TClass *cl) const;
155 virtual void Inspect() const; // *MENU*
156 virtual Bool_t IsFolder() const;
157 virtual Bool_t IsEqual(const TObject *obj) const;
158 virtual Bool_t IsSortable() const { return kFALSE; }
159
162
163 virtual Bool_t Notify();
164 virtual void ls(Option_t *option="") const;
165 virtual void Paint(Option_t *option="");
166 virtual void Pop();
167 virtual void Print(Option_t *option="") const;
168 virtual Int_t Read(const char *name);
169 virtual void RecursiveRemove(TObject *obj);
170 virtual void SaveAs(const char *filename="",Option_t *option="") const; // *MENU*
171 virtual void SavePrimitive(std::ostream &out, Option_t *option = "");
172 virtual void SetDrawOption(Option_t *option=""); // *MENU*
173 virtual void SetUniqueID(UInt_t uid);
174 virtual void UseCurrentStyle();
175 virtual Int_t Write(const char *name = nullptr, Int_t option = 0, Int_t bufsize = 0);
176 virtual Int_t Write(const char *name = nullptr, Int_t option = 0, Int_t bufsize = 0) const;
177
178 /// IsDestructed
179 ///
180 /// \note This function must be non-virtual as it can be used on destructed (but
181 /// not yet modified) memory. This is used for example in TClonesArray to record
182 /// the element that have been destructed but not deleted and thus are ready for
183 /// re-use (by operator new with placement).
184 ///
185 /// \return true if this object's destructor has been run.
187
188 //----- operators
189 void *operator new(size_t sz) { return TStorage::ObjectAlloc(sz); }
190 void *operator new[](size_t sz) { return TStorage::ObjectAllocArray(sz); }
191 void *operator new(size_t sz, void *vp) { return TStorage::ObjectAlloc(sz, vp); }
192 void *operator new[](size_t sz, void *vp) { return TStorage::ObjectAlloc(sz, vp); }
193 void operator delete(void *ptr);
194 void operator delete[](void *ptr);
195 void operator delete(void*, size_t);
196 void operator delete[](void*, size_t);
197 void operator delete(void *ptr, void *vp);
198 void operator delete[](void *ptr, void *vp);
199
200 //----- bit manipulation
201 void SetBit(UInt_t f, Bool_t set);
202 void SetBit(UInt_t f) { fBits |= f & kBitMask; }
203 void ResetBit(UInt_t f) { fBits &= ~(f & kBitMask); }
204 R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const { return (Bool_t) ((fBits & f) != 0); }
205 Int_t TestBits(UInt_t f) const { return (Int_t) (fBits & f); }
207
208 //---- error handling
209 virtual void Info(const char *method, const char *msgfmt, ...) const
210#if defined(__GNUC__)
211 __attribute__((format(printf, 3, 4))) /* 1 is the this pointer */
212#endif
213 ;
214 virtual void Warning(const char *method, const char *msgfmt, ...) const
215#if defined(__GNUC__)
216 __attribute__((format(printf, 3, 4))) /* 1 is the this pointer */
217#endif
218 ;
219 virtual void Error(const char *method, const char *msgfmt, ...) const
220#if defined(__GNUC__)
221 __attribute__((format(printf, 3, 4))) /* 1 is the this pointer */
222#endif
223 ;
224 virtual void SysError(const char *method, const char *msgfmt, ...) const
225#if defined(__GNUC__)
226 __attribute__((format(printf, 3, 4))) /* 1 is the this pointer */
227#endif
228 ;
229 virtual void Fatal(const char *method, const char *msgfmt, ...) const
230#if defined(__GNUC__)
231 __attribute__((format(printf, 3, 4))) /* 1 is the this pointer */
232#endif
233 ;
234
235 void AbstractMethod(const char *method) const;
236 void MayNotUse(const char *method) const;
237 void Obsolete(const char *method, const char *asOfVers, const char *removedFromVers) const;
238
239 //---- static functions
240 static Longptr_t GetDtorOnly();
241 static void SetDtorOnly(void *obj);
242 static Bool_t GetObjectStat();
243 static void SetObjectStat(Bool_t stat);
244
245 friend class TClonesArray; // needs to reset kNotDeleted in fBits
247
248 ClassDef(TObject,1) //Basic ROOT object
249};
250
251////////////////////////////////////////////////////////////////////////////////
252/// TObject constructor. It sets the two data words of TObject to their
253/// initial values. The unique ID is set to 0 and the status word is
254/// set depending if the object is created on the stack or allocated
255/// on the heap. Depending on the ROOT environment variable "Root.ObjStat"
256/// (see TEnv) the object is added to the global TObjectTable for
257/// bookkeeping.
258
259inline TObject::TObject() : fBits(kNotDeleted) // Need to leave fUniqueID unset
260{
261 // This will be reported by valgrind as uninitialized memory reads for
262 // object created on the stack, use $ROOTSYS/etc/valgrind-root.supp
264
265 fUniqueID = 0;
266
267#ifdef R__WIN32
269#else
271#endif
272}
273
274////////////////////////////////////////////////////////////////////////////////
275/// TObject copy ctor.
276
277inline TObject::TObject(const TObject &obj) noexcept
278{
279 fBits = obj.fBits;
280
281 // This will be reported by valgrind as uninitialized memory reads for
282 // object created on the stack, use $ROOTSYS/etc/valgrind-root.supp
284
287
288 // Set only after used in above call
289 fUniqueID = obj.fUniqueID; // when really unique don't copy
290
291#ifdef R__WIN32
293#else
295#endif
296}
297
298////////////////////////////////////////////////////////////////////////////////
299/// TObject assignment operator.
300
301inline TObject &TObject::operator=(const TObject &rhs) noexcept
302{
303 if (R__likely(this != &rhs)) {
304 fUniqueID = rhs.fUniqueID; // when really unique don't copy
305 if (IsOnHeap()) { // test uses fBits so don't move next line
306 fBits = rhs.fBits;
307 fBits |= kIsOnHeap;
308 } else {
309 fBits = rhs.fBits;
310 fBits &= ~kIsOnHeap;
311 }
314 }
315 return *this;
316}
317
318
319////////////////////////////////////////////////////////////////////////////////
320/// @brief Check and record whether this class has a consistent
321/// Hash/RecursiveRemove setup (*) and then return the regular Hash value for
322/// this object. The intent is for this routine to be called instead of directly
323/// calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();
324///
325/// (*) The setup is consistent when all classes in the class hierarchy that overload
326/// TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor.
327/// i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.
328
330{
331 // Testing and recording whether we already called HasInconstistentTObjectHash
332 // for this object could save some cpu cycles in some circuntances (at the cost
333 // of reserving yet another bit).
334 // For each insert (CheckedHash is called only for insert in THashList/THashTable), it
335 // cost one memory fetch, one arithmetic operation and one branching.
336 // This save a virtual function call which itself contains a static variable memory
337 // fetch, a branching (of whether the static was already set or not).
338 // Given that a virtual function call is essentially 2 memory fetches (virtual table
339 // location and then content), one arithmetic operation and one function call/jump),
340 // we guess-estimate that the version recording-then-testing-prior-check would start
341 // saving cpu cycle when each object is inserted in average 1.5 times in a THashList/THashTable.
342
343 // if ( !fBits & kCheckedHash) {
346 // fBits &= kChecked;
347 //}
348 return Hash();
349}
350
351////////////////////////////////////////////////////////////////////////////////
352/// @brief Return true is the type of this object is *known* to have an
353/// inconsistent setup for Hash and RecursiveRemove (i.e. missing call to
354/// RecursiveRemove in destructor).
355///
356/// Note: Since the consistency is only tested for during inserts, this
357/// routine will return true for object that have never been inserted
358/// whether or not they have a consistent setup. This has no negative
359/// side-effect as searching for the object with the right or wrong
360/// Hash will always yield a not-found answer (Since anyway no hash
361/// can be guaranteed unique, there is always a check)
362
364{
365 return fBits & kInconsistent;
366}
367
368// Global bits (can be set for any object and should not be reused).
369// Only here for backward compatibility reasons.
370// For detailed description see TObject::EStatusBits above.
381
382namespace cling {
383 std::string printValue(TObject *val);
384}
385
386namespace ROOT {
387
388namespace Internal {
389 bool DeleteChangesMemory();
390} // Internal
391
392namespace Detail {
393
394
395/// @brief Check if the TObject's memory has been deleted.
396/// @warning This should be only used for error mitigation as the answer is only
397/// sometimes correct. It actually just checks whether the object has been
398/// deleted, so this will falsely return true for an object that has
399/// been destructed but its memory has not been deleted. This will return an
400/// undefined value if the memory is re-used between the deletion and the check.
401/// i.e. This is useful to prevent a segmentation fault in case where the problem
402/// can be detected when the deletion and the usage are 'close-by'
403/// @warning In enviroment where delete taints (changes) the memory, this function
404/// always returns false as the marker left by ~TObject will be overwritten.
405/// @param obj The memory to check
406/// @return true if the object has been destructed and it can be inferred that it has been deleted
410
411}} // ROOT::Details
412
413#endif
#define R__ALWAYS_INLINE
Definition RConfig.hxx:558
#define R__likely(expr)
Definition RConfig.hxx:593
#define R__unlikely(expr)
Definition RConfig.hxx:592
#define b(i)
Definition RSha256.hxx:100
#define f(i)
Definition RSha256.hxx:104
bool Bool_t
Boolean (0=false, 1=true) (bool)
Definition RtypesCore.h:77
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
Definition RtypesCore.h:89
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
Definition RtypesCore.h:60
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char)
Definition RtypesCore.h:80
#define ClassDef(name, id)
Definition Rtypes.h:344
#define BIT(n)
Definition Rtypes.h:91
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
char name[80]
Definition TGX11.cxx:110
EObjBits
Definition TObject.h:371
@ kCanDelete
Definition TObject.h:372
@ kIsReferenced
Definition TObject.h:375
@ kCannotPick
Definition TObject.h:377
@ kInvalidObject
Definition TObject.h:379
@ kObjInCanvas
Definition TObject.h:374
@ kNoContextMenu
Definition TObject.h:378
@ kMustCleanup
Definition TObject.h:373
@ kHasUUID
Definition TObject.h:376
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
Buffer base class used for serializing objects.
Definition TBuffer.h:43
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:84
An array of clone (identical) objects.
A doubly linked list.
Definition TList.h:38
Each ROOT class (see TClass) has a linked list of methods.
Definition TMethod.h:38
An array of TObjects.
Definition TObjArray.h:31
Mother of all ROOT objects.
Definition TObject.h:42
void AbstractMethod(const char *method) const
Call this function within a function that you don't want to define as purely virtual,...
Definition TObject.cxx:1140
virtual Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition TObject.cxx:574
virtual void Inspect() const
Dump contents of this object in a graphics canvas.
Definition TObject.cxx:565
virtual void Clear(Option_t *="")
Definition TObject.h:127
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Computes distance from point (px,py) to the object.
Definition TObject.cxx:284
TObject & operator=(const TObject &rhs) noexcept
TObject assignment operator.
Definition TObject.h:301
Bool_t HasInconsistentHash() const
Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveR...
Definition TObject.h:363
static void SetObjectStat(Bool_t stat)
Turn on/off tracking of objects in the TObjectTable.
Definition TObject.cxx:1179
virtual Bool_t Notify()
This method must be overridden to handle object notification (the base implementation is no-op).
Definition TObject.cxx:613
Bool_t IsDestructed() const
IsDestructed.
Definition TObject.h:186
ULong_t CheckedHash()
Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return t...
Definition TObject.h:329
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
Definition TObject.cxx:584
@ kOverwrite
overwrite existing object with same name
Definition TObject.h:100
@ kSingleKey
write collection with single key
Definition TObject.h:99
@ kWriteDelete
write object, then delete previous key with same name
Definition TObject.h:101
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:458
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
Definition TObject.cxx:217
void SetBit(UInt_t f)
Definition TObject.h:202
virtual void Dump() const
Dump contents of object on stdout.
Definition TObject.cxx:367
UInt_t fUniqueID
object unique identifier
Definition TObject.h:46
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition TObject.h:204
virtual const char * GetIconName() const
Returns mime type name of object.
Definition TObject.cxx:468
virtual void RecursiveRemove(TObject *obj)
Recursively remove this object from a list.
Definition TObject.cxx:679
virtual void DoError(int level, const char *location, const char *fmt, va_list va) const
Interface to ErrorHandler (protected).
Definition TObject.cxx:1050
virtual Bool_t HandleTimer(TTimer *timer)
Execute action in response of a timer timing out.
Definition TObject.cxx:512
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Definition TObject.cxx:242
virtual UInt_t GetUniqueID() const
Return the unique object id.
Definition TObject.cxx:476
@ kIsOnHeap
object is on heap
Definition TObject.h:89
@ kNotDeleted
object has not been deleted
Definition TObject.h:90
@ kBitMask
Definition TObject.h:94
@ kZombie
object ctor failed
Definition TObject.h:91
@ kInconsistent
class overload Hash but does call RecursiveRemove in destructor
Definition TObject.h:92
UInt_t fBits
bit field status word
Definition TObject.h:47
virtual Bool_t IsSortable() const
Definition TObject.h:158
virtual Option_t * GetOption() const
Definition TObject.h:147
static Longptr_t fgDtorOnly
object for which to call dtor only (i.e. no delete)
Definition TObject.h:49
void InvertBit(UInt_t f)
Definition TObject.h:206
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
Definition TObject.cxx:1103
R__ALWAYS_INLINE Bool_t IsOnHeap() const
Definition TObject.h:160
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:226
virtual void UseCurrentStyle()
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyl...
Definition TObject.cxx:903
virtual Option_t * GetDrawOption() const
Get option used by the graphics system to draw this object.
Definition TObject.cxx:442
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition TObject.cxx:1075
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 clas...
Definition TObject.cxx:1151
virtual TObject * DrawClone(Option_t *option="") const
Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
Definition TObject.cxx:319
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute action corresponding to an event at (px,py).
Definition TObject.cxx:412
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
Definition TObject.cxx:422
virtual void Execute(const char *method, const char *params, Int_t *error=nullptr)
Execute method on this object with the given parameter string, e.g.
Definition TObject.cxx:378
virtual void AppendPad(Option_t *option="")
Append graphics object to current pad.
Definition TObject.cxx:203
virtual char * GetObjectInfo(Int_t px, Int_t py) const
Returns string containing info about the object at position (px,py).
Definition TObject.cxx:487
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
Definition TObject.cxx:853
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition TObject.h:161
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
Definition TObject.cxx:982
@ kOnlyPrepStep
Used to request that the class specific implementation of TObject::Write just prepare the objects to ...
Definition TObject.h:114
virtual void SaveAs(const char *filename="", Option_t *option="") const
Save this object in the file specified by filename.
Definition TObject.cxx:706
virtual void Delete(Option_t *option="")
Delete this object.
Definition TObject.cxx:267
static Longptr_t GetDtorOnly()
Return destructor only flag.
Definition TObject.cxx:1187
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition TObject.cxx:882
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Definition TObject.cxx:544
static Bool_t GetObjectStat()
Get status of object stat flag.
Definition TObject.cxx:1172
virtual void Copy(TObject &object) const
Copy this to obj.
Definition TObject.cxx:159
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1089
virtual void SetDrawOption(Option_t *option="")
Set drawing option for object.
Definition TObject.cxx:866
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
Definition TObject.cxx:1117
static void SetDtorOnly(void *obj)
Set destructor only flag.
Definition TObject.cxx:1195
virtual void SetUniqueID(UInt_t uid)
Set the unique object id.
Definition TObject.cxx:893
virtual const char * GetTitle() const
Returns title of object.
Definition TObject.cxx:502
EDeprecatedStatusBits
Definition TObject.h:83
@ kObjInCanvas
for backward compatibility only, use kMustCleanup
Definition TObject.h:84
virtual void DrawClass() const
Draw class inheritance tree of the class to which this object belongs.
Definition TObject.cxx:308
Int_t TestBits(UInt_t f) const
Definition TObject.h:205
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
Definition TObject.cxx:257
void MakeZombie()
Definition TObject.h:55
virtual ~TObject()
TObject destructor.
Definition TObject.cxx:177
static void SavePrimitiveDraw(std::ostream &out, const char *variable_name, Option_t *option=nullptr)
Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
Definition TObject.cxx:840
virtual void Paint(Option_t *option="")
This method must be overridden if a class wants to paint itself.
Definition TObject.cxx:626
virtual void Print(Option_t *option="") const
This method must be overridden when a class wants to print itself.
Definition TObject.cxx:656
virtual void Pop()
Pop on object drawn in a pad to the top of the display list.
Definition TObject.cxx:635
TObject()
TObject constructor.
Definition TObject.h:259
virtual ULong_t Hash() const
Return hash value for this object.
Definition TObject.cxx:534
virtual void ls(Option_t *option="") const
The ls function lists the contents of a class on stdout.
Definition TObject.cxx:593
static void SavePrimitiveConstructor(std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
Save object constructor in the output stream "out".
Definition TObject.cxx:772
static TString SavePrimitiveVector(std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
Save array in the output stream "out" as vector.
Definition TObject.cxx:791
static Bool_t fgObjectStat
if true keep track of objects in TObjectTable
Definition TObject.h:50
void ResetBit(UInt_t f)
Definition TObject.h:203
EStatusBits
Definition TObject.h:69
@ kCannotPick
if object in a pad cannot be picked
Definition TObject.h:75
@ kNoContextMenu
if object does not want context menu
Definition TObject.h:77
@ kCanDelete
if object in a list can be deleted
Definition TObject.h:70
@ kHasUUID
if object has a TUUID (its fUniqueID=UUIDNumber)
Definition TObject.h:74
@ kInvalidObject
if object ctor succeeded but object should not be used
Definition TObject.h:80
@ kIsReferenced
if object is referenced by a TRef or TRefArray
Definition TObject.h:73
@ kMustCleanup
if object destructor must call RecursiveRemove()
Definition TObject.h:72
virtual Int_t Read(const char *name)
Read contents of object with specified name from the current directory.
Definition TObject.cxx:668
static void AddToTObjectTable(TObject *)
Private helper function which will dispatch to TObjectTable::AddObj.
Definition TObject.cxx:194
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition TObject.cxx:1063
void Obsolete(const char *method, const char *asOfVers, const char *removedFromVers) const
Use this method to declare a method obsolete.
Definition TObject.cxx:1160
static void UpdateIsOnHeap(volatile const UInt_t &uniqueID, volatile UInt_t &bits)
Definition TStorage.h:121
static void * ObjectAllocArray(size_t size)
Used to allocate array of TObject on the heap (via TObject::operator new[]()).
Definition TStorage.cxx:302
static void * ObjectAlloc(size_t size)
Used to allocate a TObject on the heap (via TObject::operator new()).
Definition TStorage.cxx:290
Basic string class.
Definition TString.h:138
Handles synchronous and a-synchronous timer events.
Definition TTimer.h:51
R__ALWAYS_INLINE bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.
Definition TObject.h:407
bool DeleteChangesMemory()
Definition TObject.cxx:146
void MarkTObjectAsNotOnHeap(TObject &obj)
Definition TObject.cxx:1270
bool DeleteChangesMemoryImpl()
Definition TObject.cxx:89
th1 Draw()