GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4ThreadException.cxx
Go to the documentation of this file.
1// $Id$
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(const TGo4ThreadException &)",__LINE__, __FILE__));
27}
28
30{
31 GO4TRACE((14,"TGo4ThreadException::TGo4ThreadException(TGo4Runnable *, const char *)",__LINE__, __FILE__));
32 fxRunnable = runnable;
33 TGo4ThreadManager *man = fxRunnable->GetThreadManager();
35 if (!threadname) {
36 // default: use thread belonging to runnable
37 GO4TRACE((13, "TGo4ThreadException constructor -- no threadname specified", __LINE__, __FILE__));
38 fxThreadName = "0"; // class member is TString...
39 } else {
40 // access to thread by name
41 GO4TRACE((13, "TGo4ThreadException constructor -- using given threadname", __LINE__, __FILE__));
42 fxThreadName = threadname;
43 }
44}
45
47{
48 GO4TRACE((14,"TGo4ThreadException::~TGo4ThreadException()",__LINE__, __FILE__));
49}
50
51
53{
54 GO4TRACE((14, "TGo4ThreadException::operator=", __LINE__, __FILE__));
55 if (&right != this) {
56 TGo4ControlException::operator=(right); // copy base class members
59 fxRunnable = right.fxRunnable;
60 }
61 return *this;
62}
63
65{
66 GO4TRACE((14,"TGo4ThreadException::GetThreadName()",__LINE__, __FILE__));
67 if (fxThreadName == "0") {
68 // no, TString was set to zero character:
69 GO4TRACE((14, "TGo4ThreadException::GetThreadName() -- name not specified", __LINE__, __FILE__));
70 return nullptr;
71 } else {
72 // yes, TString contains given thread name
73 GO4TRACE((14, "TGo4ThreadException::GetThreadName() -- found thread name", __LINE__, __FILE__));
74 return fxThreadName.Data();
75 }
76}
#define GO4TRACE(X)
Definition TGo4Log.h:25
TGo4ControlException & operator=(const TGo4ControlException &right)
Base class for all go4 runnables.
TGo4ThreadException()=delete
TGo4Runnable * fxRunnable
Link to the runnable connected with the thread (exception throwing runnable might simply pass its 'th...
TString fxThreadName
Name of the TGo4Thread that shall be acted on.
const char * GetThreadName() const
TGo4ThreadException & operator=(const TGo4ThreadException &right)
TGo4ThreadHandler * fxThreadHandler
Link to threadhandler associated with the runnable.
Go4 thread manager.
TGo4ThreadHandler * GetWorkHandler() const
Access to ThreadHandler for working threads.