EVGThreadException.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::exceptions::EVGThreadException
5 
6 \brief An exception thrown by EventRecordVisitorI when the normal processing
7  sequence has to be disrupted (fast-fwd at the end or step-back)
8 
9 \author Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
10  University of Liverpool & STFC Rutherford Appleton Laboratory
11 
12 \created September 27, 2005
13 
14 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
15  For the full text of the license visit http://copyright.genie-mc.org
16 */
17 //____________________________________________________________________________
18 
19 #ifndef _EVG_THREAD_EXCEPTION_H_
20 #define _EVG_THREAD_EXCEPTION_H_
21 
22 #include <string>
23 #include <ostream>
24 
25 #include <TMath.h>
26 
27 using std::string;
28 using std::ostream;
29 
30 namespace genie {
31 namespace exceptions {
32 
33 class Interaction;
34 
36 
37 public :
38 
42 
43  void SetReason (string reason) { fReason = reason; }
44  void SwitchOnFastForward (void) { fFastFwd = true; }
45  void SwitchOnStepBack (void) { fStepBack = true; }
46  void SetReturnStep (int s) { fReturnStep = TMath::Max(0,s); }
47 
48  string ShowReason (void) const { return fReason; }
49  bool FastForward (void) const { return fFastFwd; }
50  bool StepBack (void) const { return fStepBack; }
51  int ReturnStep (void) const { return fReturnStep; }
52 
53  void Init (void);
54  void Copy (const EVGThreadException & exception);
55  void Print (ostream & stream) const;
56 
57  friend ostream & operator << (
58  ostream & stream, const EVGThreadException & exception);
59 
60 private:
61 
62  bool fFastFwd;
63  bool fStepBack;
65  string fReason;
66 };
67 
68 } // exceptions namespace
69 } // genie namespace
70 
71 #endif // _EVG_THREAD_EXCEPTION_H_
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
std::string string
Definition: nybbler.cc:12
void Copy(const EVGThreadException &exception)
void Print(ostream &stream) const
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
friend ostream & operator<<(ostream &stream, const EVGThreadException &exception)
static QCString * s
Definition: config.cpp:1042
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33