00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TObject
00013 #define ROOT_TObject
00014
00015
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00029
00030 #ifndef ROOT_Rtypes
00031 #include "Rtypes.h"
00032 #endif
00033 #ifndef ROOT_Varargs
00034 #include "Varargs.h"
00035 #endif
00036 #ifndef ROOT_TStorage
00037 #include "TStorage.h"
00038 #endif
00039 #ifndef ROOT_Riosfwd
00040 #include "Riosfwd.h"
00041 #endif
00042
00043 #ifdef WIN32
00044 #undef RemoveDirectory
00045 #endif
00046
00047 class TList;
00048 class TBrowser;
00049 class TBuffer;
00050 class TObjArray;
00051 class TMethod;
00052 class TTimer;
00053
00054
00055
00056
00057
00058
00059 enum EObjBits {
00060 kCanDelete = BIT(0),
00061 kMustCleanup = BIT(3),
00062 kObjInCanvas = BIT(3),
00063 kIsReferenced = BIT(4),
00064 kHasUUID = BIT(5),
00065 kCannotPick = BIT(6),
00066 kNoContextMenu = BIT(8),
00067 kInvalidObject = BIT(13)
00068 };
00069
00070
00071 class TObject {
00072
00073 private:
00074 UInt_t fUniqueID;
00075 UInt_t fBits;
00076
00077 static Long_t fgDtorOnly;
00078 static Bool_t fgObjectStat;
00079
00080 protected:
00081 void MakeZombie() { fBits |= kZombie; }
00082 virtual void DoError(int level, const char *location, const char *fmt, va_list va) const;
00083
00084 public:
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 SavePrimitive(ofstream &out, Option_t *option);
00148 virtual void SetDrawOption(Option_t *option="");
00149 virtual void SetUniqueID(UInt_t uid);
00150 virtual void UseCurrentStyle();
00151 virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0);
00152
00153
00154 void *operator new(size_t sz) { return TStorage::ObjectAlloc(sz); }
00155 void *operator new[](size_t sz) { return TStorage::ObjectAlloc(sz); }
00156 void *operator new(size_t sz, void *vp) { return TStorage::ObjectAlloc(sz, vp); }
00157 void *operator new[](size_t sz, void *vp) { return TStorage::ObjectAlloc(sz, vp); }
00158 void operator delete(void *ptr);
00159 void operator delete[](void *ptr);
00160 #ifdef R__PLACEMENTDELETE
00161 void operator delete(void *ptr, void *vp);
00162 void operator delete[](void *ptr, void *vp);
00163 #endif
00164
00165
00166 void SetBit(UInt_t f, Bool_t set);
00167 void SetBit(UInt_t f) { fBits |= f & kBitMask; }
00168 void ResetBit(UInt_t f) { fBits &= ~(f & kBitMask); }
00169 Bool_t TestBit(UInt_t f) const { return (Bool_t) ((fBits & f) != 0); }
00170 Int_t TestBits(UInt_t f) const { return (Int_t) (fBits & f); }
00171 void InvertBit(UInt_t f) { fBits ^= f & kBitMask; }
00172
00173
00174 virtual void Info(const char *method, const char *msgfmt, ...) const;
00175 virtual void Warning(const char *method, const char *msgfmt, ...) const;
00176 virtual void Error(const char *method, const char *msgfmt, ...) const;
00177 virtual void SysError(const char *method, const char *msgfmt, ...) const;
00178 virtual void Fatal(const char *method, const char *msgfmt, ...) const;
00179
00180 void AbstractMethod(const char *method) const;
00181 void MayNotUse(const char *method) const;
00182
00183
00184 static Long_t GetDtorOnly();
00185 static void SetDtorOnly(void *obj);
00186 static Bool_t GetObjectStat();
00187 static void SetObjectStat(Bool_t stat);
00188
00189 ClassDef(TObject,1)
00190 };
00191
00192 #ifndef ROOT_TBuffer
00193 #include "TBuffer.h"
00194 #endif
00195
00196 #endif