GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4BackStoreParameter.cxx
Go to the documentation of this file.
1 // $Id: TGo4BackStoreParameter.cxx 2627 2019-10-01 08:02:45Z 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 "TGo4BackStoreParameter.h"
15 
16 #include "TGo4Status.h"
17 #include "TGo4Log.h"
18 #include "Go4EventServerTypes.h"
19 
21  Int_t splitlevel,
22  Int_t bufsize)
24  fiSplit(splitlevel), fiBufsize(bufsize)
25 {
26  GO4TRACE((14,"TGo4FileStoreParameter::TGo4FileStoreParameter(const char*,...)", __LINE__, __FILE__));
27  SetTitle(name);
28 }
29 
31 : TGo4EventStoreParameter("Default Go4 FileStore", GO4EV_BACK),
32  fiSplit(99), fiBufsize(64000)
33 {
34  GO4TRACE((14,"TGo4FileStoreParameter::TGo4FileStoreParameter()", __LINE__, __FILE__));
35  SetTitle("Go4FileStore-Tree");
36 }
37 
39 {
40  GO4TRACE((14,"TGo4FileStoreParameter::~TGo4FileStoreParameter()", __LINE__, __FILE__));
41 }
42 
43 Int_t TGo4BackStoreParameter::PrintParameter(Text_t* buffer, Int_t buflen)
44 {
45  GO4TRACE((12,"TGo4FileStoreParameter::PrintParameter()",__LINE__, __FILE__));
46  Int_t locallen=128000;
47  Text_t localbuf[128000];
48  if(buflen<0 && buffer!=0) return 0;
49  Int_t size=0;
50  Int_t restlen=locallen;
51  Text_t* current=localbuf;
52  Int_t delta=TGo4EventStoreParameter::PrintParameter(current,restlen);
53  restlen-=delta;
54  current+=delta;
55  current=TGo4Status::PrintIndent(current,restlen);
56  current=TGo4Status::PrintBuffer(current,restlen, " Split level: \t%d \n",fiSplit);
57  current=TGo4Status::PrintIndent(current,restlen);
58  current=TGo4Status::PrintBuffer(current,restlen, " Buffer size: \t%d bytes \n",fiBufsize);
59  if(buffer==0)
60  {
61  std::cout << localbuf << std::endl;
62  }
63  else
64  {
65  size=locallen-restlen;
66  if(size>buflen-1)
67  size=buflen-1;
68  strncpy(buffer,localbuf,size);
69  }
70  return size;
71 }
72 
74 {
75  GO4TRACE((12,"TGo4BackStoreParameter::UpdateFrom()",__LINE__, __FILE__));
76  TGo4BackStoreParameter* backpar=dynamic_cast<TGo4BackStoreParameter*>(rhs);
77  if(backpar==0) return kFALSE;
78  if(!TGo4EventStoreParameter::UpdateFrom(rhs)) return kFALSE;
79  SetSplitlevel(backpar->GetSplitlevel());
80  SetBufsize(backpar->GetBufsize());
81  return kTRUE;
82 }
void SetSplitlevel(Int_t split)
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
static Text_t * PrintIndent(Text_t *buffer, Int_t &buflen)
Definition: TGo4Status.cxx:72
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)
void SetBufsize(Int_t bufsize)
static Text_t * PrintBuffer(char *buffer, Int_t &buflen, const char *text,...)
Definition: TGo4Status.cxx:84
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)