Belle II Software  release-05-02-19
TheKillerModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Ritter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <framework/core/Module.h>
14 
15 namespace Belle2 {
39  class TheKillerModule final: public Module {
40  public:
42  enum class EMethod {
43  c_abort,
44  c_buserror,
45  c_terminate,
46  c_quick_exit,
48  c_exception,
49  c_signal,
51  };
52 
57 
59  void initialize() override;
60 
62  void event() override;
63 
64  private:
66  std::string m_methodStr;
70  unsigned int m_parameter;
72  int m_eventToKill;
74  int m_event{0};
75  };
77 }
78 
Belle2::TheKillerModule::m_method
EMethod m_method
How to kill the event after parsing the string parameter.
Definition: TheKillerModule.h:76
Belle2::TheKillerModule::m_methodStr
std::string m_methodStr
How to kill the event, one of (abort, terminate, quick_exit, exit, exception, signal,...
Definition: TheKillerModule.h:74
Belle2::TheKillerModule::m_event
int m_event
Current event.
Definition: TheKillerModule.h:82
Belle2::TheKillerModule::EMethod::c_exit
@ c_exit
call std::exit
Belle2::TheKillerModule::EMethod
EMethod
All the defined methods to kill us ...
Definition: TheKillerModule.h:50
Belle2::TheKillerModule::EMethod::c_exception
@ c_exception
raise std::runtime_error
Belle2::TheKillerModule::EMethod::c_terminate
@ c_terminate
call std::terminate
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TheKillerModule::TheKillerModule
TheKillerModule()
Constructor: Sets the description, the properties and the parameters of the module.
Definition: TheKillerModule.cc:26
Belle2::TheKillerModule::event
void event() override
kill if necessary
Belle2::TheKillerModule::m_parameter
unsigned int m_parameter
Optional parameter for the kill method: for quick_exit and exit it is the return code,...
Definition: TheKillerModule.h:78
Belle2::TheKillerModule::EMethod::c_quick_exit
@ c_quick_exit
call std::quick_exit
Belle2::TheKillerModule::m_eventToKill
int m_eventToKill
In which event to kill the processing.
Definition: TheKillerModule.h:80
Belle2::TheKillerModule::EMethod::c_signal
@ c_signal
raise signal(N)
Belle2::TheKillerModule::EMethod::c_buserror
@ c_buserror
produce bus error
Belle2::TheKillerModule::initialize
void initialize() override
parse the method parameter
Belle2::TheKillerModule::EMethod::c_segfault
@ c_segfault
produce segfault
Belle2::TheKillerModule::EMethod::c_abort
@ c_abort
call std::abort