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

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

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