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

TGo4Runnable.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 "TGo4Runnable.h"
00017 
00018 #include "TThread.h"
00019 
00020 #include "TGo4Log.h"
00021 #include "TGo4Thread.h"
00022 #include "TGo4ThreadManager.h"
00023 
00024 TGo4Runnable::TGo4Runnable() :
00025    TNamed(),
00026    fxManager(0),
00027    fxGo4Thread(0)
00028 {
00029 }
00030 
00031 TGo4Runnable::TGo4Runnable(const TGo4Runnable &right) :
00032    TNamed(right),
00033    fxManager(right.fxManager),
00034    fxGo4Thread(right.fxGo4Thread)
00035 {
00036    TRACE((14,"TGo4Runnable::TGo4Runnable() copy constructor",__LINE__, __FILE__));
00037 }
00038 
00039 TGo4Runnable::TGo4Runnable (const char* name, TGo4ThreadManager* man) :
00040    TNamed(name,"This is a TGo4Runnable"), fxGo4Thread(0)
00041 {
00042    TRACE((14,"TGo4Runnable::TGo4Runnable(Text_t*,TGo4ThreadManager*) constructor",__LINE__, __FILE__));
00043    fxManager=man;
00044 }
00045 
00046 TGo4Runnable::~TGo4Runnable()
00047 {
00048    TRACE((14,"TGo4Runnable::~TGo4Runnable() destructor",__LINE__, __FILE__));
00049 }
00050 
00051 void TGo4Runnable::ThreadCatch (TGo4Exception& ex)
00052 {
00053    TRACE((12,"TGo4Runnable::ThreadCatch()",__LINE__, __FILE__));
00054 
00055    TGo4Log::Debug("\n %s occured in Runnable``%s''(Thread``%s''PID:%d) \n",
00056       ex.What(),GetName(),fxGo4Thread->GetName(),fxGo4Thread->GetPID());
00057    ex.Handle(); // execute Exception own handler method
00058 }
00059 
00060 void TGo4Runnable::UnexpectedCatch ()
00061 {
00062    TRACE((12,"TGo4Runnable::UnexpectedCatch()",__LINE__, __FILE__));
00063 
00064    TGo4Log::Debug("!!!-- Unexpected Exception --!!! occured in Runnable``%s''(Thread``%s''PID:%d) ",
00065       GetName(),fxGo4Thread->GetName(),fxGo4Thread->GetPID());
00066    fxManager->Terminate();
00067    TThread::CancelPoint();
00068    //gApplication->Terminate(0);
00069 }
00070 
00071 Int_t TGo4Runnable::PreRun (void* arg)
00072 {
00073    TRACE((12,"TGo4Runnable::PreRun()",__LINE__, __FILE__));
00074 
00075    TGo4Log::Debug("Executing Runnable default PreRun Method \n");
00076    return 0;
00077 }
00078 
00079 Int_t TGo4Runnable::PostRun (void* arg)
00080 {
00081    TRACE((12,"TGo4Runnable::PostRun()",__LINE__, __FILE__));
00082 
00083    TGo4Log::Debug("Executing Runnable default PostRun Method \n");
00084    return 0;
00085 }
00086 
00087 //----------------------------END OF GO4 SOURCE FILE ---------------------

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