File: exception.h

package info (click to toggle)
threadweaver 5.116.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,312 kB
  • sloc: cpp: 7,345; python: 33; sh: 13; makefile: 5
file content (52 lines) | stat: -rw-r--r-- 956 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* -*- C++ -*-
    Base class for exceptions in ThreadWeaver.

    SPDX-FileCopyrightText: 2005-2013 Mirko Boehm <mirko@kde.org>

    SPDX-License-Identifier: LGPL-2.0-or-later
*/

#ifndef EXCEPTION_H
#define EXCEPTION_H

#include <stdexcept>

#include <QString>

#include "threadweaver_export.h"

namespace ThreadWeaver
{
class THREADWEAVER_EXPORT Exception : public std::runtime_error
{
public:
    explicit Exception(const QString &message = QString());
    ~Exception() throw() override;
    QString message() const;

private:
    QString m_message;
};

class THREADWEAVER_EXPORT JobAborted : public Exception
{
public:
    explicit JobAborted(const QString &message = QString());
};

class THREADWEAVER_EXPORT JobFailed : public Exception
{
public:
    explicit JobFailed(const QString &message = QString());
};

// test:
class AbortThread : public Exception
{
public:
    AbortThread(const QString &message = QString());
};

}

#endif // EXCEPTION_H