ThePEG  1.8.0
StepHandler.h
1 // -*- C++ -*-
2 //
3 // StepHandler.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_StepHandler_H
10 #define ThePEG_StepHandler_H
11 // This is the declaration of the StepHandler class.
12 
13 #include "ThePEG/Config/ThePEG.h"
14 #include "ThePEG/Utilities/Exception.fh"
15 #include "ThePEG/Handlers/HandlerBase.h"
16 #include <stdexcept>
17 
18 namespace ThePEG {
19 
41 class StepHandler: public HandlerBase {
42 
43 public:
44 
50  virtual ~StepHandler();
52 
53 public:
54 
71  virtual void handle(EventHandler & eh, const tPVector & tagged,
72  const Hint & hint) = 0;
74 
81  tEHPtr eventHandler() const { return theEventHandler; }
82 
87  void eventHandler(tEHPtr);
88 
94  if ( !theNewStep ) createNewStep();
95  return theNewStep;
96  }
97 
103  if ( theNewStep ) return theNewStep;
104  return theCurrentStep;
105  }
107 
108 public:
109 
113  static void Init();
114 
115 protected:
116 
120  void createNewStep();
121 
122 private:
123 
129 
134 
140 
141 private:
142 
147 
151  StepHandler & operator=(const StepHandler &);
152 
153 };
154 
161 template <>
162 struct BaseClassTrait<StepHandler,1>: public ClassTraitsType {
164  typedef HandlerBase NthBase;
165 };
166 
171 template <>
172 struct ClassTraits<StepHandler>: public ClassTraitsBase<StepHandler> {
174  static string className() { return "ThePEG::StepHandler"; }
175 };
176 
179 }
180 
181 #endif /* ThePEG_StepHandler_H */