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

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

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