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
30 class OPENMS_DLLAPI GlobalExceptionHandler
31 {
32private:
36
54 throw();
55
57
60
62public:
63
66
70
73 static void setName(const std::string & name)
74 throw();
75
78 static void setMessage(const std::string & message)
79 throw();
80
83 static void setLine(int line)
84 throw();
85
88 static void setFile(const std::string & file)
89 throw();
90
93 static void setFunction(const std::string & function)
94 throw();
95
98 static void set(const std::string & file, int line, const std::string & function,
99 const std::string & name, const std::string & message)
100 throw();
102protected:
103
105 static void terminate()
106 throw();
107
109 static void newHandler();
110
119
121 static std::string & file_();
122
124 static int & line_();
125
127 static std::string & function_();
128
130 static std::string & name_();
131
133 static std::string & what_();
134
136 };
137
138 } // namespace Exception
139
140} // namespace OpenMS
141
OpenMS global exception handler.
Definition GlobalExceptionHandler.h:31
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:61
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.