16 #include "RConfigure.h"
26 #undef RemoveDirectory
43 static Long_t fgDtorOnly;
44 static Bool_t fgObjectStat;
46 static void AddToTObjectTable(TObject *);
49 void MakeZombie() { fBits |= kZombie; }
50 virtual void DoError(
int level,
const char *location,
const char *fmt, va_list va)
const;
60 kMustCleanup = BIT(3),
61 kIsReferenced = BIT(4),
65 kNoContextMenu = BIT(8),
68 kInvalidObject = BIT(13)
71 enum EDeprecatedStatusBits {
77 kIsOnHeap = 0x01000000,
78 kNotDeleted = 0x02000000,
80 kInconsistent = 0x08000000,
93 TObject(
const TObject &
object);
94 TObject &operator=(
const TObject &rhs);
97 virtual void AppendPad(Option_t *option=
"");
98 virtual void Browse(TBrowser *b);
99 virtual const char *ClassName()
const;
100 virtual void Clear(Option_t * =
"") { }
101 ULong_t CheckedHash();
102 virtual TObject *Clone(
const char *newname=
"")
const;
103 virtual Int_t Compare(
const TObject *obj)
const;
104 virtual void Copy(TObject &
object)
const;
105 virtual void Delete(Option_t *option=
"");
106 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
107 virtual void Draw(Option_t *option=
"");
108 virtual void DrawClass()
const;
109 virtual TObject *DrawClone(Option_t *option=
"")
const;
110 virtual void Dump()
const;
111 virtual void Execute(
const char *method,
const char *params, Int_t *error=0);
112 virtual void Execute(TMethod *method, TObjArray *params, Int_t *error=0);
113 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
114 virtual TObject *FindObject(
const char *name)
const;
115 virtual TObject *FindObject(
const TObject *obj)
const;
116 virtual Option_t *GetDrawOption()
const;
117 virtual UInt_t GetUniqueID()
const;
118 virtual const char *GetName()
const;
119 virtual const char *GetIconName()
const;
120 virtual Option_t *GetOption()
const {
return ""; }
121 virtual char *GetObjectInfo(Int_t px, Int_t py)
const;
122 virtual const char *GetTitle()
const;
123 virtual Bool_t HandleTimer(TTimer *timer);
124 Bool_t HasInconsistentHash()
const;
125 virtual ULong_t Hash()
const;
126 virtual Bool_t InheritsFrom(
const char *classname)
const;
127 virtual Bool_t InheritsFrom(
const TClass *cl)
const;
128 virtual void Inspect()
const;
129 virtual Bool_t IsFolder()
const;
130 virtual Bool_t IsEqual(
const TObject *obj)
const;
131 virtual Bool_t IsSortable()
const {
return kFALSE; }
133 R__ALWAYS_INLINE Bool_t IsOnHeap()
const {
return TestBit(kIsOnHeap); }
134 R__ALWAYS_INLINE Bool_t IsZombie()
const {
return TestBit(kZombie); }
136 virtual Bool_t Notify();
137 virtual void ls(Option_t *option=
"")
const;
138 virtual void Paint(Option_t *option=
"");
140 virtual void Print(Option_t *option=
"")
const;
141 virtual Int_t Read(
const char *name);
142 virtual void RecursiveRemove(TObject *obj);
143 virtual void SaveAs(
const char *filename=
"",Option_t *option=
"")
const;
144 virtual void SavePrimitive(std::ostream &out, Option_t *option =
"");
145 virtual void SetDrawOption(Option_t *option=
"");
146 virtual void SetUniqueID(UInt_t uid);
147 virtual void UseCurrentStyle();
148 virtual Int_t Write(
const char *name=0, Int_t option=0, Int_t bufsize=0);
149 virtual Int_t Write(
const char *name=0, Int_t option=0, Int_t bufsize=0)
const;
152 void *
operator new(
size_t sz) {
return TStorage::ObjectAlloc(sz); }
153 void *
operator new[](
size_t sz) {
return TStorage::ObjectAllocArray(sz); }
154 void *
operator new(
size_t sz,
void *vp) {
return TStorage::ObjectAlloc(sz, vp); }
155 void *
operator new[](
size_t sz,
void *vp) {
return TStorage::ObjectAlloc(sz, vp); }
156 void operator delete(
void *ptr);
157 void operator delete[](
void *ptr);
158 #ifdef R__SIZEDDELETE
160 void operator delete(
void*, size_t);
161 void operator delete[](
void*, size_t);
163 #ifdef R__PLACEMENTDELETE
164 void operator delete(
void *ptr,
void *vp);
165 void operator delete[](
void *ptr,
void *vp);
169 void SetBit(UInt_t f, Bool_t set);
170 void SetBit(UInt_t f) { fBits |= f & kBitMask; }
171 void ResetBit(UInt_t f) { fBits &= ~(f & kBitMask); }
172 R__ALWAYS_INLINE Bool_t TestBit(UInt_t f)
const {
return (Bool_t) ((fBits & f) != 0); }
173 Int_t TestBits(UInt_t f)
const {
return (Int_t) (fBits & f); }
174 void InvertBit(UInt_t f) { fBits ^= f & kBitMask; }
177 virtual void Info(
const char *method,
const char *msgfmt, ...) const
178 #if defined(__GNUC__) && !defined(__CINT__)
179 __attribute__((format(printf, 3, 4)))
182 virtual void Warning(
const char *method,
const char *msgfmt, ...) const
183 #if defined(__GNUC__) && !defined(__CINT__)
184 __attribute__((format(printf, 3, 4)))
187 virtual void Error(
const char *method,
const char *msgfmt, ...) const
188 #if defined(__GNUC__) && !defined(__CINT__)
189 __attribute__((format(printf, 3, 4)))
192 virtual void SysError(
const char *method,
const char *msgfmt, ...) const
193 #if defined(__GNUC__) && !defined(__CINT__)
194 __attribute__((format(printf, 3, 4)))
197 virtual void Fatal(
const char *method,
const char *msgfmt, ...) const
198 #if defined(__GNUC__) && !defined(__CINT__)
199 __attribute__((format(printf, 3, 4)))
203 void AbstractMethod(
const char *method)
const;
204 void MayNotUse(
const char *method)
const;
205 void Obsolete(
const char *method,
const char *asOfVers,
const char *removedFromVers)
const;
208 static Long_t GetDtorOnly();
209 static void SetDtorOnly(
void *obj);
210 static Bool_t GetObjectStat();
211 static void SetObjectStat(Bool_t stat);
213 friend class TClonesArray;
226 inline TObject::TObject() : fBits(kNotDeleted)
230 TStorage::UpdateIsOnHeap(fUniqueID, fBits);
235 if (R__unlikely(GetObjectStat())) TObject::AddToTObjectTable(
this);
237 if (R__unlikely(fgObjectStat)) TObject::AddToTObjectTable(
this);
244 inline TObject::TObject(
const TObject &obj)
250 TStorage::UpdateIsOnHeap(fUniqueID, fBits);
252 fBits &= ~kIsReferenced;
253 fBits &= ~kCanDelete;
256 fUniqueID = obj.fUniqueID;
259 if (R__unlikely(GetObjectStat())) TObject::AddToTObjectTable(
this);
261 if (R__unlikely(fgObjectStat)) TObject::AddToTObjectTable(
this);
268 inline TObject &TObject::operator=(
const TObject &rhs)
270 if (R__likely(
this != &rhs)) {
271 fUniqueID = rhs.fUniqueID;
279 fBits &= ~kIsReferenced;
280 fBits &= ~kCanDelete;
296 inline ULong_t TObject::CheckedHash()
311 if (!CheckTObjectHashConsistency())
312 fBits |= kInconsistent;
330 inline Bool_t TObject::HasInconsistentHash()
const
332 return fBits & kInconsistent;
339 kCanDelete = TObject::kCanDelete,
340 kMustCleanup = TObject::kMustCleanup,
341 kObjInCanvas = TObject::kObjInCanvas,
342 kIsReferenced = TObject::kIsReferenced,
343 kHasUUID = TObject::kHasUUID,
344 kCannotPick = TObject::kCannotPick,
345 kNoContextMenu = TObject::kNoContextMenu,
346 kInvalidObject = TObject::kInvalidObject
350 std::string printValue(TObject *val);