00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef STAR_StObject
00024 #define STAR_StObject
00025
00026
00028
00029
00030
00032 #include "TDataSet.h"
00033
00034 class StXRefManager;
00035 class StXRefMain;
00036 class StRefArray;
00037 class StStrArray;
00038
00039 enum EStObjectDrawBit { kMark2Draw = BIT(24)};
00040
00041
00042 class StObject : public TObject {
00043
00044 public:
00045 virtual ~StObject();
00046 virtual void Browse(TBrowser *b);
00047
00048 virtual Bool_t IsFolder() const;
00049 virtual TObject *clone() const {return ((TObject*)this)->Clone();}
00050 Int_t isZombie() const {return IsZombie();}
00051
00052
00053 virtual void makeZombie(int flg=1)
00054 {if (flg) {MakeZombie();} else {((UInt_t*)this)[1] &=~(kZombie);}}
00055 UInt_t Ztreamer(TBuffer &R__b);
00056 ClassDef(StObject,3)
00057
00058 static UInt_t fgTally;
00059
00060 };
00061
00062
00064
00065
00066
00067
00068
00070 class StUUId
00071 {
00072 protected:
00073 UInt_t fID[4];
00074 public:
00075 StUUId();
00076 virtual ~StUUId(){};
00077 void Generate();
00078 StUUId &operator=(const StUUId &from);
00079 StUUId &operator=(const char *from);
00080 Int_t IsNull() const {return (fID[3]==0);}
00081
00082
00083 int Compare(const StUUId &u2) const;
00084 ClassDef(StUUId,1)
00085 };
00086
00087
00088 #include "TDataSet.h"
00089
00090
00091 class StXRef :public TDataSet
00092 {
00093 public:
00094 StXRef(const char *brName="", StXRefMain *evt=0, UInt_t tally=0);
00095 virtual ~StXRef();
00096
00097 virtual StXRefMain *MakeMain() = 0 ;
00098 virtual void Synchro(int toMain) = 0 ;
00099 virtual StXRefMain *GetMain();
00100 virtual int IsMain() const {return 0;}
00101 virtual void SetMain(StXRefMain *m) {fMain = m;}
00102 virtual void Add(TDataSet *ds);
00103 const StUUId &GetUUId() const {return fUUId;}
00104 void SetUUId(const StUUId &id){fUUId = id;}
00105 void GenUUId() {fUUId.Generate();}
00106 void SetTally(UInt_t tally) {fTally = tally;}
00107 UInt_t GetTally() {return fTally;}
00108 private:
00109
00110 StUUId fUUId;
00111 UInt_t fTally;
00112 StXRefMain *fMain;
00113 ClassDef(StXRef,1)
00114 };
00115
00116
00117
00118
00119 class StXRefMain :public StXRef {
00120 public:
00121 StXRefMain(const char *name="") : StXRef(name){};
00122 virtual ~StXRefMain();
00123 virtual void Split()=0;
00124 virtual StXRefMain *MakeMain() {return this;}
00125 virtual void Synchro(int toMain){};
00126 ClassDef(StXRefMain,1)
00127 };
00128
00129
00130 class TPageMap {
00131
00132 enum EPageMap {kPAGE=2048,kBITS=11,kBITZ=22,kMASK=0x7ff,kLAST=0xfffff800};
00133 public:
00134 TPageMap();
00135 ~TPageMap();
00136
00137 ULong_t *GET(UInt_t udx) ;
00138 ULong_t *Get(UInt_t udx) ;
00139 void GetMiMax(UInt_t &udxMin,UInt_t &udxMax) {udxMin=fMinUdx;udxMax=fMaxUdx;}
00140
00141 static void Test();
00142 private:
00143 ULong_t *NewPage();
00144
00145 ULong_t *fTopPage;
00146 ULong_t *fLstPage;
00147 UInt_t fLstUdx;
00148 ULong_t *fList;
00149 UInt_t fMinUdx;
00150 UInt_t fMaxUdx;
00151
00152
00153 };
00154 #ifndef __CINT__
00155 #include <list>
00156 #include <vector>
00157 #ifndef ST_NO_NAMESPACES
00158 using namespace std;
00159 #endif
00160 class StProxyUrr;
00161
00162 typedef list<StProxyUrr*> StCollList;
00163 typedef StCollList::iterator StCollListIter;
00164 typedef list<StXRefManager*> StXRefManagerList;
00165 typedef StXRefManagerList::iterator StXRefManagerListIter;
00166 typedef vector<UInt_t> UIntVector;
00167 typedef UIntVector::iterator UIntVectorIter;
00168
00169
00170
00171
00172 class StProxyUrr : public UIntVector {
00173 public:
00174 StProxyUrr(TObject *coll){fArr = coll; fType=0;}
00175 StProxyUrr(TObject **adr){fAdr = adr; fType=1;}
00176 StProxyUrr(StObject **adr){fAdr = (TObject **)adr; fType=1;}
00177 ~StProxyUrr(){fArr = 0;}
00178 int GetType() {return fType;}
00179 TObject *GetArr() {return fArr;}
00180 TObject **GetAdr() {return fAdr;}
00181
00182 private:
00183 int fType;
00184 union {
00185 TObject *fArr;
00186 TObject **fAdr;};
00187 };
00188
00189
00190 class StXRefManager : public TObject
00191 {
00192 public:
00193 StXRefManager(const StUUId &id);
00194 ~StXRefManager();
00195
00196 void Cd();
00197 void AddColl ( StProxyUrr *rarr);
00198 void AddColl (const StStrArray *sarr);
00199 void Update ();
00200 void Clear (Option_t*);
00201 static void Cd (StXRef *xref);
00202 static void Open (StXRef *xref);
00203 static void Close (StXRef *xref);
00204 static TDataSet *GetMain();
00205
00206 private:
00207 Int_t fUpd;
00208 UInt_t fTally;
00209 StUUId fUUId;
00210 StCollList fColList;
00211 TPageMap fObjTab;
00212 StXRefMain *fMain;
00213 public:
00214 static StXRefManagerList fgManagerList;
00215 static StXRefManager *fgManager;
00216 static int fgRWmode;
00217
00218 };
00219
00220 #endif // -__CINT__
00221 #endif
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239