00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "TGo4FileStoreParameter.h"
00017
00018 #include "Riostream.h"
00019
00020 #include "TGo4Status.h"
00021 #include "TGo4Log.h"
00022 #include "Go4EventServerTypes.h"
00023
00024 TGo4FileStoreParameter::TGo4FileStoreParameter(const char* name,
00025 Int_t splitlevel,
00026 Int_t bufsize,
00027 Int_t compression,
00028 Int_t autosave)
00029 : TGo4EventStoreParameter(name, GO4EV_FILE),
00030 fiSplit(splitlevel), fiBufsize(bufsize),
00031 fiCompression(compression), fiAutosavesize(autosave), fbOverwrite(1)
00032 {
00033 TRACE((14,"TGo4FileStoreParameter::TGo4FileStoreParameter(Text_t*,...)", __LINE__, __FILE__));
00034 SetTitle(name);
00035 }
00036
00037 TGo4FileStoreParameter::TGo4FileStoreParameter()
00038 : TGo4EventStoreParameter("Default Go4 FileStore", GO4EV_FILE),
00039 fiSplit(99), fiBufsize(64000),
00040 fiCompression(5), fiAutosavesize(5000000), fbOverwrite(1)
00041 {
00042 TRACE((14,"TGo4FileStoreParameter::TGo4FileStoreParameter()", __LINE__, __FILE__));
00043 SetTitle("Go4FileStore-Tree");
00044 }
00045
00046 TGo4FileStoreParameter::~TGo4FileStoreParameter()
00047 {
00048 TRACE((14,"TGo4FileStoreParameter::~TGo4FileStoreParameter()", __LINE__, __FILE__));
00049 }
00050 Int_t TGo4FileStoreParameter::PrintParameter(Text_t* buffer, Int_t buflen)
00051 {
00052 TRACE((12,"TGo4FileStoreParameter::PrintParameter()",__LINE__, __FILE__));
00053 Int_t locallen=128000;
00054 Text_t localbuf[128000];
00055 if(buflen<0 && buffer!=0)
00056 return 0;
00057 Int_t size=0;
00058 Int_t restlen=locallen;
00059 Text_t* current=localbuf;
00060 Int_t delta=TGo4EventStoreParameter::PrintParameter(current,restlen);
00061 restlen-=delta;
00062 current+=delta;
00063 current=TGo4Status::PrintIndent(current,restlen);
00064 current=TGo4Status::PrintBuffer(current,restlen, " Split level: \t%d \n",fiSplit);
00065 current=TGo4Status::PrintIndent(current,restlen);
00066 current=TGo4Status::PrintBuffer(current,restlen, " Buffer size: \t%d bytes\n",fiBufsize);
00067 current=TGo4Status::PrintIndent(current,restlen);
00068 current=TGo4Status::PrintBuffer(current,restlen, " Compression level: \t%d \n",fiCompression);
00069 current=TGo4Status::PrintIndent(current,restlen);
00070 current=TGo4Status::PrintBuffer(current,restlen, " Tree autosave at: \t%d bytes\n",fiAutosavesize);
00071 if(buffer==0)
00072 {
00073 cout << localbuf << endl;
00074 }
00075 else
00076 {
00077 size=locallen-restlen;
00078 if(size>buflen-1)
00079 size=buflen-1;
00080 strncpy(buffer,localbuf,size);
00081 }
00082 return size;
00083 }
00084
00085
00086 Bool_t TGo4FileStoreParameter::UpdateFrom(TGo4Parameter* rhs)
00087 {
00088 TRACE((12,"TGo4FileStoreParameter::UpdateFrom()",__LINE__, __FILE__));
00089
00090 TGo4FileStoreParameter* filepar=dynamic_cast<TGo4FileStoreParameter*>(rhs);
00091 if (filepar==0) return kFALSE;
00092
00093 if(!TGo4EventStoreParameter::UpdateFrom(rhs)) return kFALSE;
00094 SetSplitlevel(filepar->GetSplitlevel());
00095 SetBufsize(filepar->GetBufsize());
00096 SetCompression(filepar->GetCompression());
00097 SetOverwriteMode(filepar->IsOverwriteMode());
00098 SetAutosaveSize(filepar->GetAutosaveSize());
00099 return kTRUE;
00100 }
00101
00102