Athena IO Library
NotImplementedException.hpp
1 // This file is part of libAthena.
2 //
3 // libAthena is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // libAthena is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with libAthena. If not, see <http://www.gnu.org/licenses/>
15 
16 #ifndef NOTIMPLEMENTEDEXCEPTION_HPP
17 #define NOTIMPLEMENTEDEXCEPTION_HPP
18 
19 #include "Athena/Exception.hpp"
20 
21 namespace Athena
22 {
23 namespace error
24 {
26 {
27 public:
28  NotImplementedException(const std::string& message, const std::string& file, const std::string& function, const int line) :
29  Exception(message, file, function, line)
30  {
31  m_exceptionName = "NotImplementedException";
32  }
33 };
34 } // error
35 } // Athena
36 
37 #define THROW_NOT_IMPLEMENTED_EXCEPTION() \
38  do { \
39  if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, "NotImplementedException"); return; \
40  } else { \
41  throw Athena::error::NotImplementedException(std::string(), __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
42  } \
43  } while(0)
44 
45 #define THROW_NOT_IMPLEMENTED_EXCEPTION_RETURN(ret) \
46  do { \
47  if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, "NotImplementedException"); return ret; \
48  } else { \
49  throw Athena::error::NotImplementedException(std::string(), __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
50  } \
51  } while(0)
52 #endif // NOTIMPLEMENTEDEXCEPTION_HPP
Exception(const std::string &message, const std::string &file, const std::string &function, const int line)
The constructor for an Exception.
Definition: Exception.hpp:44
std::string message() const
Returns the Error message of the exception.
Definition: Exception.hpp:56
The baseclass for all Exceptions.
Definition: Exception.hpp:38