SGSolve
sgexception.hpp
1 // This file is part of the SGSolve library for stochastic games
2 // Copyright (C) 2019 Benjamin A. Brooks
3 //
4 // SGSolve free software: you can redistribute it and/or modify it
5 // under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // SGSolve is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see
16 // <http://www.gnu.org/licenses/>.
17 //
18 // Benjamin A. Brooks
19 // ben@benjaminbrooks.net
20 // Chicago, IL
21 
22 #ifndef _SGEXCEPTION_HPP
23 #define _SGEXCEPTION_HPP
24 
25 #include "sgnamespace.hpp"
26 #include "sgcommon.hpp"
27 
29 
35 class SGException : public std::exception
36 {
37 public:
40 
42  virtual const char* what() const throw();
43 
45  SG::EXCEPTION_TYPE getType() const
46  {
47  return type;
48  }
49 
50 private:
53 };
54 
55 #endif
SGException::SGException
SGException(SG::EXCEPTION_TYPE _type=SG::DEFAULT)
Constructor for new SGException.
Definition: sgexception.hpp:39
SGException
SGSolve specific exceptions.
Definition: sgexception.hpp:36
SGException::getType
SG::EXCEPTION_TYPE getType() const
Returns the type of the exception.
Definition: sgexception.hpp:45
SG::DEFAULT
@ DEFAULT
Definition: sgnamespace.hpp:31
SGException::type
SG::EXCEPTION_TYPE type
Flag that indicates the type of error encountered.
Definition: sgexception.hpp:52
SGException::what
virtual const char * what() const
Returns the message corresponding to the ExceptionType.
Definition: sgexception.cpp:24
SG
Namespace for enumerations associated with SGSolve.
Definition: sgnamespace.hpp:27
SG::EXCEPTION_TYPE
EXCEPTION_TYPE
Code for the type of error.
Definition: sgnamespace.hpp:30