Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4EventSourceParameter.h"
00015
00016 #include "TGo4Status.h"
00017 #include "TGo4Log.h"
00018
00019 const Int_t TGo4EventSource__fgiTIMEOUTDEFAULT = 1;
00020
00021 TGo4EventSourceParameter::TGo4EventSourceParameter(const char* name, Int_t id)
00022 : TGo4Parameter (name), fiID(id),
00023 fiTimeout(TGo4EventSource__fgiTIMEOUTDEFAULT)
00024 {
00025 GO4TRACE((12,"TGo4EventSourceParameter::TGo4EventSourceParameter(const char*)",__LINE__, __FILE__));
00026 }
00027
00028
00029 TGo4EventSourceParameter::TGo4EventSourceParameter()
00030 : TGo4Parameter ("Default Event Source Parameter"), fiID(0),
00031 fiTimeout(TGo4EventSource__fgiTIMEOUTDEFAULT)
00032 {
00033 GO4TRACE((12,"TGo4EventSourceParameter::TGo4EventSourceParameter()",__LINE__, __FILE__));
00034 }
00035
00036 TGo4EventSourceParameter::~TGo4EventSourceParameter()
00037 {
00038 GO4TRACE((12,"TGo4EventSourceParameter::~TGo4EventSourceParameter()",__LINE__, __FILE__));
00039 }
00040
00041 Int_t TGo4EventSourceParameter::PrintParameter(Text_t* buffer, Int_t buflen)
00042 {
00043 GO4TRACE((12,"TGo4EventSourceParameter::PrintParameter()",__LINE__, __FILE__));
00044 Int_t locallen=64000;
00045 Text_t localbuf[64000];
00046 if(buflen<0 && buffer!=0)
00047 return 0;
00048 Int_t size=0;
00049 Int_t restlen=locallen;
00050 Text_t* current=localbuf;
00051 current=TGo4Status::PrintIndent(current,restlen);
00052 TString woparam=ClassName();
00053 woparam.ReplaceAll("Parameter","");
00054 current=TGo4Status::PrintBuffer(current,restlen, "Eventsource: %s \n",woparam.Data());
00055 current=TGo4Status::PrintIndent(current,restlen);
00056 current=TGo4Status::PrintBuffer(current,restlen, " Name: \t%s \n",GetName());
00057 current=TGo4Status::PrintIndent(current,restlen);
00058 current=TGo4Status::PrintBuffer(current,restlen, " Timeout: \t%d s\n",GetTimeout());
00059
00060
00061 if(buffer==0)
00062 {
00063 std::cout << localbuf << std::endl;
00064 }
00065 else
00066 {
00067 size=locallen-restlen;
00068 if(size>buflen-1)
00069 size=buflen-1;
00070 strncpy(buffer,localbuf,size);
00071 }
00072 return size;
00073 }
00074
00075 Bool_t TGo4EventSourceParameter::UpdateFrom(TGo4Parameter* rhs)
00076 {
00077 GO4TRACE((12,"TGo4EventSourceParameter::UpdateFrom()",__LINE__, __FILE__));
00078 TGo4EventSourceParameter* srcpar=dynamic_cast<TGo4EventSourceParameter*>(rhs);
00079 if (srcpar==0) return kFALSE;
00080 SetName(srcpar->GetName());
00081 SetTimeout(srcpar->GetTimeout());
00082 fiID=srcpar->GetID();
00083 return kTRUE;
00084 }