SpikeGPU  1.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
exception.h
Go to the documentation of this file.
1 
5 #ifndef SPIKE_EXCEPTION_H
6 #define SPIKE_EXCEPTION_H
7 
8 #include <stdexcept>
9 #include <string>
10 
11 namespace spike {
12 
13 class system_error : public std::runtime_error
14 {
15 public:
16  enum Reason
17  {
23  };
24 
26  const std::string& what_arg)
27  : std::runtime_error(what_arg),
28  m_reason(reason)
29  {}
30 
32  const char* what_arg)
33  : std::runtime_error(what_arg),
34  m_reason(reason)
35  {}
36 
37  virtual ~system_error() throw() {}
38 
39  Reason reason() const {return m_reason;}
40 
41 private:
42  Reason m_reason;
43 };
44 
45 } // namespace spike
46 
47 
48 #endif
system_error(Reason reason, const std::string &what_arg)
Definition: exception.h:25
Definition: exception.h:20
Definition: exception.h:13
Definition: exception.h:18
virtual ~system_error()
Definition: exception.h:37
Reason
Definition: exception.h:16
Definition: exception.h:21
system_error(Reason reason, const char *what_arg)
Definition: exception.h:31
Reason reason() const
Definition: exception.h:39
Definition: exception.h:22