Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4EventSourceParameter.cxx

Go to the documentation of this file.
00001 //-------------------------------------------------------------
00002 //        Go4 Release Package v3.04-01 (build 30401)
00003 //                      28-November-2008
00004 //---------------------------------------------------------------
00005 //   The GSI Online Offline Object Oriented (Go4) Project
00006 //   Experiment Data Processing at EE 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 "Riostream.h"
00019 
00020 #include "TGo4Status.h"
00021 #include "TGo4Log.h"
00022 
00023 const Int_t TGo4EventSource__fgiTIMEOUTDEFAULT = 1;
00024 
00025 TGo4EventSourceParameter::TGo4EventSourceParameter(const char* name, Int_t id)
00026 : TGo4Parameter (name), fiID(id),
00027    fiTimeout(TGo4EventSource__fgiTIMEOUTDEFAULT)
00028 {
00029    TRACE((12,"TGo4EventSourceParameter::TGo4EventSourceParameter(const char*)",__LINE__, __FILE__));
00030 }
00031 
00032 
00033 TGo4EventSourceParameter::TGo4EventSourceParameter()
00034 : TGo4Parameter ("Default Event Source Parameter"), fiID(0),
00035    fiTimeout(TGo4EventSource__fgiTIMEOUTDEFAULT)
00036 {
00037    TRACE((12,"TGo4EventSourceParameter::TGo4EventSourceParameter()",__LINE__, __FILE__));
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[64000];
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    TGo4EventSourceParameter* srcpar=dynamic_cast<TGo4EventSourceParameter*>(rhs);
00083    if (srcpar==0) return kFALSE;
00084    SetName(srcpar->GetName());
00085    SetTimeout(srcpar->GetTimeout());
00086    fiID=srcpar->GetID();
00087    return kTRUE;
00088 }
00089 
00090 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Fri Nov 28 12:59:07 2008 for Go4-v3.04-1 by  doxygen 1.4.2