CustusX  22.04-rc5
An IGT application
ErrorHandler.hpp
Go to the documentation of this file.
1 /*
2  * ErrorHandler.hpp
3  *
4  * Created on: Jun 10, 2015
5  * Author: dahoiv
6  */
7 
8 #ifndef ERRORHANDLER_HPP_
9 #define ERRORHANDLER_HPP_
10 
11 
12 #include <string>
13 #include <stdexcept>
14 #include <vtkSmartPointer.h>
15 #include <vtkCommand.h>
16 
17 class ErrorObserver : public vtkCommand
18 {
19 public:
20  ErrorObserver();
21  static ErrorObserver *New();
22  bool GetError() const;
23  bool GetWarning() const;
24  void Clear();
25  virtual void Execute(vtkObject *vtkNotUsed(caller),
26  unsigned long event,
27  void *calldata);
28  std::string GetErrorMessage();
29  std::string GetWarningMessage();
30 
31 private:
32  bool mError;
33  bool mWarning;
34  std::string mErrorMessage;
35  std::string mWarningMessage;
36 };
37 
38 void reportError(std::string errMsg);
39 
40 
41 
42 
43 #endif /* ERRORHANDLER_HPP_ */
44 
45 
virtual void Execute(vtkObject *vtkNotUsed(caller), unsigned long event, void *calldata)
bool GetError() const
std::string GetWarningMessage()
std::string GetErrorMessage()
static ErrorObserver * New()
void reportError(std::string errMsg)
bool GetWarning() const