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

/Go4EventServer/TGo4MbsFileParameter.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 "TGo4MbsFileParameter.h"
00017 
00018 #include <iostream.h>
00019 
00020 #include "Go4Log/TGo4Log.h"
00021 #include "Go4StatusBase/TGo4Status.h"
00022 #include "TGo4MbsFile.h"
00023 
00024 TGo4MbsFileParameter::TGo4MbsFileParameter(const char* name)
00025 : TGo4EventSourceParameter(name, GO4EV_MBS_FILE),
00026   fuStartEvent(0) ,fuStopEvent(0), fuEventInterval(0)
00027 {
00028    TRACE((14,"TGo4MbsFileParameter::TGo4MbsFileParameter(const char*,...)", __LINE__, __FILE__));
00029    SetTagName(TGo4MbsFile::fgcNOTAGFILE);
00030 }
00031 
00032 TGo4MbsFileParameter::TGo4MbsFileParameter()
00033 : TGo4EventSourceParameter("default MBS File", GO4EV_MBS_FILE),
00034   fuStartEvent(0) ,fuStopEvent(0), fuEventInterval(0)
00035 {
00036    TRACE((14,"TGo4MbsFileParameter::TGo4MbsFileParameter()", __LINE__, __FILE__));
00037    SetTagName(TGo4MbsFile::fgcNOTAGFILE);
00038 }
00039 
00040 TGo4MbsFileParameter::~TGo4MbsFileParameter()
00041 {
00042    TRACE((14,"TGo4MbsFileParameter::~TGo4MbsFileParameter()", __LINE__, __FILE__));
00043 }
00044 
00045 Int_t TGo4MbsFileParameter::PrintParameter(Text_t* buffer, Int_t buflen)
00046 {
00047    TRACE((12,"TGo4MbsFileParameter::PrintParameter()",__LINE__, __FILE__));
00048    Int_t locallen=128000;
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    
00056    Int_t delta=TGo4EventSourceParameter::PrintParameter(current,restlen);
00057    restlen-=delta;
00058    current+= delta;
00059    current=TGo4Status::PrintIndent(current,restlen);      
00060    current=TGo4Status::PrintBuffer(current,restlen, "  Startevent: \t%d",GetStartEvent());
00061    current=TGo4Status::PrintBuffer(current,restlen, "\t Stopevent: \t%d \n",GetStopEvent());
00062    current=TGo4Status::PrintIndent(current,restlen);
00063    current=TGo4Status::PrintBuffer(current,restlen, "  Event interval: \t%d",GetEventInterval());
00064    current=TGo4Status::PrintBuffer(current,restlen, "\t Tagfile: %s \n",GetTagName());
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 
00080 
00081 Bool_t TGo4MbsFileParameter::UpdateFrom(TGo4Parameter* rhs)
00082 {
00083    TRACE((12,"TGo4MbsFileParameter::UpdateFrom()",__LINE__, __FILE__));
00084    if(rhs && rhs->InheritsFrom("TGo4MbsFileParameter"))
00085       {
00086          TGo4MbsFileParameter* mbspar=dynamic_cast<TGo4MbsFileParameter*>(rhs);
00087          if(!mbspar) return kFALSE;
00088          if(!TGo4EventSourceParameter::UpdateFrom(rhs)) return kFALSE;
00089          SetStartEvent(mbspar->GetStartEvent());
00090          SetStopEvent(mbspar->GetStopEvent());
00091          SetEventInterval(mbspar->GetEventInterval());
00092          SetTagName(mbspar->GetTagName());
00093          return kTRUE;
00094       }
00095    else
00096       {
00097           return kFALSE;
00098       }
00099    return kFALSE;
00100 }
00101 
00102 ClassImp(TGo4MbsFileParameter)
00103 
00104 //----------------------------END OF GO4 SOURCE FILE ---------------------

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