GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4FileStoreParameter.cxx
Go to the documentation of this file.
1 // $Id: TGo4FileStoreParameter.cxx 1636 2015-06-24 12:05:31Z adamczew $
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 "TGo4FileStoreParameter.h"
15 
16 #include "TGo4Status.h"
17 #include "TGo4Log.h"
18 #include "Go4EventServerTypes.h"
19 
21  Int_t splitlevel,
22  Int_t bufsize,
23  Int_t compression,
24  Int_t autosave)
26  fiSplit(splitlevel), fiBufsize(bufsize),
27  fiCompression(compression), fiAutosavesize(autosave), fbOverwrite(1)
28 {
29  GO4TRACE((14,"TGo4FileStoreParameter::TGo4FileStoreParameter(const char*,...)", __LINE__, __FILE__));
30  SetTitle(name);
31 }
32 
34 : TGo4EventStoreParameter("Default Go4 FileStore", GO4EV_FILE),
35  fiSplit(99), fiBufsize(64000),
36  fiCompression(5), fiAutosavesize(10000), fbOverwrite(1)
37 {
38  GO4TRACE((14,"TGo4FileStoreParameter::TGo4FileStoreParameter()", __LINE__, __FILE__));
39  SetTitle("Go4FileStore-Tree");
40 }
41 
43 {
44  GO4TRACE((14,"TGo4FileStoreParameter::~TGo4FileStoreParameter()", __LINE__, __FILE__));
45 }
46 Int_t TGo4FileStoreParameter::PrintParameter(Text_t* buffer, Int_t buflen)
47 {
48  GO4TRACE((12,"TGo4FileStoreParameter::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  Int_t restlen=locallen;
55  Text_t* current=localbuf;
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, " Buffer size: \t%d bytes\n",fiBufsize);
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, " Tree autosave at: \t%d bytes\n",fiAutosavesize);
67  if(buffer==0)
68  {
69  std::cout << localbuf << std::endl;
70  }
71  else
72  {
73  size=locallen-restlen;
74  if(size>buflen-1)
75  size=buflen-1;
76  strncpy(buffer,localbuf,size);
77  }
78  return size;
79 }
80 
81 
83 {
84  GO4TRACE((12,"TGo4FileStoreParameter::UpdateFrom()",__LINE__, __FILE__));
85 
86  TGo4FileStoreParameter* filepar=dynamic_cast<TGo4FileStoreParameter*>(rhs);
87  if (filepar==0) return kFALSE;
88 
89  if(!TGo4EventStoreParameter::UpdateFrom(rhs)) return kFALSE;
90  SetSplitlevel(filepar->GetSplitlevel());
91  SetBufsize(filepar->GetBufsize());
92  SetCompression(filepar->GetCompression());
94  SetAutosaveSize(filepar->GetAutosaveSize());
95  return kTRUE;
96 }
void SetSplitlevel(Int_t split)
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
void SetAutosaveSize(Int_t interval)
static Text_t * PrintIndent(Text_t *buffer, Int_t &buflen)
Definition: TGo4Status.cxx:72
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
void SetOverwriteMode(Bool_t over=kTRUE)
void SetBufsize(Int_t bufsize)
#define GO4TRACE(X)
Definition: TGo4Log.h:26
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