Morpheus 1.0.0
Dynamic matrix type and algorithms for sparse matrices
Loading...
Searching...
No Matches
Morpheus_Exceptions.hpp
1
24#ifndef MORPHEUS_EXCEPTIONS_HPP
25#define MORPHEUS_EXCEPTIONS_HPP
26
27#include <string>
28#include <stdexcept>
29
30namespace Morpheus {
31
32class Exception : public std::exception {
33 public:
34 Exception(const Exception& exception_) : message(exception_.message) {}
35 Exception(const std::string& message_) : message(message_) {}
36 ~Exception() throw() {}
37 const char* what() const throw() { return message.c_str(); }
38
39 protected:
40 std::string message;
41};
42
44 public:
45 template <typename MessageType>
46 NotImplementedException(const MessageType& fn_name)
47 : Exception(std::string("NotImplemented: ") + fn_name +
48 std::string(" not yet implemented.")) {}
49};
50
51class IOException : public Exception {
52 public:
53 template <typename MessageType>
54 IOException(const MessageType& msg) : Exception(std::string("IO: ") + msg) {}
55};
56
58 public:
59 template <typename MessageType>
60 RuntimeException(const MessageType& msg) : Exception(msg) {}
61};
62
64 public:
65 template <typename MessageType>
66 InvalidInputException(const MessageType& msg) : Exception(msg) {}
67};
68
70 public:
71 template <typename MessageType>
72 FormatConversionException(const MessageType& msg) : Exception(msg) {}
73};
74
75} // namespace Morpheus
76
77#endif // MORPHEUS_EXCEPTIONS_HPP
Definition: Morpheus_Exceptions.hpp:32
Definition: Morpheus_Exceptions.hpp:69
Definition: Morpheus_Exceptions.hpp:51
Definition: Morpheus_Exceptions.hpp:63
Definition: Morpheus_Exceptions.hpp:43
Definition: Morpheus_Exceptions.hpp:57
Generic Morpheus interfaces.
Definition: dummy.cpp:24