GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4TreeStoreParameter.cxx
Go to the documentation of this file.
1 // $Id: TGo4TreeStoreParameter.cxx 3063 2021-03-12 15:27: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 fuer 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 
42 {
43  GO4TRACE((14,"TGo4TreeStoreParameter::~TGo4TreeStoreParameter()", __LINE__, __FILE__));
44 }
45 
46 Int_t TGo4TreeStoreParameter::PrintParameter(Text_t* buffer, Int_t buflen)
47 {
48  GO4TRACE((12,"TGo4TreeStoreParameter::PrintParameter()",__LINE__, __FILE__));
49  Int_t locallen=128000;
50  Text_t localbuf[128000];
51  if(buflen<0 && buffer!=0)
52  return 0;
53  Int_t size=0;
54  Text_t* current=localbuf;
55  Int_t restlen=locallen;
56  Int_t delta=TGo4EventStoreParameter::PrintParameter(current,restlen);
57  restlen-=delta;
58  current+=delta;
59  current=TGo4Status::PrintIndent(current,restlen);
60  current=TGo4Status::PrintBuffer(current,restlen, " Split level: \t%d \n",fiSplit);
61  current=TGo4Status::PrintIndent(current,restlen);
62  current=TGo4Status::PrintBuffer(current,restlen, " Compression level: \t%d \n",fiCompression);
63  current=TGo4Status::PrintIndent(current,restlen);
64  current=TGo4Status::PrintBuffer(current,restlen, " Buffer size: \t%d \n",fiBufsize);
65  if(!fxBranchFile.IsNull()) {
66  current=TGo4Status::PrintIndent(current,restlen);
67  current=TGo4Status::PrintBuffer(current,restlen, " Branch file name: \t%s \n",fxBranchFile.Data());
68  }
69  if(buffer==0)
70  {
71  std::cout << localbuf << std::endl;
72  }
73  else
74  {
75  size=locallen-restlen;
76  if(size>buflen-1)
77  size=buflen-1;
78  strncpy(buffer,localbuf,size);
79  }
80  return size;
81 }
82 
84 {
85  GO4TRACE((12,"TGo4TreeStoreParameter::UpdateFrom()",__LINE__, __FILE__));
86  if((rhs!=0) && rhs->InheritsFrom(TGo4TreeStoreParameter::Class())) {
87  TGo4TreeStoreParameter* treepar=dynamic_cast<TGo4TreeStoreParameter*>(rhs);
88  if(!treepar) return kFALSE;
89  if(!TGo4EventStoreParameter::UpdateFrom(rhs)) return kFALSE;
90  fiSplit=treepar->fiSplit;
91  fiBufsize=treepar->fiBufsize;
93  return kTRUE;
94  }
95  return kFALSE;
96 }
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:84