GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ThreadException.cxx
Go to the documentation of this file.
1 // $Id: TGo4ThreadException.cxx 999 2013-07-25 11:58:59Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "TGo4ThreadException.h"
15 
16 #include "TGo4Log.h"
17 #include "TGo4ThreadManager.h"
18 #include "TGo4ThreadHandler.h"
19 #include "TGo4Runnable.h"
20 
23 {
24  GO4TRACE((14,"TGo4ThreadException::TGo4ThreadException() copy constructor",__LINE__, __FILE__));
27  fxRunnable=right.fxRunnable;
28 }
29 
30 TGo4ThreadException::TGo4ThreadException (TGo4Runnable* runnable, const char* threadname)
31 {
32  GO4TRACE((14,"TGo4ThreadException::TGo4ThreadException(TGo4Runnable*, const char*) constructor",__LINE__, __FILE__));
33  fxRunnable=runnable;
36  if(threadname==0)
37  // default: use thread belonging to runnable
38  {
39  GO4TRACE((13,"TGo4ThreadException constructor -- no threadname specified",__LINE__, __FILE__));
40 
41  fxThreadName="0"; // class member is TString...
42  }
43  else
44  {
45  // access to thread by name
46  GO4TRACE((13,"TGo4ThreadException constructor -- using given threadname",__LINE__, __FILE__));
47  fxThreadName=threadname;
48  }
49 }
50 
51 
53 {
54  GO4TRACE((14,"TGo4ThreadException::~TGo4ThreadException() destructor",__LINE__, __FILE__));
55 }
56 
57 
59 {
60  GO4TRACE((14,"TGo4ThreadException::operator=",__LINE__, __FILE__));
61  if (&right!=this)
62  {
63  GO4TRACE((13,"TGo4ThreadException::operator= processing copy",__LINE__, __FILE__));
64  TGo4ControlException::operator=(right); // copy base class members
65  // put additional member copies here...
68  fxRunnable=right.fxRunnable;
69  return *this;
70  }
71  else
72  {
73  // copy is already source object
74  GO4TRACE((13,"TGo4ThreadException::operator= source and destination objects are identical",__LINE__, __FILE__));
75  return *this;
76  }
77 }
78 
80 {
81  GO4TRACE((14,"TGo4ThreadException::GetThreadName ()",__LINE__, __FILE__));
82  if(fxThreadName=="0")
83  // no, TString was set to zero character:
84  {
85  GO4TRACE((14,"TGo4ThreadException::GetThreadName () -- name not specified",__LINE__, __FILE__));
86  return 0;
87  }
88  else
89  // yes, TString contains given thread name
90  {
91  GO4TRACE((14,"TGo4ThreadException::GetThreadName () -- found thread name",__LINE__, __FILE__));
92  return fxThreadName.Data();
93  }
94 }
95 
96 
97 
98 
99 
TGo4ThreadException & operator=(const TGo4ThreadException &right)
const char * GetThreadName()
TGo4Runnable * fxRunnable
TGo4ThreadManager * GetThreadManager() const
Definition: TGo4Runnable.h:47
TGo4ThreadHandler * GetWorkHandler() const
#define GO4TRACE(X)
Definition: TGo4Log.h:26
TGo4ThreadHandler * fxThreadHandler
TGo4ControlException & operator=(const TGo4ControlException &right)