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