OpenMS
Loading...
Searching...
No Matches
GlobalExceptionHandler.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Timo Sachsenberg$
6// $Authors: Stephan Aiche, Marc Sturm $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
13#include <string>
14
15namespace OpenMS
16{
17
18 namespace Exception
19 {
20
26 class OPENMS_DLLAPI GlobalExceptionHandler
27 {
28private:
32
50 throw();
51
53
56
58public:
59
62
66
69 static void setName(const std::string & name)
70 throw();
71
74 static void setMessage(const std::string & message)
75 throw();
76
79 static void setLine(int line)
80 throw();
81
84 static void setFile(const std::string & file)
85 throw();
86
89 static void setFunction(const std::string & function)
90 throw();
91
94 static void set(const std::string & file, int line, const std::string & function,
95 const std::string & name, const std::string & message)
96 throw();
98protected:
99
101 static void terminate()
102 throw();
103
105 static void newHandler();
106
115
117 static std::string & file_();
118
120 static int & line_();
121
123 static std::string & function_();
124
126 static std::string & name_();
127
129 static std::string & what_();
130
132 };
133
134 } // namespace Exception
135
136} // namespace OpenMS
137
OpenMS global exception handler.
Definition GlobalExceptionHandler.h:27
static void setFunction(const std::string &function)
static void setName(const std::string &name)
static void terminate()
The OPENMS replacement for terminate.
GlobalExceptionHandler()
Default constructor.
static void setFile(const std::string &file)
static GlobalExceptionHandler & getInstance()
The accessor for the singleton. It also serves as a replacement for the constructor.
~GlobalExceptionHandler()
Definition GlobalExceptionHandler.h:57
static void set(const std::string &file, int line, const std::string &function, const std::string &name, const std::string &message)
static void setMessage(const std::string &message)
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
STL namespace.