MUDA
Loading...
Searching...
No Matches
exception.h
1#pragma once
2#include <muda/muda_def.h>
3#include <exception>
4#include <string>
5
6namespace muda
7{
8class exception : public std::exception
9{
10 std::string m_what;
11
12 public:
13 exception(const std::string& msg)
14 : m_what(msg)
15 {
16 }
17 virtual char const* what() const
18#ifdef MUDA_PLATFORM_LINUX
19 MUDA_NOEXCEPT
20#endif
21 {
22 return m_what.c_str();
23 }
24};
25
27{
28 public:
29 not_implemented(const std::string& msg)
30 : exception(msg)
31 {
32 }
33};
34
36{
37 public:
38 invalid_argument(const std::string& msg)
39 : exception(msg)
40 {
41 }
42};
43
44class out_of_range : public exception
45{
46 public:
47 out_of_range(const std::string& msg)
48 : exception(msg)
49 {
50 }
51};
52
54{
55 public:
56 runtime_error(const std::string& msg)
57 : exception(msg)
58 {
59 }
60};
61
62class logic_error : public exception
63{
64 public:
65 logic_error(const std::string& msg)
66 : exception(msg)
67 {
68 }
69};
70} // namespace muda
Definition exception.h:9
Definition exception.h:36
Definition exception.h:63
Definition exception.h:27
Definition exception.h:45
Definition exception.h:54