Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "TGo4ThreadException.h"
00015
00016 #include "TGo4Log.h"
00017 #include "TGo4ThreadManager.h"
00018 #include "TGo4ThreadHandler.h"
00019 #include "TGo4Runnable.h"
00020
00021 TGo4ThreadException::TGo4ThreadException(const TGo4ThreadException &right)
00022 :TGo4ControlException(right)
00023 {
00024 GO4TRACE((14,"TGo4ThreadException::TGo4ThreadException() copy constructor",__LINE__, __FILE__));
00025 fxThreadName=right.fxThreadName;
00026 fxThreadHandler=right.fxThreadHandler;
00027 fxRunnable=right.fxRunnable;
00028 }
00029
00030 TGo4ThreadException::TGo4ThreadException (TGo4Runnable* runnable, const char* threadname)
00031 {
00032 GO4TRACE((14,"TGo4ThreadException::TGo4ThreadException(TGo4Runnable*, const char*) constructor",__LINE__, __FILE__));
00033 fxRunnable=runnable;
00034 TGo4ThreadManager* man =fxRunnable->GetThreadManager();
00035 fxThreadHandler=man->GetWorkHandler();
00036 if(threadname==0)
00037
00038 {
00039 GO4TRACE((13,"TGo4ThreadException constructor -- no threadname specified",__LINE__, __FILE__));
00040
00041 fxThreadName="0";
00042 }
00043 else
00044 {
00045
00046 GO4TRACE((13,"TGo4ThreadException constructor -- using given threadname",__LINE__, __FILE__));
00047 fxThreadName=threadname;
00048 }
00049 }
00050
00051
00052 TGo4ThreadException::~TGo4ThreadException()
00053 {
00054 GO4TRACE((14,"TGo4ThreadException::~TGo4ThreadException() destructor",__LINE__, __FILE__));
00055 }
00056
00057
00058 TGo4ThreadException & TGo4ThreadException::operator=(const TGo4ThreadException &right)
00059 {
00060 GO4TRACE((14,"TGo4ThreadException::operator=",__LINE__, __FILE__));
00061 if (&right!=this)
00062 {
00063 GO4TRACE((13,"TGo4ThreadException::operator= processing copy",__LINE__, __FILE__));
00064 TGo4ControlException::operator=(right);
00065
00066 fxThreadName=right.fxThreadName;
00067 fxThreadHandler=right.fxThreadHandler;
00068 fxRunnable=right.fxRunnable;
00069 return *this;
00070 }
00071 else
00072 {
00073
00074 GO4TRACE((13,"TGo4ThreadException::operator= source and destination objects are identical",__LINE__, __FILE__));
00075 return *this;
00076 }
00077 }
00078
00079 const char* TGo4ThreadException::GetThreadName ()
00080 {
00081 GO4TRACE((14,"TGo4ThreadException::GetThreadName ()",__LINE__, __FILE__));
00082 if(fxThreadName=="0")
00083
00084 {
00085 GO4TRACE((14,"TGo4ThreadException::GetThreadName () -- name not specified",__LINE__, __FILE__));
00086 return 0;
00087 }
00088 else
00089
00090 {
00091 GO4TRACE((14,"TGo4ThreadException::GetThreadName () -- found thread name",__LINE__, __FILE__));
00092 return fxThreadName.Data();
00093 }
00094 }
00095
00096
00097
00098
00099