00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
00040 {
00041 TRACE((13,"TGo4ThreadException constructor -- no threadname specified",__LINE__, __FILE__));
00042
00043 fxThreadName="0";
00044 }
00045 else
00046 {
00047
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);
00067
00068 fxThreadName=right.fxThreadName;
00069 fxThreadHandler=right.fxThreadHandler;
00070 fxRunnable=right.fxRunnable;
00071 return *this;
00072 }
00073 else
00074 {
00075
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
00086 {
00087 TRACE((14,"TGo4ThreadException::GetThreadName () -- name not specified",__LINE__, __FILE__));
00088 return 0;
00089 }
00090 else
00091
00092 {
00093 TRACE((14,"TGo4ThreadException::GetThreadName () -- found thread name",__LINE__, __FILE__));
00094 return fxThreadName.Data();
00095 }
00096 }
00097
00098
00099
00100
00101
00102
00103