Belle II Software development
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
13namespace Belle2 {
34 class TheKillerModule final: public Module {
35 public:
37 enum class EMethod {
38 c_abort,
42 c_exit,
44 c_signal,
46 };
47
52
54 void initialize() override;
55
57 void event() override;
58
59 private:
61 std::string m_methodStr;
65 unsigned int m_parameter;
69 int m_event{0};
70 };
72}
73
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.