Jack2 1.9.12

JackException.h
1 /*
2 Copyright (C) 2008 Grame
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef __JackException__
21 #define __JackException__
22
23 #include "JackCompilerDeps.h"
24
25 #include <stdexcept>
26 #include <iostream>
27 #include <string>
28
29 namespace Jack
30 {
31
32 #define ThrowIf(inCondition, inException) \
33 if(inCondition) \
34 { \
35 throw(inException); \
36 }
37
38
43 class SERVER_EXPORT JackException : public std::runtime_error {
44
45 public:
46
47 JackException(const std::string& msg) : std::runtime_error(msg)
48 {}
49 JackException(char* msg) : std::runtime_error(msg)
50 {}
51 JackException(const char* msg) : std::runtime_error(msg)
52 {}
53
54 std::string Message()
55 {
56 return what();
57 }
58
59 void PrintMessage();
60
61 };
62
67 class SERVER_EXPORT JackTemporaryException : public JackException {
68
69 public:
70
71 JackTemporaryException(const std::string& msg) : JackException(msg)
72 {}
73 JackTemporaryException(char* msg) : JackException(msg)
74 {}
75 JackTemporaryException(const char* msg) : JackException(msg)
76 {}
77 JackTemporaryException() : JackException("")
78 {}
79 };
80
85 class SERVER_EXPORT JackQuitException : public JackException {
86
87 public:
88
89 JackQuitException(const std::string& msg) : JackException(msg)
90 {}
91 JackQuitException(char* msg) : JackException(msg)
92 {}
93 JackQuitException(const char* msg) : JackException(msg)
94 {}
95 JackQuitException() : JackException("")
96 {}
97 };
98
103 class SERVER_EXPORT JackNetException : public JackException {
104
105 public:
106
107 JackNetException(const std::string& msg) : JackException(msg)
108 {}
109 JackNetException(char* msg) : JackException(msg)
110 {}
111 JackNetException(const char* msg) : JackException(msg)
112 {}
113 JackNetException() : JackException("")
114 {}
115 };
116
117 }
118
119 #endif
Jack::JackTemporaryException
Exception thrown by JackEngine in temporary mode.
Definition: JackException.h:67
Jack::JackQuitException
Definition: JackException.h:85
Jack::JackException
Exception base class.
Definition: JackException.h:43
Jack::JackNetException
Exception possibly thrown by Net slaves.
Definition: JackException.h:103