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

TGo4RestartException.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 "TGo4RestartException.h"
00017 
00018 #include "TThread.h"
00019 
00020 #include "TGo4Log.h"
00021 #include "TGo4Thread.h"
00022 #include "TGo4ThreadHandler.h"
00023 #include "TGo4Runnable.h"
00024 
00025 TGo4RestartException::TGo4RestartException(const TGo4RestartException &right)
00026   :TGo4ThreadException(right)
00027 {
00028    TRACE((14,"TGo4RestartException::TGo4RestartException() copy constructor",__LINE__, __FILE__));
00029 }
00030 
00031 TGo4RestartException::TGo4RestartException (TGo4Runnable* runnable, const Text_t* threadname)
00032 : TGo4ThreadException(runnable,threadname)
00033 {
00034    TRACE((14,"TGo4RestartException::TGo4RestartException(TGo4Runnable*, const Text_t*) constructor",__LINE__, __FILE__));
00035    fxDescription= "!!!-- Go4 Restart Exception --!!!";
00036 }
00037 
00038 
00039 TGo4RestartException::~TGo4RestartException()
00040 {
00041   TRACE((14,"TGo4RestartException::~TGo4RestartException() destructor",__LINE__, __FILE__));
00042 }
00043 
00044 
00045 TGo4RestartException & TGo4RestartException::operator=(const TGo4RestartException &right)
00046 {
00047    TRACE((14,"TGo4RestartException::operator=",__LINE__, __FILE__));
00048    if (&right!=this)
00049       {
00050          TRACE((13,"TGo4RestartException::operator= processing copy",__LINE__, __FILE__));
00051          TGo4ThreadException::operator=(right); // copy base class members
00052          // put additional member copies here...
00053          return *this;
00054       }
00055    else
00056       {
00057          // copy is already source object
00058          TRACE((13,"TGo4RestartException::operator= source and destination objects are identical",__LINE__, __FILE__));
00059          return *this;
00060       }
00061 }
00062 
00063 Int_t TGo4RestartException::Handle ()
00064 {
00065    TRACE((14,"TGo4RestartException::Handle()",__LINE__, __FILE__));
00066    if(GetThreadName()==0)
00067       // no threadname specified, operate on thread of runnable
00068       {
00069          TRACE((13,"TGo4RestartException::Handle() -- recreating thread of runnable",__LINE__, __FILE__));
00070          fxRunnable->GetThread()->ReCreate();
00071       }
00072    else
00073       // threadname given, use thread handler to cancel
00074       {
00075          TRACE((13,"TGo4RestartException::Handle() -- recreating thread by name",__LINE__, __FILE__));
00076          fxThreadHandler->ReCreate(GetThreadName());
00077       }
00078    TThread::CancelPoint(); // if thread restarts itself, this is necessary for proper cancellation:
00079    return 0;
00080 }
00081 
00082 //----------------------------END OF GO4 SOURCE FILE ---------------------

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