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