GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4ThreadException.cxx
Go to the documentation of this file.
1 // $Id: TGo4ThreadException.cxx 2758 2020-04-16 12:28:24Z 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 fuer 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 "TGo4Runnable.h"
19 
22 {
23  GO4TRACE((14,"TGo4ThreadException::TGo4ThreadException() copy constructor",__LINE__, __FILE__));
26  fxRunnable=right.fxRunnable;
27 }
28 
29 TGo4ThreadException::TGo4ThreadException (TGo4Runnable* runnable, const char* threadname)
30 {
31  GO4TRACE((14,"TGo4ThreadException::TGo4ThreadException(TGo4Runnable*, const char*) constructor",__LINE__, __FILE__));
32  fxRunnable=runnable;
35  if(threadname==0)
36  // default: use thread belonging to runnable
37  {
38  GO4TRACE((13,"TGo4ThreadException constructor -- no threadname specified",__LINE__, __FILE__));
39 
40  fxThreadName="0"; // class member is TString...
41  }
42  else
43  {
44  // access to thread by name
45  GO4TRACE((13,"TGo4ThreadException constructor -- using given threadname",__LINE__, __FILE__));
46  fxThreadName=threadname;
47  }
48 }
49 
50 
52 {
53  GO4TRACE((14,"TGo4ThreadException::~TGo4ThreadException() destructor",__LINE__, __FILE__));
54 }
55 
56 
58 {
59  GO4TRACE((14,"TGo4ThreadException::operator=",__LINE__, __FILE__));
60  if (&right!=this)
61  {
62  GO4TRACE((13,"TGo4ThreadException::operator= processing copy",__LINE__, __FILE__));
63  TGo4ControlException::operator=(right); // copy base class members
64  // put additional member copies here...
67  fxRunnable=right.fxRunnable;
68  return *this;
69  }
70  else
71  {
72  // copy is already source object
73  GO4TRACE((13,"TGo4ThreadException::operator= source and destination objects are identical",__LINE__, __FILE__));
74  return *this;
75  }
76 }
77 
79 {
80  GO4TRACE((14,"TGo4ThreadException::GetThreadName ()",__LINE__, __FILE__));
81  if(fxThreadName=="0")
82  // no, TString was set to zero character:
83  {
84  GO4TRACE((14,"TGo4ThreadException::GetThreadName () -- name not specified",__LINE__, __FILE__));
85  return 0;
86  }
87  else
88  // yes, TString contains given thread name
89  {
90  GO4TRACE((14,"TGo4ThreadException::GetThreadName () -- found thread name",__LINE__, __FILE__));
91  return fxThreadName.Data();
92  }
93 }
94 
95 
96 
97 
98 
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)