GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4MainTree.h
Go to the documentation of this file.
1 // $Id: TGo4MainTree.h 478 2009-10-29 12:26:09Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4MAINTREE_H
15 #define TGO4MAINTREE_H
16 
17 #include "TObject.h"
18 
19 class TTree;
20 class TFile;
21 
32 class TGo4MainTree : public TObject {
33  friend class TGo4TreeSource;
34  friend class TGo4TreeStore;
35 
36  protected:
39  TTree* GetTree() { return fxTree; }
40 
41  TGo4MainTree();
42 
43  public:
44 
45  virtual ~TGo4MainTree();
46 
48  static const char* fgcTREENAME;
49 
51  static const char* fgcFILENAME;
52 
54  static const Int_t fgiCOMPRESS;
55 
57  static const Int_t fgiAUTOSAVESIZE;
58 
59  static TGo4MainTree * Instance();
60 
64  static Bool_t Exists() { return fxInstance!=0; }
65 
66  Int_t GetCurrentIndex() const { return fiCurrentIndex; }
67 
71  Int_t IncCurrentIndex() { return (++fiCurrentIndex); }
72 
73  void SetCurrentIndex(Int_t number=0) { fiCurrentIndex = number; }
74 
75  Int_t GetMaxIndex();
76 
78  void SetAutoSave(Int_t bytesinterval);
79 
83  void Update();
84 
86  virtual Int_t Write(const char* dummy=0, Int_t option=0, Int_t bufsize=0);
87  virtual Int_t Write(const char* dummy=0, Int_t option=0, Int_t bufsize=0) const;
88 
89  private:
90 
92 
93  TFile* fxFile;
94 
95  TTree * fxTree;
96 
99  Int_t fiMaxIndex;
100 
103 
104  ClassDef(TGo4MainTree,1)
105 };
106 
107 #endif //TGO4MAINTREE_H
static TGo4MainTree * Instance()
Int_t fiCurrentIndex
Definition: TGo4MainTree.h:102
static const Int_t fgiCOMPRESS
Definition: TGo4MainTree.h:54
void SetAutoSave(Int_t bytesinterval)
Int_t GetMaxIndex()
TTree * GetTree()
Definition: TGo4MainTree.h:39
Int_t IncCurrentIndex()
Definition: TGo4MainTree.h:71
virtual ~TGo4MainTree()
static Bool_t Exists()
Definition: TGo4MainTree.h:64
TTree * fxTree
Definition: TGo4MainTree.h:95
TFile * fxFile
Definition: TGo4MainTree.h:93
static const char * fgcTREENAME
Definition: TGo4MainTree.h:48
static TGo4MainTree * fxInstance
Definition: TGo4MainTree.h:91
Int_t GetCurrentIndex() const
Definition: TGo4MainTree.h:66
Int_t fiMaxIndex
Definition: TGo4MainTree.h:99
static const char * fgcFILENAME
Definition: TGo4MainTree.h:51
void SetCurrentIndex(Int_t number=0)
Definition: TGo4MainTree.h:73
virtual Int_t Write(const char *dummy=0, Int_t option=0, Int_t bufsize=0)
static const Int_t fgiAUTOSAVESIZE
Definition: TGo4MainTree.h:57