Differential D18758 Diff 58398 kdevplatform/3rdparty/qtpromise/qtpromise-0.5.0/src/qtpromise/qpromiseexceptions.h
Changeset View
Changeset View
Standalone View
Standalone View
kdevplatform/3rdparty/qtpromise/qtpromise-0.5.0/src/qtpromise/qpromiseexceptions.h
- This file was added.
1 | #ifndef QTPROMISE_QPROMISEEXCEPTIONS_H | ||||
---|---|---|---|---|---|
2 | #define QTPROMISE_QPROMISEEXCEPTIONS_H | ||||
3 | | ||||
4 | #include "qpromise_p.h" | ||||
5 | #include "qpromiseglobal.h" | ||||
6 | | ||||
7 | // Qt | ||||
8 | #include <QException> | ||||
9 | | ||||
10 | namespace QtPromise { | ||||
11 | | ||||
12 | class QPromiseCanceledException : public QException | ||||
13 | { | ||||
14 | public: | ||||
15 | void raise() const Q_DECL_OVERRIDE { throw *this; } | ||||
16 | QPromiseCanceledException* clone() const Q_DECL_OVERRIDE | ||||
17 | { | ||||
18 | return new QPromiseCanceledException(*this); | ||||
19 | } | ||||
20 | }; | ||||
21 | | ||||
22 | class QPromiseContextException : public QException | ||||
23 | { | ||||
24 | public: | ||||
25 | void raise() const Q_DECL_OVERRIDE { throw *this; } | ||||
26 | QPromiseContextException* clone() const Q_DECL_OVERRIDE | ||||
27 | { | ||||
28 | return new QPromiseContextException(*this); | ||||
29 | } | ||||
30 | }; | ||||
31 | | ||||
32 | class QPromiseTimeoutException : public QException | ||||
33 | { | ||||
34 | public: | ||||
35 | void raise() const Q_DECL_OVERRIDE { throw *this; } | ||||
36 | QPromiseTimeoutException* clone() const Q_DECL_OVERRIDE | ||||
37 | { | ||||
38 | return new QPromiseTimeoutException(*this); | ||||
39 | } | ||||
40 | }; | ||||
41 | | ||||
42 | class QPromiseUndefinedException : public QException | ||||
43 | { | ||||
44 | public: | ||||
45 | void raise() const Q_DECL_OVERRIDE { throw *this; } | ||||
46 | QPromiseUndefinedException* clone() const Q_DECL_OVERRIDE | ||||
47 | { | ||||
48 | return new QPromiseUndefinedException(*this); | ||||
49 | } | ||||
50 | }; | ||||
51 | | ||||
52 | // QPromiseError is provided for backward compatibility and will be | ||||
53 | // removed in the next major version: it wasn't intended to be used | ||||
54 | // directly and thus should not be part of the public API. | ||||
55 | // TODO Remove QPromiseError at version 1.0 | ||||
56 | using QPromiseError = QtPromisePrivate::PromiseError; | ||||
57 | | ||||
58 | } // namespace QtPromise | ||||
59 | | ||||
60 | #endif // QTPROMISE_QPROMISEEXCEPTIONS_H |