00001 // $Id: TGo4MainTree.h 478 2009-10-29 12:26:09Z linev $ 00002 //----------------------------------------------------------------------- 00003 // The GSI Online Offline Object Oriented (Go4) Project 00004 // Experiment Data Processing at EE department, GSI 00005 //----------------------------------------------------------------------- 00006 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH 00007 // Planckstr. 1, 64291 Darmstadt, Germany 00008 // Contact: http://go4.gsi.de 00009 //----------------------------------------------------------------------- 00010 // This software can be used under the license agreements as stated 00011 // in Go4License.txt file which is part of the distribution. 00012 //----------------------------------------------------------------------- 00013 00014 #ifndef TGO4MAINTREE_H 00015 #define TGO4MAINTREE_H 00016 00017 #include "TObject.h" 00018 00019 class TTree; 00020 class TFile; 00021 00032 class TGo4MainTree : public TObject { 00033 friend class TGo4TreeSource; 00034 friend class TGo4TreeStore; 00035 00036 protected: 00039 TTree* GetTree() { return fxTree; } 00040 00041 TGo4MainTree(); 00042 00043 public: 00044 00045 virtual ~TGo4MainTree(); 00046 00048 static const char* fgcTREENAME; 00049 00051 static const char* fgcFILENAME; 00052 00054 static const Int_t fgiCOMPRESS; 00055 00057 static const Int_t fgiAUTOSAVESIZE; 00058 00059 static TGo4MainTree * Instance(); 00060 00064 static Bool_t Exists() { return fxInstance!=0; } 00065 00066 Int_t GetCurrentIndex() const { return fiCurrentIndex; } 00067 00071 Int_t IncCurrentIndex() { return (++fiCurrentIndex); } 00072 00073 void SetCurrentIndex(Int_t number=0) { fiCurrentIndex = number; } 00074 00075 Int_t GetMaxIndex(); 00076 00078 void SetAutoSave(Int_t bytesinterval); 00079 00083 void Update(); 00084 00086 virtual Int_t Write(const char* dummy=0, Int_t option=0, Int_t bufsize=0); 00087 virtual Int_t Write(const char* dummy=0, Int_t option=0, Int_t bufsize=0) const; 00088 00089 private: 00090 00091 static TGo4MainTree * fxInstance; 00092 00093 TFile* fxFile; 00094 00095 TTree * fxTree; 00096 00099 Int_t fiMaxIndex; 00100 00102 Int_t fiCurrentIndex; 00103 00104 ClassDef(TGo4MainTree,1) 00105 }; 00106 00107 #endif //TGO4MAINTREE_H