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