00001 //------------------------------------------------------------- 00002 // Go4 Release Package v3.04-01 (build 30401) 00003 // 28-November-2008 00004 //--------------------------------------------------------------- 00005 // The GSI Online Offline Object Oriented (Go4) Project 00006 // Experiment Data Processing at EE department, GSI 00007 //--------------------------------------------------------------- 00008 // 00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI 00010 // Planckstr. 1, 64291 Darmstadt, Germany 00011 //Contact: http://go4.gsi.de 00012 //---------------------------------------------------------------- 00013 //This software can be used under the license agreements as stated 00014 //in Go4License.txt file which is part of the distribution. 00015 //---------------------------------------------------------------- 00016 #ifndef TGO4MAINTREE_H 00017 #define TGO4MAINTREE_H 00018 00019 #include "TObject.h" 00020 00021 class TTree; 00022 class TFile; 00023 00034 class TGo4MainTree : public TObject { 00035 friend class TGo4TreeSource; 00036 friend class TGo4TreeStore; 00037 00038 protected: 00041 TTree* GetTree() { return fxTree; } 00042 00043 TGo4MainTree(); 00044 00045 public: 00046 00047 virtual ~TGo4MainTree(); 00048 00050 static const Text_t fgcTREENAME[]; 00051 00053 static const Text_t fgcFILENAME[]; 00054 00056 static const Int_t fgiCOMPRESS; 00057 00059 static const Int_t fgiAUTOSAVESIZE; 00060 00061 static TGo4MainTree * Instance(); 00062 00066 static Bool_t Exists() { return fxInstance!=0; } 00067 00068 Int_t GetCurrentIndex() const { return fiCurrentIndex; } 00069 00073 Int_t IncCurrentIndex() { return (++fiCurrentIndex); } 00074 00075 void SetCurrentIndex(Int_t number=0) { fiCurrentIndex = number; } 00076 00077 Int_t GetMaxIndex(); 00078 00080 void SetAutoSave(Int_t bytesinterval); 00081 00085 void Update(); 00086 00088 virtual Int_t Write(const char* dummy=0, Int_t option=0, Int_t bufsize=0); 00089 virtual Int_t Write(const char* dummy=0, Int_t option=0, Int_t bufsize=0) const; 00090 00091 private: 00092 00093 static TGo4MainTree * fxInstance; 00094 00095 TFile* fxFile; 00096 00097 TTree * fxTree; 00098 00101 Int_t fiMaxIndex; 00102 00104 Int_t fiCurrentIndex; 00105 00106 ClassDef(TGo4MainTree,1) 00107 }; 00108 00109 #endif //TGO4MAINTREE_H 00110 00111 //----------------------------END OF GO4 SOURCE FILE ---------------------