Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4Event/TGo4EventSourceParameter.cxx

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #include "TGo4EventSourceParameter.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "TGo4EventSource.h"
00021 #include "Go4StatusBase/TGo4Status.h"
00022 #include "Go4Log/TGo4Log.h"
00023 
00024 TGo4EventSourceParameter::TGo4EventSourceParameter(const char* name, Int_t id)
00025 : TGo4Parameter (name), fiID(id),
00026    fiTimeout(TGo4EventSource::fgiTIMEOUTDEFAULT)
00027 {
00028    TRACE((12,"TGo4EventSourceParameter::TGo4EventSourceParameter(const char*)",__LINE__, __FILE__));
00029 }
00030 
00031 
00032 TGo4EventSourceParameter::TGo4EventSourceParameter()
00033 : TGo4Parameter ("Default Event Source Parameter"), fiID(0),
00034    fiTimeout(TGo4EventSource::fgiTIMEOUTDEFAULT)
00035 {
00036    TRACE((12,"TGo4EventSourceParameter::TGo4EventSourceParameter()",__LINE__, __FILE__));
00037 }
00038 
00039 
00040 TGo4EventSourceParameter::~TGo4EventSourceParameter()
00041 {
00042    TRACE((12,"TGo4EventSourceParameter::~TGo4EventSourceParameter()",__LINE__, __FILE__));
00043 }
00044 
00045 Int_t TGo4EventSourceParameter::PrintParameter(Text_t* buffer, Int_t buflen)
00046 {
00047    TRACE((12,"TGo4EventSourceParameter::PrintParameter()",__LINE__, __FILE__));
00048    Int_t locallen=64000;
00049    Text_t localbuf[locallen];
00050    if(buflen<0 && buffer!=0)
00051       return 0;
00052    Int_t size=0;
00053    Int_t restlen=locallen;
00054    Text_t* current=localbuf;
00055    current=TGo4Status::PrintIndent(current,restlen);
00056    TString woparam=ClassName();
00057    woparam.ReplaceAll("Parameter","");
00058    current=TGo4Status::PrintBuffer(current,restlen, "Eventsource: %s \n",woparam.Data());
00059    current=TGo4Status::PrintIndent(current,restlen);
00060    current=TGo4Status::PrintBuffer(current,restlen, "  Name: \t%s \n",GetName());
00061    current=TGo4Status::PrintIndent(current,restlen);
00062    current=TGo4Status::PrintBuffer(current,restlen, "  Timeout: \t%d s\n",GetTimeout());
00063 //   current=TGo4Status::PrintIndent(current,restlen);
00064 //   current=TGo4Status::PrintBuffer(current,restlen, "  ID: \t\t%d \n",GetID());
00065    if(buffer==0)
00066       {
00067           cout << localbuf << endl;
00068       }
00069    else
00070       {
00071          size=locallen-restlen;
00072          if(size>buflen-1)
00073             size=buflen-1;
00074          strncpy(buffer,localbuf,size);
00075       }
00076    return size;
00077 }
00078 
00079 Bool_t TGo4EventSourceParameter::UpdateFrom(TGo4Parameter* rhs)
00080 {
00081    TRACE((12,"TGo4EventSourceParameter::UpdateFrom()",__LINE__, __FILE__));
00082    if(rhs && rhs->InheritsFrom("TGo4EventSourceParameter"))
00083       {
00084          TGo4EventSourceParameter* srcpar=dynamic_cast<TGo4EventSourceParameter*>(rhs);
00085          if(!srcpar) return kFALSE;
00086          SetName(srcpar->GetName());
00087          SetTimeout(srcpar->GetTimeout());
00088          fiID=srcpar->GetID();
00089          return kTRUE;
00090       }
00091    else
00092       {
00093           return kFALSE;
00094       }
00095    return kFALSE;
00096 }
00097 
00098 ClassImp(TGo4EventSourceParameter)
00099 
00100 
00101 
00102 
00103 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:53 2005 for Go4-v2.10-5 by doxygen1.2.15