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

TGo4EventSource.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 "TGo4EventSource.h"
00017 
00018 #include "Riostream.h"
00019 #include "snprintf.h"
00020 
00021 #include "TGo4EventErrorException.h"
00022 #include "TGo4Log.h"
00023 
00024 const Int_t TGo4EventSource::fgiTIMEOUTDEFAULT=1; // source timeout default in seconds
00025 
00026 TGo4EventSource::TGo4EventSource(const char* name)
00027 :TNamed(name, "This is a Go4 Event Source"),
00028 fiCreateStatus(0), fiEventStatus(0)
00029 {
00030 TRACE((15,"TGo4EventSource::TGo4EventSource()",__LINE__, __FILE__));
00031 }
00032 
00033 TGo4EventSource::TGo4EventSource()
00034 :TNamed("default eventsource","This is a Go4 EventSource"),
00035 fiCreateStatus(0), fiEventStatus(0)
00036 {
00037 }
00038 
00039 TGo4EventSource::~TGo4EventSource()
00040 {
00041 TRACE((15,"TGo4EventSource::~TGo4EventSource()",__LINE__, __FILE__));
00042 
00043 }
00044 
00045 void TGo4EventSource::ThrowError(Int_t crestat, Int_t errstat, const char* message,...)
00046    {
00047       //
00048       UInt_t lbuflen = TGo4EventSource::fguTXTLEN;
00049       Text_t* txtbuf = new Text_t[lbuflen];
00050       va_list args;
00051       va_start(args, message);
00052       vsnprintf(txtbuf, lbuflen, message, args);
00053       va_end(args);
00054       if(crestat!=0)
00055          SetCreateStatus(crestat);
00056       if(errstat!=0)
00057          SetEventStatus(errstat);
00058       SetErrMess(txtbuf);
00059       delete[] txtbuf;
00060       throw TGo4EventErrorException(this);
00061    }
00062 
00063 void TGo4EventSource::Clear(Option_t* opt)
00064 {
00065  // dummy clear, may be implemented by user
00066  cout <<"default clear of eventsource "<<GetName() << endl;
00067 }
00068 const char* TGo4EventSource::GetActiveName()
00069 {
00070    return GetName();
00071 }
00072 
00073 //----------------------------END OF GO4 SOURCE FILE ---------------------

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