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

/Go4EventServer/TGo4RevServ.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 "TGo4RevServ.h"
00017 
00018 #include "Go4Event/TGo4EventErrorException.h"
00019 #include "Go4Log/TGo4Log.h"
00020 
00021 const Int_t TGo4RevServ::fgiDEFAULTPORT=6003;
00022 
00023 TGo4RevServ::TGo4RevServ(const char* name)
00024 : TGo4MbsSource(name , GETEVT__REVSERV), fiPort(0)
00025 {
00026    TRACE((15,"TGo4RevServ::TGo4RevServ(Text_t*)",__LINE__, __FILE__));
00027    TGo4Log::Debug(" New Event Source RevServ %s:  ",name);
00028    SetTimeout(fgiTIMEOUTDEFAULT);
00029    Open();
00030 }
00031 
00032 TGo4RevServ::TGo4RevServ(TGo4RevServParameter* par)
00033 : TGo4MbsSource(par->GetName(), GETEVT__REVSERV), fiPort(0)
00034 {
00035    TRACE((15,"TGo4RevServ::TGo4RevServ(TGo4RevServParameter*)",__LINE__, __FILE__));
00036 
00037    TGo4Log::Debug(" New Event Source RevServ %s:  ",GetName());
00038    SetTimeout(par->GetTimeout());
00039    SetPort(par->GetPort());
00040    Open();
00041 }
00042 
00043 TGo4RevServ::TGo4RevServ()
00044 //: TGo4MbsSource("Default RevServ" , GETEVT__REVSERV)
00045 {
00046    TRACE((15,"TGo4RevServ::TGo4RevServ()",__LINE__, __FILE__));
00047 
00048 }
00049 
00050 TGo4RevServ::~TGo4RevServ()
00051 {
00052   TRACE((15,"TGo4RevServ::~TGo4RevServ()",__LINE__, __FILE__));
00053   Close();
00054 }
00055 
00056 Int_t TGo4RevServ::Open()
00057 {
00058 TRACE((12,"TGo4RevServFile::Open()",__LINE__, __FILE__));
00059 //
00060 if(fbIsOpen)
00061    return -1;
00062 if(fiPort==0)
00063    fiPort=TGo4RevServ::fgiDEFAULTPORT;
00064 
00065 Int_t status    = f_evt_rev_port(fiPort);
00066 SetCreateStatus(status);
00067 if(GetCreateStatus() !=GETEVT__SUCCESS)
00068    {
00069      Text_t buffer[TGo4EventSource::fguTXTLEN];
00070      f_evt_error(GetCreateStatus(),buffer,1); // provide text message for later output
00071       SetErrMess(buffer);
00072       fbIsOpen=kFALSE;
00073       throw TGo4EventErrorException(this);
00074    }
00075 else {}
00076 return (TGo4MbsSource::Open());
00077 }
00078 
00079 ClassImp(TGo4RevServ)
00080 
00081 //----------------------------END OF GO4 SOURCE FILE ---------------------

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