GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
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
23{
24 GO4TRACE((14,"TGo4StartException::TGo4StartException(const TGo4StartException &)",__LINE__, __FILE__));
25}
26
27TGo4StartException::TGo4StartException(TGo4Runnable *runnable, const char *threadname)
28: TGo4ThreadException(runnable,threadname)
29{
30 GO4TRACE((14,"TGo4StartException::TGo4StartException(TGo4Runnable *, const char *)",__LINE__, __FILE__));
31 fxDescription = "!!!-- Go4 Start Exception --!!!";
32}
33
34
36{
37 GO4TRACE((14,"TGo4StartException::~TGo4StartException()",__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__));
60 rev = fxThreadHandler->Start(GetThreadName());
61 }
62 // note: return values of Start() are boolean, are casted implicitly
63 return rev;
64}
#define GO4TRACE(X)
Definition TGo4Log.h:25
TString fxDescription
Base class for all go4 runnables.
TGo4StartException & operator=(const TGo4StartException &right)
TGo4StartException()=delete
Int_t Handle() override
This is a default handler function for the respective exception type.
TGo4ThreadException()=delete
TGo4Runnable * fxRunnable
Link to the runnable connected with the thread (exception throwing runnable might simply pass its 'th...
const char * GetThreadName() const
TGo4ThreadException & operator=(const TGo4ThreadException &right)
TGo4ThreadHandler * fxThreadHandler
Link to threadhandler associated with the runnable.