GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4HDF5StoreParameter.cxx
Go to the documentation of this file.
1 // $Id: TGo4HDF5StoreParameter.cxx 2687 2020-01-10 13:32:26Z 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 "TGo4HDF5StoreParameter.h"
15 
16 #include "TGo4Status.h"
17 #include "TGo4Log.h"
18 #include "Go4EventServerTypes.h"
19 
21  Go4_H5_File_Flags flags)
23  fiFlags(flags)
24 {
25  GO4TRACE((14,"TGo4HDF5StoreParameter::TGo4HDF5StoreParameter(const char*,...)", __LINE__, __FILE__));
26  SetTitle(name);
27 }
28 
30 : TGo4EventStoreParameter("Default Go4 HDF5 Store", GO4EV_HDF5),
31  fiFlags(GO4_H5F_ACC_NONE)
32 {
33  GO4TRACE((14,"TGo4HDF5StoreParameter::TGo4HDF5StoreParameter()", __LINE__, __FILE__));
34  SetTitle("Go4HDF5Store");
35 }
36 
38 {
39 }
40 
41 Int_t TGo4HDF5StoreParameter::PrintParameter(Text_t* buffer, Int_t buflen)
42 {
43  GO4TRACE((12,"TGo4HDF5StoreParameter::PrintParameter()",__LINE__, __FILE__));
44  Int_t locallen=128000;
45  Text_t localbuf[128000];
46  if(buflen<0 && buffer!=0)
47  return 0;
48  Int_t size=0;
49  Int_t restlen=locallen;
50  Text_t* current=localbuf;
51  Int_t delta=TGo4EventStoreParameter::PrintParameter(current,restlen);
52  restlen-=delta;
53  current+=delta;
54  current=TGo4Status::PrintIndent(current,restlen);
55  current=TGo4Status::PrintBuffer(current,restlen, " File flags: \t%d \n",fiFlags);
56  if(buffer==0)
57  {
58  std::cout << localbuf << std::endl;
59  }
60  else
61  {
62  size=locallen-restlen;
63  if(size>buflen-1)
64  size=buflen-1;
65  strncpy(buffer,localbuf,size);
66  }
67  return size;
68 }
69 
70 
72 {
73  GO4TRACE((12,"TGo4HDF5StoreParameter::UpdateFrom()",__LINE__, __FILE__));
74 
75  TGo4HDF5StoreParameter* filepar=dynamic_cast<TGo4HDF5StoreParameter*>(rhs);
76  if (filepar==0) return kFALSE;
77  if(!TGo4EventStoreParameter::UpdateFrom(rhs)) return kFALSE;
78  SetHDF5Flags(filepar->GetHDF5Flags());
79  return kTRUE;
80 }
static Text_t * PrintIndent(Text_t *buffer, Int_t &buflen)
Definition: TGo4Status.cxx:72
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
virtual Int_t PrintParameter(Text_t *buffer=0, Int_t buflen=0)
Go4_H5_File_Flags
Definition: Go4HDF5.h:41
virtual Bool_t UpdateFrom(TGo4Parameter *rhs)
Go4_H5_File_Flags GetHDF5Flags() const
void SetHDF5Flags(Go4_H5_File_Flags flags)
#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:84