Belle II Software  release-08-01-10
TheKillerModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #pragma once
10 
11 #include <framework/core/Module.h>
12 
13 namespace Belle2 {
37  class TheKillerModule final: public Module {
38  public:
40  enum class EMethod {
41  c_abort,
42  c_buserror,
43  c_terminate,
44  c_quick_exit,
45  c_exit,
46  c_exception,
47  c_signal,
48  c_segfault,
49  };
50 
55 
57  void initialize() override;
58 
60  void event() override;
61 
62  private:
64  std::string m_methodStr;
68  unsigned int m_parameter;
72  int m_event{0};
73  };
75 }
76 
Base class for Modules.
Definition: Module.h:72
This Modules kills basf2 as horribly as possible (or selected)
EMethod m_method
How to kill the event after parsing the string parameter.
void initialize() override
parse the method parameter
void event() override
kill if necessary
std::string m_methodStr
How to kill the event, one of (abort, terminate, quick_exit, exit, exception, signal,...
int m_event
Current event.
EMethod
All the defined methods to kill us ...
@ c_exception
raise std::runtime_error
@ c_terminate
call std::terminate
@ c_quick_exit
call std::quick_exit
int m_eventToKill
In which event to kill the processing.
TheKillerModule()
Constructor: Sets the description, the properties and the parameters of the module.
unsigned int m_parameter
Optional parameter for the kill method: for quick_exit and exit it is the return code,...
Abstract base class for different kinds of events.