Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berrySafeRunnable.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 
18 #ifndef BERRYSAFERUNNABLE_H_
19 #define BERRYSAFERUNNABLE_H_
20 
21 #include <berryISafeRunnable.h>
23 
24 namespace berry {
25 
34 
35 private:
36 
37  static bool ignoreErrors;
38 
39  static ISafeRunnableRunner::Pointer runner;
40 
41  QString message;
42 
48  static ISafeRunnableRunner::Pointer CreateDefaultRunner();
49 
50 public:
51 
52  using ISafeRunnable::Run;
53 
60  SafeRunnable(const QString& message = "");
61 
62  /*
63  * @see ISafeRunnable#HandleException(const ctkException&)
64  */
65  void HandleException(const ctkException& e) override;
66 
73  static bool GetIgnoreErrors();
74 
81  static void SetIgnoreErrors(bool flag);
82 
89  static ISafeRunnableRunner::Pointer GetRunner();
90 
98  static void SetRunner(ISafeRunnableRunner::Pointer runner);
99 
108  static void Run(ISafeRunnable::Pointer runnable);
109 
110 };
111 
112 
113 }
114 
115 #endif /* BERRYSAFERUNNABLE_H_ */
virtual void Run()=0
#define BERRY_UI_QT