00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TObject
00013 #define ROOT_TObject
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef ROOT_Rtypes
00031 #include "Rtypes.h"
00032 #endif
00033 #ifndef ROOT_TStorage
00034 #include "TStorage.h"
00035 #endif
00036 #ifndef ROOT_TVersionCheck
00037 #include "TVersionCheck.h"
00038 #endif
00039 #ifndef ROOT_Riosfwd
00040 #include "Riosfwd.h"
00041 #endif
00042 #include <stdarg.h>
00043
00044 #ifdef WIN32
00045 #undef RemoveDirectory
00046 #endif
00047
00048 class TList;
00049 class TBrowser;
00050 class TBuffer;
00051 class TObjArray;
00052 class TMethod;
00053 class TTimer;
00054
00055
00056 class TObject {
00057
00058 private:
00059 UInt_t fUniqueID;
00060 UInt_t fBits;
00061
00062 static Long_t fgDtorOnly;
00063 static Bool_t fgObjectStat;
00064
00065 protected:
00066 void MakeZombie() { fBits |= kZombie; }
00067 virtual void DoError(int level, const char *location, const char *fmt, va_list va) const;
00068
00069 public:
00070
00071
00072
00073
00074 enum EStatusBits {
00075 kCanDelete = BIT(0),
00076 kMustCleanup = BIT(3),
00077 kObjInCanvas = BIT(3),
00078 kIsReferenced = BIT(4),
00079 kHasUUID = BIT(5),
00080 kCannotPick = BIT(6),
00081 kNoContextMenu = BIT(8),
00082 kInvalidObject = BIT(13)
00083 };
00084
00085
00086 enum {
00087 kIsOnHeap = 0x01000000,
00088 kNotDeleted = 0x02000000,
00089 kZombie = 0x04000000,
00090 kBitMask = 0x00ffffff
00091 };
00092
00093
00094 enum {
00095 kSingleKey = BIT(0),
00096 kOverwrite = BIT(1),
00097 kWriteDelete = BIT(2)
00098 };
00099
00100 TObject();
00101 TObject(const TObject &object);
00102 TObject &operator=(const TObject &rhs);
00103 virtual ~TObject();
00104
00105 virtual void AppendPad(Option_t *option="");
00106 virtual void Browse(TBrowser *b);
00107 virtual const char *ClassName() const;
00108 virtual void Clear(Option_t * ="") { }
00109 virtual TObject *Clone(const char *newname="") const;
00110 virtual Int_t Compare(const TObject *obj) const;
00111 virtual void Copy(TObject &object) const;
00112 virtual void Delete(Option_t *option="");
00113 virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
00114 virtual void Draw(Option_t *option="");
00115 virtual void DrawClass() const;
00116 virtual TObject *DrawClone(Option_t *option="") const;
00117 virtual void Dump() const;
00118 virtual void Execute(const char *method, const char *params, Int_t *error=0);
00119 virtual void Execute(TMethod *method, TObjArray *params, Int_t *error=0);
00120 virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00121 virtual TObject *FindObject(const char *name) const;
00122 virtual TObject *FindObject(const TObject *obj) const;
00123 virtual Option_t *GetDrawOption() const;
00124 virtual UInt_t GetUniqueID() const;
00125 virtual const char *GetName() const;
00126 virtual const char *GetIconName() const;
00127 virtual Option_t *GetOption() const { return ""; }
00128 virtual char *GetObjectInfo(Int_t px, Int_t py) const;
00129 virtual const char *GetTitle() const;
00130 virtual Bool_t HandleTimer(TTimer *timer);
00131 virtual ULong_t Hash() const;
00132 virtual Bool_t InheritsFrom(const char *classname) const;
00133 virtual Bool_t InheritsFrom(const TClass *cl) const;
00134 virtual void Inspect() const;
00135 virtual Bool_t IsFolder() const;
00136 virtual Bool_t IsEqual(const TObject *obj) const;
00137 virtual Bool_t IsSortable() const { return kFALSE; }
00138 Bool_t IsOnHeap() const { return TestBit(kIsOnHeap); }
00139 Bool_t IsZombie() const { return TestBit(kZombie); }
00140 virtual Bool_t Notify();
00141 virtual void ls(Option_t *option="") const;
00142 virtual void Paint(Option_t *option="");
00143 virtual void Pop();
00144 virtual void Print(Option_t *option="") const;
00145 virtual Int_t Read(const char *name);
00146 virtual void RecursiveRemove(TObject *obj);
00147 virtual void SaveAs(const char *filename="",Option_t *option="") const;
00148 virtual void SavePrimitive(ostream &out, Option_t *option = "");
00149 virtual void SetDrawOption(Option_t *option="");
00150 virtual void SetUniqueID(UInt_t uid);
00151 virtual void UseCurrentStyle();
00152 virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0);
00153 virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0) const;
00154
00155
00156 void *operator new(size_t sz) { return TStorage::ObjectAlloc(sz); }
00157 void *operator new[](size_t sz) { return TStorage::ObjectAlloc(sz); }
00158 void *operator new(size_t sz, void *vp) { return TStorage::ObjectAlloc(sz, vp); }
00159 void *operator new[](size_t sz, void *vp) { return TStorage::ObjectAlloc(sz, vp); }
00160 void operator delete(void *ptr);
00161 void operator delete[](void *ptr);
00162 #ifdef R__PLACEMENTDELETE
00163 void operator delete(void *ptr, void *vp);
00164 void operator delete[](void *ptr, void *vp);
00165 #endif
00166
00167
00168 void SetBit(UInt_t f, Bool_t set);
00169 void SetBit(UInt_t f) { fBits |= f & kBitMask; }
00170 void ResetBit(UInt_t f) { fBits &= ~(f & kBitMask); }
00171 Bool_t TestBit(UInt_t f) const { return (Bool_t) ((fBits & f) != 0); }
00172 Int_t TestBits(UInt_t f) const { return (Int_t) (fBits & f); }
00173 void InvertBit(UInt_t f) { fBits ^= f & kBitMask; }
00174
00175
00176 virtual void Info(const char *method, const char *msgfmt, ...) const
00177 #if defined(__GNUC__) && !defined(__CINT__)
00178 __attribute__((format(printf, 3, 4)))
00179 #endif
00180 ;
00181 virtual void Warning(const char *method, const char *msgfmt, ...) const
00182 #if defined(__GNUC__) && !defined(__CINT__)
00183 __attribute__((format(printf, 3, 4)))
00184 #endif
00185 ;
00186 virtual void Error(const char *method, const char *msgfmt, ...) const
00187 #if defined(__GNUC__) && !defined(__CINT__)
00188 __attribute__((format(printf, 3, 4)))
00189 #endif
00190 ;
00191 virtual void SysError(const char *method, const char *msgfmt, ...) const
00192 #if defined(__GNUC__) && !defined(__CINT__)
00193 __attribute__((format(printf, 3, 4)))
00194 #endif
00195 ;
00196 virtual void Fatal(const char *method, const char *msgfmt, ...) const
00197 #if defined(__GNUC__) && !defined(__CINT__)
00198 __attribute__((format(printf, 3, 4)))
00199 #endif
00200 ;
00201
00202 void AbstractMethod(const char *method) const;
00203 void MayNotUse(const char *method) const;
00204
00205
00206 static Long_t GetDtorOnly();
00207 static void SetDtorOnly(void *obj);
00208 static Bool_t GetObjectStat();
00209 static void SetObjectStat(Bool_t stat);
00210
00211 ClassDef(TObject,1)
00212 };
00213
00214
00215
00216
00217 enum EObjBits {
00218 kCanDelete = TObject::kCanDelete,
00219 kMustCleanup = TObject::kMustCleanup,
00220 kObjInCanvas = TObject::kObjInCanvas,
00221 kIsReferenced = TObject::kIsReferenced,
00222 kHasUUID = TObject::kHasUUID,
00223 kCannotPick = TObject::kCannotPick,
00224 kNoContextMenu = TObject::kNoContextMenu,
00225 kInvalidObject = TObject::kInvalidObject
00226 };
00227
00228 #ifndef ROOT_TBuffer
00229 #include "TBuffer.h"
00230 #endif
00231
00232 #endif