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 <costas.andreopoulos \at stfc.ac.uk>
10  University of Liverpool & STFC Rutherford Appleton Lab
11 
12 \created September 27, 2005
13 
14 \cpright Copyright (c) 2003-2019, The GENIE Collaboration
15  For the full text of the license visit http://copyright.genie-mc.org
16  or see $GENIE/LICENSE
17 */
18 //____________________________________________________________________________
19 
20 #ifndef _EVG_THREAD_EXCEPTION_H_
21 #define _EVG_THREAD_EXCEPTION_H_
22 
23 #include <string>
24 #include <ostream>
25 
26 #include <TMath.h>
27 
28 using std::string;
29 using std::ostream;
30 
31 namespace genie {
32 namespace exceptions {
33 
34 class Interaction;
35 
37 
38 public :
39 
43 
44  void SetReason (string reason) { fReason = reason; }
45  void SwitchOnFastForward (void) { fFastFwd = true; }
46  void SwitchOnStepBack (void) { fStepBack = true; }
47  void SetReturnStep (int s) { fReturnStep = TMath::Max(0,s); }
48 
49  string ShowReason (void) const { return fReason; }
50  bool FastForward (void) const { return fFastFwd; }
51  bool StepBack (void) const { return fStepBack; }
52  int ReturnStep (void) const { return fReturnStep; }
53 
54  void Init (void);
55  void Copy (const EVGThreadException & exception);
56  void Print (ostream & stream) const;
57 
58  friend ostream & operator << (
59  ostream & stream, const EVGThreadException & exception);
60 
61 private:
62 
63  bool fFastFwd;
64  bool fStepBack;
66  string fReason;
67 };
68 
69 } // exceptions namespace
70 } // genie namespace
71 
72 #endif // _EVG_THREAD_EXCEPTION_H_
THE MAIN GENIE PROJECT NAMESPACE
Definition: GeneratorBase.h:8
void Copy(const EVGThreadException &exception)
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
void Print(ostream &stream) const
const XML_Char * s
Definition: expat.h:262
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
friend ostream & operator<<(ostream &stream, const EVGThreadException &exception)
enum BeamMode string