00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4TreeStoreParameter.h"
00015
00016 #include "Go4EventServerTypes.h"
00017 #include "TGo4Status.h"
00018 #include "TGo4Log.h"
00019
00020 TGo4TreeStoreParameter::TGo4TreeStoreParameter(const char* name,
00021 Int_t splitlevel,
00022 Int_t bufsize,
00023 const char* filename,
00024 Int_t compression)
00025 : TGo4EventStoreParameter(name, GO4EV_TREE),
00026 fiSplit(splitlevel), fiBufsize(bufsize), fiCompression(compression)
00027 {
00028 GO4TRACE((14,"TGo4TreeStoreParameter::TGo4TreeStoreParameter(const char*,...)", __LINE__, __FILE__));
00029 if(filename) fxBranchFile = filename;
00030 else fxBranchFile="";
00031 }
00032
00033 TGo4TreeStoreParameter::TGo4TreeStoreParameter()
00034 : TGo4EventStoreParameter("default go4 treestore", GO4EV_TREE),
00035 fiSplit(1), fiBufsize(64000), fiCompression(5), fxBranchFile("")
00036 {
00037 GO4TRACE((14,"TGo4TreeStoreParameter::TGo4TreeStoreParameter()", __LINE__, __FILE__));
00038
00039
00040 }
00041
00042
00043 TGo4TreeStoreParameter::~TGo4TreeStoreParameter()
00044 {
00045 GO4TRACE((14,"TGo4TreeStoreParameter::~TGo4TreeStoreParameter()", __LINE__, __FILE__));
00046 }
00047
00048 Int_t TGo4TreeStoreParameter::PrintParameter(Text_t* buffer, Int_t buflen)
00049 {
00050 GO4TRACE((12,"TGo4TreeStoreParameter::PrintParameter()",__LINE__, __FILE__));
00051 Int_t locallen=128000;
00052 Text_t localbuf[128000];
00053 if(buflen<0 && buffer!=0)
00054 return 0;
00055 Int_t size=0;
00056 Text_t* current=localbuf;
00057 Int_t restlen=locallen;
00058 Int_t delta=TGo4EventStoreParameter::PrintParameter(current,restlen);
00059 restlen-=delta;
00060 current+=delta;
00061 current=TGo4Status::PrintIndent(current,restlen);
00062 current=TGo4Status::PrintBuffer(current,restlen, " Split level: \t%d \n",fiSplit);
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, " Buffer size: \t%d \n",fiBufsize);
00067 if(!fxBranchFile.IsNull()) {
00068 current=TGo4Status::PrintIndent(current,restlen);
00069 current=TGo4Status::PrintBuffer(current,restlen, " Branch file name: \t%s \n",fxBranchFile.Data());
00070 }
00071 if(buffer==0)
00072 {
00073 std::cout << localbuf << std::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 Bool_t TGo4TreeStoreParameter::UpdateFrom(TGo4Parameter* rhs)
00086 {
00087 GO4TRACE((12,"TGo4TreeStoreParameter::UpdateFrom()",__LINE__, __FILE__));
00088 if((rhs!=0) && rhs->InheritsFrom(TGo4TreeStoreParameter::Class()))
00089 {
00090 TGo4TreeStoreParameter* treepar=dynamic_cast<TGo4TreeStoreParameter*>(rhs);
00091 if(!treepar) return kFALSE;
00092 if(!TGo4EventStoreParameter::UpdateFrom(rhs)) return kFALSE;
00093 fiSplit=treepar->fiSplit;
00094 fiBufsize=treepar->fiBufsize;
00095 fiCompression=treepar->fiCompression;
00096 return kTRUE;
00097 }
00098 else
00099 {
00100 return kFALSE;
00101 }
00102 return kFALSE;
00103 }