Loading...
Searching...
No Matches
TrackerExceptions.h
Go to the documentation of this file.
1// Copyright PS-Tech B.V. All Rights Reserved.
2
3#ifndef TRACKER_EXCEPTIONS_H
4#define TRACKER_EXCEPTIONS_H
5
6#include "PstBase.h"
7#include <stdexcept>
8
9 namespace PSTech
10{
11#ifndef PSTEXCEPTION_DEFINED
12#define PSTEXCEPTION_DEFINED
13
23 class PST_EXPORT PSTException
24 {
25 public:
26 explicit PSTException(const char* what);
27 PSTException(const PSTException& other);
28 PSTException(PSTException&& other) noexcept;
29 PSTException(const char* function, int line, const char* what);
30 virtual ~PSTException();
31 virtual const char* what() const;
32 virtual const char* where() const;
33 virtual const char* full_description() const;
34
35 private:
36 char* m_what;
37 char* m_where;
38 char* m_full;
39 };
40
41#endif // PSTEXCEPTION_DEFINED
42
46#define DECLARE_PST_EXCEPTION( child, parent ) \
47 class child : public parent \
48 { \
49 public: \
50 explicit child(const char* what) : parent(what) {} \
51 child(const char* function, int line, const char* what) : parent(function, line, what) {}\
52 }
53
54 DECLARE_PST_EXCEPTION(TrackerException, PSTException);
55 DECLARE_PST_EXCEPTION(InvalidDataException, TrackerException);
56 DECLARE_PST_EXCEPTION(NotFoundException, TrackerException);
57 DECLARE_PST_EXCEPTION(AlreadyExistsException, TrackerException);
58 DECLARE_PST_EXCEPTION(IOException, TrackerException);
59 DECLARE_PST_EXCEPTION(OutOfRangeException, TrackerException);
60 DECLARE_PST_EXCEPTION(NotSupportedException, TrackerException);
61 DECLARE_PST_EXCEPTION(NotInitializedException, TrackerException);
62 DECLARE_PST_EXCEPTION(HttpException, TrackerException);
63 DECLARE_PST_EXCEPTION(JSONException, TrackerException);
64}
65#endif //TRACKER_EXCEPTIONS_H
PstBase.h
PST_EXPORT
#define PST_EXPORT
Definition PstBase.h:12
DECLARE_PST_EXCEPTION
#define DECLARE_PST_EXCEPTION(child, parent)
Definition TrackerExceptions.h:46
PSTech::AlreadyExistsException::AlreadyExistsException
AlreadyExistsException(const char *what)
Definition TrackerExceptions.h:57
PSTech::HttpException::HttpException
HttpException(const char *what)
Definition TrackerExceptions.h:62
PSTech::IOException::IOException
IOException(const char *what)
Definition TrackerExceptions.h:58
PSTech::InvalidDataException::InvalidDataException
InvalidDataException(const char *what)
Definition TrackerExceptions.h:55
PSTech::JSONException::JSONException
JSONException(const char *what)
Definition TrackerExceptions.h:63
PSTech::NotFoundException::NotFoundException
NotFoundException(const char *what)
Definition TrackerExceptions.h:56
PSTech::NotInitializedException::NotInitializedException
NotInitializedException(const char *what)
Definition TrackerExceptions.h:61
PSTech::NotSupportedException::NotSupportedException
NotSupportedException(const char *what)
Definition TrackerExceptions.h:60
PSTech::OutOfRangeException::OutOfRangeException
OutOfRangeException(const char *what)
Definition TrackerExceptions.h:59
PSTech::PSTException::m_where
char * m_where
Definition TrackerExceptions.h:37
PSTech::PSTException::PSTException
PSTException(PSTException &&other) noexcept
PSTech::PSTException::m_what
char * m_what
Definition TrackerExceptions.h:36
PSTech::PSTException::PSTException
PSTException(const PSTException &other)
PSTech::PSTException::m_full
char * m_full
Definition TrackerExceptions.h:38
PSTech::PSTException::PSTException
PSTException(const char *what)
PSTech::PSTException::PSTException
PSTException(const char *function, int line, const char *what)
PSTech::PSTException::what
virtual const char * what() const
PSTech::PSTException::~PSTException
virtual ~PSTException()
PSTech::PSTException::where
virtual const char * where() const
PSTech::PSTException::full_description
virtual const char * full_description() const
PSTech::TrackerException::TrackerException
TrackerException(const char *what)
Definition TrackerExceptions.h:54
PSTech
Definition ExportedTypeConversions.h:9