escript  Revision_
EsysException.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2018 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16 
17 #ifndef __ESCRIPT_ESYSEXCEPTION_H__
18 #define __ESCRIPT_ESYSEXCEPTION_H__
19 
20 #include <exception>
21 #include <string>
22 
23 namespace escript {
24 
28 class EsysException : public std::exception
29 {
30 public:
37  EsysException(const std::string& message) : msg(message) {}
38 
40  virtual ~EsysException() throw() {}
41 
46  inline virtual const char* what() const throw() { return msg.c_str(); }
47 
48 private:
49  //
50  // the exception message
51  std::string msg;
52 };
53 
58 class AssertException : public EsysException
59 {
60 public:
61  AssertException(const std::string& str) : EsysException(str) {}
62 };
63 
68 class IOError : public EsysException
69 {
70 public:
71  IOError(const std::string& str) : EsysException(str) {}
72 };
73 
79 {
80 public:
81  NotImplementedError(const std::string& str) : EsysException(str) {}
82 };
83 
88 class ValueError : public EsysException
89 {
90 public:
91  ValueError(const std::string& str) : EsysException(str) {}
92 };
93 
94 } // namespace escript
95 
96 #endif // __ESCRIPT_ESYSEXCEPTION_H__
97 
escript::EsysException::msg
std::string msg
Definition: EsysException.h:74
message
Definition: blocktools.h:67
escript::EsysException
The base class for escript exceptions.
Definition: EsysException.h:39
escript::NotImplementedError
An exception class for features which are not (yet) implemented.
Definition: EsysException.h:89
escript::EsysException::~EsysException
virtual ~EsysException()
Destructor.
Definition: EsysException.h:63
escript::ValueError::ValueError
ValueError(const std::string &str)
Definition: EsysException.h:102
escript::IOError
An exception class for Input/Output errors.
Definition: EsysException.h:79
escript::NotImplementedError::NotImplementedError
NotImplementedError(const std::string &str)
Definition: EsysException.h:92
escript::EsysException::EsysException
EsysException(const std::string &message)
Constructor which creates an Exception with the given message.
Definition: EsysException.h:60
escript::IOError::IOError
IOError(const std::string &str)
Definition: EsysException.h:82
escript::AssertException::AssertException
AssertException(const std::string &str)
Definition: EsysException.h:72
escript
Definition: AbstractContinuousDomain.cpp:22
escript::EsysException::what
virtual const char * what() const
Returns a description of the exception.
Definition: EsysException.h:69
escript::ValueError
An exception class that signals an invalid argument value.
Definition: EsysException.h:99