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

/Go4ThreadManager/TGo4ThreadException.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 "TGo4ThreadException.h"
00017 
00018 #include "Go4ThreadManager/TGo4ThreadManager.h"
00019 #include "Go4ThreadManager/TGo4ThreadHandler.h"
00020 #include "Go4ThreadManager/TGo4Runnable.h"
00021 #include "Go4Log/TGo4Log.h"
00022 
00023 TGo4ThreadException::TGo4ThreadException(const TGo4ThreadException &right)
00024 :TGo4ControlException(right)
00025 {
00026    TRACE((14,"TGo4ThreadException::TGo4ThreadException() copy constructor",__LINE__, __FILE__));
00027       fxThreadName=right.fxThreadName;
00028       fxThreadHandler=right.fxThreadHandler;
00029       fxRunnable=right.fxRunnable;
00030 }
00031 
00032 TGo4ThreadException::TGo4ThreadException (TGo4Runnable* runnable, const Text_t* threadname)
00033 {
00034    TRACE((14,"TGo4ThreadException::TGo4ThreadException(TGo4Runnable*, const Text_t*) constructor",__LINE__, __FILE__));
00035    fxRunnable=runnable;
00036    TGo4ThreadManager* man =fxRunnable->GetThreadManager();
00037    fxThreadHandler=man->GetWorkHandler();
00038    if(threadname==0)
00039       // default: use thread belonging to runnable
00040       {
00041       TRACE((13,"TGo4ThreadException constructor -- no threadname specified",__LINE__, __FILE__));
00042 
00043          fxThreadName="0"; // class member is TString...
00044       }
00045    else
00046       {
00047       // access to thread by name
00048       TRACE((13,"TGo4ThreadException constructor -- using given threadname",__LINE__, __FILE__));
00049           fxThreadName=threadname;
00050       }
00051 }
00052 
00053 
00054 TGo4ThreadException::~TGo4ThreadException()
00055 {
00056   TRACE((14,"TGo4ThreadException::~TGo4ThreadException() destructor",__LINE__, __FILE__));
00057 }
00058 
00059 
00060 TGo4ThreadException & TGo4ThreadException::operator=(const TGo4ThreadException &right)
00061 {
00062      TRACE((14,"TGo4ThreadException::operator=",__LINE__, __FILE__));
00063  if (&right!=this)
00064     {
00065       TRACE((13,"TGo4ThreadException::operator= processing copy",__LINE__, __FILE__));
00066       TGo4ControlException::operator=(right); // copy base class members
00067       // put additional member copies here...
00068       fxThreadName=right.fxThreadName;
00069       fxThreadHandler=right.fxThreadHandler;
00070       fxRunnable=right.fxRunnable;
00071       return *this;
00072     }
00073   else
00074     {
00075       // copy is already source object
00076       TRACE((13,"TGo4ThreadException::operator= source and destination objects are identical",__LINE__, __FILE__));
00077       return *this;
00078     }
00079 }
00080 
00081 const Text_t* TGo4ThreadException::GetThreadName ()
00082 {
00083    TRACE((14,"TGo4ThreadException::GetThreadName ()",__LINE__, __FILE__));
00084    if(fxThreadName=="0")
00085       // no, TString was set to zero character:
00086       {
00087          TRACE((14,"TGo4ThreadException::GetThreadName () -- name not specified",__LINE__, __FILE__));
00088          return 0;
00089       }
00090    else
00091       // yes, TString contains given thread name
00092       {
00093          TRACE((14,"TGo4ThreadException::GetThreadName () -- found thread name",__LINE__, __FILE__));
00094          return fxThreadName.Data();
00095       }
00096 }
00097 
00098 
00099 
00100 
00101 
00102 
00103 //----------------------------END OF GO4 SOURCE FILE ---------------------

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