36
// The exception handling classes from the STL do what we want,
37
// so this is nothing more than a base class for any of our
38
// derived exceptions. I have changed the constructor to take a
39
// std::string object, but this gets converted before calling
43
class Exception : public std::exception
46
Exception (std::string name) throw()
47
: std::exception (), name_ (name)
51
virtual ~Exception () throw () {}
53
virtual const char* what () const throw()
63
// ************************
65
// * Derived Exceptions *
67
// ************************
69
class BoundsException : public Exception
72
BoundsException (std::string name="")
73
: Exception ("apBoundsException: " + name)
78
class NotSupportedException : public Exception
81
NotSupportedException (std::string name="")
82
: Exception ("NotSupportedException: " + name)
87
class DivisionByZeroException : public Exception
90
DivisionByZeroException (std::string name="")
91
: Exception ("DivisionByZeroException: " + name)
96
class InvalidIndexException : public Exception
99
InvalidIndexException (std::string name="")
100
: Exception ("InvalidIndexException: " + name)
36
// The exception handling classes from the STL do what we want,
37
// so this is nothing more than a base class for any of our
38
// derived exceptions. I have changed the constructor to take a
39
// std::string object, but this gets converted before calling
43
class Exception : public std::exception
46
Exception (std::string name) throw()
47
: std::exception (), name_ (name)
51
virtual ~Exception () throw () {}
53
virtual const char* what () const throw()
63
// ************************
65
// * Derived Exceptions *
67
// ************************
69
class BoundsException : public Exception
72
BoundsException (std::string name="")
73
: Exception ("apBoundsException: " + name)
78
class NotSupportedException : public Exception
81
NotSupportedException (std::string name="")
82
: Exception ("NotSupportedException: " + name)
87
class DivisionByZeroException : public Exception
90
DivisionByZeroException (std::string name="")
91
: Exception ("DivisionByZeroException: " + name)
96
class InvalidIndexException : public Exception
99
InvalidIndexException (std::string name="")
100
: Exception ("InvalidIndexException: " + name)
107
107
#endif // EXCEPTION_H
b'\\ No newline at end of file'