GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4TreeStoreParameter.cxx
Go to the documentation of this file.
1 // $Id: TGo4TreeStoreParameter.cxx 999 2013-07-25 11:58:59Z 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 #include "TGo4TreeStoreParameter.h"
15 
16 #include "Go4EventServerTypes.h"
17 #include "TGo4Status.h"
18 #include "TGo4Log.h"
19 
21  Int_t splitlevel,
22  Int_t bufsize,
23  const char* filename,
24  Int_t compression)
26  fiSplit(splitlevel), fiBufsize(bufsize), fiCompression(compression)
27 {
28  GO4TRACE((14,"TGo4TreeStoreParameter::TGo4TreeStoreParameter(const char*,...)", __LINE__, __FILE__));
29  if(filename) fxBranchFile = filename;
30  else fxBranchFile="";
31 }
32 
34 : TGo4EventStoreParameter("default go4 treestore", GO4EV_TREE),
35  fiSplit(1), fiBufsize(64000), fiCompression(5), fxBranchFile("")
36 {
37  GO4TRACE((14,"TGo4TreeStoreParameter::TGo4TreeStoreParameter()", __LINE__, __FILE__));
38 
39 
40 }
41 
42 
44 {
45  GO4TRACE((14,"TGo4TreeStoreParameter::~TGo4TreeStoreParameter()", __LINE__, __FILE__));
46 }
47 
48 Int_t TGo4TreeStoreParameter::PrintParameter(Text_t* buffer, Int_t buflen)
49 {
50  GO4TRACE((12,"TGo4TreeStoreParameter::PrintParameter()",__LINE__, __FILE__));
51  Int_t locallen=128000;
52  Text_t localbuf[128000];
53  if(buflen<0 && buffer!=0)
54  return 0;
55  Int_t size=0;
56  Text_t* current=localbuf;
57  Int_t restlen=locallen;
58  Int_t delta=TGo4EventStoreParameter::PrintParameter(current,restlen);
59  restlen-=delta;
60  current+=delta;
61  current=TGo4Status::PrintIndent(current,restlen);
62  current=TGo4Status::PrintBuffer(current,restlen, " Split level: \t%d \n",fiSplit);
63  current=TGo4Status::PrintIndent(current,restlen);
64  current=TGo4Status::PrintBuffer(current,restlen, " Compression level: \t%d \n",fiCompression);
65  current=TGo4Status::PrintIndent(current,restlen);
66  current=TGo4Status::PrintBuffer(current,restlen, " Buffer size: \t%d \n",fiBufsize);
67  if(!fxBranchFile.IsNull()) {
68  current=TGo4Status::PrintIndent(current,restlen);
69  current=TGo4Status::PrintBuffer(current,restlen, " Branch file name: \t%s \n",fxBranchFile.Data());
70  }
71  if(buffer==0)
72  {
73  std::cout << localbuf << std::endl;
74  }
75  else
76  {
77  size=locallen-restlen;
78  if(size>buflen-1)
79  size=buflen-1;
80  strncpy(buffer,localbuf,size);
81  }
82  return size;
83 }
84 
86 {
87  GO4TRACE((12,"TGo4TreeStoreParameter::UpdateFrom()",__LINE__, __FILE__));
88  if((rhs!=0) && rhs->InheritsFrom(TGo4TreeStoreParameter::Class()))
89  {
90  TGo4TreeStoreParameter* treepar=dynamic_cast<TGo4TreeStoreParameter*>(rhs);
91  if(!treepar) return kFALSE;
92  if(!TGo4EventStoreParameter::UpdateFrom(rhs)) return kFALSE;
93  fiSplit=treepar->fiSplit;
94  fiBufsize=treepar->fiBufsize;
96  return kTRUE;
97  }
98  else
99  {
100  return kFALSE;
101  }
102  return kFALSE;
103 }
static Text_t * PrintIndent(Text_t *buffer, Int_t &buflen)
Definition: TGo4Status.cxx:72
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
#define GO4TRACE(X)
Definition: TGo4Log.h:26
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)
static Text_t * PrintBuffer(char *buffer, Int_t &buflen, const char *text,...)
Definition: TGo4Status.cxx:85