GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4StartException.cxx
Go to the documentation of this file.
1 // $Id: TGo4StartException.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 "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  {
46  GO4TRACE((13,"TGo4StartException::operator= processing copy",__LINE__, __FILE__));
47  TGo4ThreadException::operator=(right); // copy base class members
48  // put additional member copies here...
49  return *this;
50  }
51  else
52  {
53  // copy is already source object
54  GO4TRACE((13,"TGo4StartException::operator= source and destination objects are identical",__LINE__, __FILE__));
55  return *this;
56  }
57 }
58 
60 {
61  GO4TRACE((14,"TGo4StartException::Handle()",__LINE__, __FILE__));
62  Int_t rev=-1;
63  if(GetThreadName()==0)
64  // no threadname specified, operate on thread of runnable
65  {
66  GO4TRACE((13,"TGo4StartException::Handle() -- starting thread of runnable",__LINE__, __FILE__));
67  rev=fxRunnable->GetThread()->Start();
68  }
69  else
70  // threadname given, use thread handler to cancel
71  {
72  GO4TRACE((13,"TGo4StartException::Handle() -- starting thread by name",__LINE__, __FILE__));
74  }
75  // note: return values of Start() are boolean, are casted implicitly
76  return rev;
77 }
78 
79 
80 
81 
TGo4ThreadException & operator=(const TGo4ThreadException &right)
const char * GetThreadName()
TGo4Thread * GetThread() const
Definition: TGo4Runnable.h:45
virtual Int_t Handle()
TGo4Runnable * fxRunnable
TGo4StartException & operator=(const TGo4StartException &right)
Bool_t Start(const char *thname)
#define GO4TRACE(X)
Definition: TGo4Log.h:26
TGo4ThreadHandler * fxThreadHandler
Bool_t Start()
Definition: TGo4Thread.cxx:307
TString fxDescription
Definition: TGo4Exception.h:38