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

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

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