Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4MbsFileParameter.h"
00015
00016 #include "TObjString.h"
00017
00018 #include "TGo4Log.h"
00019 #include "TGo4Status.h"
00020 #include "Go4EventServerTypes.h"
00021
00022 const char* TGo4MbsFile__fgcNOTAGFILE = "GO4-NOLMDTAG";
00023
00024 TGo4MbsFileParameter::TGo4MbsFileParameter() :
00025 TGo4MbsSourceParameter(),
00026 fxTagFile(),
00027 fxMoreFiles()
00028 {
00029 GO4TRACE((14,"TGo4MbsFileParameter::TGo4MbsFileParameter()", __LINE__, __FILE__));
00030 SetTagName(TGo4MbsFile__fgcNOTAGFILE);
00031 }
00032
00033 TGo4MbsFileParameter::TGo4MbsFileParameter(const char* name) :
00034 TGo4MbsSourceParameter(name, GO4EV_MBS_FILE),
00035 fxTagFile(),
00036 fxMoreFiles()
00037 {
00038 GO4TRACE((14,"TGo4MbsFileParameter::TGo4MbsFileParameter(const char*,...)", __LINE__, __FILE__));
00039 SetTagName(TGo4MbsFile__fgcNOTAGFILE);
00040 }
00041
00042 TGo4MbsFileParameter::~TGo4MbsFileParameter()
00043 {
00044 GO4TRACE((14,"TGo4MbsFileParameter::~TGo4MbsFileParameter()", __LINE__, __FILE__));
00045 }
00046
00047 void TGo4MbsFileParameter::AddMoreFile(const char* more)
00048 {
00049 TGo4Log::Debug("Add more lmd file %s", more);
00050
00051 fxMoreFiles.SetOwner(kTRUE);
00052 fxMoreFiles.Add(new TObjString(more));
00053 }
00054
00055 const char* TGo4MbsFileParameter::GetMoreName(Int_t n) const
00056 {
00057 return (n>=0) && (n<=fxMoreFiles.GetLast()) ? fxMoreFiles.At(n)->GetName() : 0;
00058 }
00059
00060
00061 Int_t TGo4MbsFileParameter::PrintParameter(Text_t* buffer, Int_t buflen)
00062 {
00063 GO4TRACE((12,"TGo4MbsFileParameter::PrintParameter()",__LINE__, __FILE__));
00064 Int_t locallen=128000;
00065 Text_t localbuf[128000];
00066 if(buflen<0 && buffer!=0)
00067 return 0;
00068 Int_t size=0;
00069 Int_t restlen = locallen;
00070 Text_t* current = localbuf;
00071
00072 Int_t delta = TGo4MbsSourceParameter::PrintParameter(current,restlen);
00073 restlen-=delta;
00074 current+= delta;
00075 current=TGo4Status::PrintBuffer(current,restlen, "Tagfile: %s \n",GetTagName());
00076 if(buffer==0)
00077 {
00078 std::cout << localbuf << std::endl;
00079 }
00080 else
00081 {
00082 size=locallen-restlen;
00083 if(size>buflen-1)
00084 size=buflen-1;
00085 strncpy(buffer,localbuf,size);
00086 }
00087 return size;
00088 }
00089
00090 Bool_t TGo4MbsFileParameter::UpdateFrom(TGo4Parameter* rhs)
00091 {
00092 GO4TRACE((12,"TGo4MbsFileParameter::UpdateFrom()",__LINE__, __FILE__));
00093 if((rhs!=0) && rhs->InheritsFrom(TGo4MbsFileParameter::Class())) {
00094 TGo4MbsFileParameter* mbspar=dynamic_cast<TGo4MbsFileParameter*>(rhs);
00095 if(!mbspar) return kFALSE;
00096 if(!TGo4MbsSourceParameter::UpdateFrom(rhs)) return kFALSE;
00097 SetTagName(mbspar->GetTagName());
00098 return kTRUE;
00099 }
00100
00101 return kFALSE;
00102 }