Skip to content

Commit 6823aa0

Browse files
committed
add the ability to add an exception handler in the raise function
1 parent 65e4e0a commit 6823aa0

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/Raise.cxx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*!
2+
* \file src/Raise.cxx
3+
* \brief
4+
* \author Thomas Helfer
5+
* \date 02/04/2021
6+
*/
7+
8+
#include "MGIS/Raise.hxx"
9+
10+
namespace mgis {
11+
12+
static ExceptionHandler& getInternalExceptionHandler() {
13+
static ExceptionHandler h = nullptr;
14+
return h;
15+
} // end of getInternalExceptionHandlerPointer
16+
17+
void setExceptionHandler(ExceptionHandler h) {
18+
getInternalExceptionHandler() = h;
19+
} // end of setExceptionHandler
20+
21+
ExceptionHandler getExceptionHandler() {
22+
return getInternalExceptionHandler();
23+
} // end of getExceptionHandler
24+
25+
} // end of namespace mgis

0 commit comments

Comments
 (0)