CMS 3D CMS Logo

ExceptionHandler.h
Go to the documentation of this file.
1 // ------------------------------------------------------------
2 //
3 // Author: V.Ivanchenko - 01.11.2018 - old code re-written
4 //
5 // ------------------------------------------------------------
6 //
7 // Class description:
8 //
9 // Catch Geant4 exception and throw CMS exception allowing
10 // correctly abort problematic run or notify about a problem
11 // ------------------------------------------------------------
12 
13 #ifndef SimG4Core_Application_ExceptionHandler_H
14 #define SimG4Core_Application_ExceptionHandler_H
15 
16 #include "G4VExceptionHandler.hh"
17 #include "G4ExceptionSeverity.hh"
18 
19 class ExceptionHandler : public G4VExceptionHandler
20 {
21 public:
22  explicit ExceptionHandler();
23  ~ExceptionHandler() override;
24 
25  int operator==(const ExceptionHandler & right) const { return (this == &right); }
26  int operator!=(const ExceptionHandler & right) const { return (this != &right); }
27 
28  bool Notify(const char * exceptionOrigin, const char * exceptionCode,
29  G4ExceptionSeverity severity, const char * description) override;
30 
31 private:
32  ExceptionHandler(const ExceptionHandler &) = delete;
33  ExceptionHandler& operator=(const ExceptionHandler &right) = delete;
34 };
35 
36 #endif
ExceptionHandler & operator=(const ExceptionHandler &right)=delete
~ExceptionHandler() override
bool Notify(const char *exceptionOrigin, const char *exceptionCode, G4ExceptionSeverity severity, const char *description) override
int operator==(const ExceptionHandler &right) const
int operator!=(const ExceptionHandler &right) const