GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4StartException.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 "TGo4StartException.h"
15 
16 #include "TGo4Log.h"
17 #include "TGo4Thread.h"
18 #include "TGo4ThreadHandler.h"
19 #include "TGo4Runnable.h"
20 
22  :TGo4ThreadException(right)
23 {
24  GO4TRACE((14,"TGo4StartException::TGo4StartException() copy constructor",__LINE__, __FILE__));
25 }
26 
27 TGo4StartException::TGo4StartException (TGo4Runnable *runnable, const char *threadname)
28 : TGo4ThreadException(runnable,threadname)
29 {
30  GO4TRACE((14,"TGo4StartException::TGo4StartException(TGo4Runnable *, const char*) constructor",__LINE__, __FILE__));
31  fxDescription = "!!!-- Go4 Start Exception --!!!";
32 }
33 
34 
36 {
37  GO4TRACE((14,"TGo4StartException::~TGo4StartException() destructor",__LINE__, __FILE__));
38 }
39 
40 
42 {
43  GO4TRACE((14, "TGo4StartException::operator=", __LINE__, __FILE__));
44  if (&right != this)
45  TGo4ThreadException::operator=(right); // copy base class members
46  return *this;
47 }
48 
50 {
51  GO4TRACE((14, "TGo4StartException::Handle()", __LINE__, __FILE__));
52  Int_t rev = -1;
53  if (!GetThreadName()) {
54  // no threadname specified, operate on thread of runnable
55  GO4TRACE((13, "TGo4StartException::Handle() -- starting thread of runnable", __LINE__, __FILE__));
56  rev = fxRunnable->GetThread()->Start();
57  } else {
58  // threadname given, use thread handler to cancel
59  GO4TRACE((13, "TGo4StartException::Handle() -- starting thread by name", __LINE__, __FILE__));
61  }
62  // note: return values of Start() are boolean, are casted implicitly
63  return rev;
64 }
TGo4Thread * GetThread() const
Definition: TGo4Runnable.h:44
TGo4ThreadException & operator=(const TGo4ThreadException &right)
TGo4Runnable * fxRunnable
TGo4StartException & operator=(const TGo4StartException &right)
Int_t Handle() override
Bool_t Start(const char *thname)
const char * GetThreadName() const
#define GO4TRACE(X)
Definition: TGo4Log.h:25
TGo4StartException()=delete
TGo4ThreadHandler * fxThreadHandler
Bool_t Start()
Definition: TGo4Thread.cxx:269
TString fxDescription
Definition: TGo4Exception.h:38