-
Notifications
You must be signed in to change notification settings - Fork 0
/
MatrixException.H
51 lines (31 loc) · 1.11 KB
/
MatrixException.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# ifndef __MATRIX_EXCEPTION_H__
# define __MATRIX_EXCEPTION_H__
# include <exception>
# include <iostream>
# include <string>
class MatrixException : public std::exception {
public:
explicit MatrixException(std::string mess) : std::exception{} , message{mess}
{}
virtual ~MatrixException() noexcept = default ;
inline virtual const char* what() const noexcept { return this-> message.c_str() ;}
protected:
std::string message ;
};
//-------------------------------------------------------------------------------
class InvalidSizeException : public MatrixException {
public:
InvalidSizeException(const std::string &mess) : MatrixException{mess}
{}
};
class InvalidCoordinateException : public MatrixException {
public:
InvalidCoordinateException(const std::string &mess) : MatrixException{mess}
{}
};
class OpeningFileException : public MatrixException {
public :
OpeningFileException(const std::string &mess) : MatrixException{mess}
{}
};
# endif