TBTK
Need a break? Support the development by playing Polarity Puzzles
Exception.h
1 #ifndef COM_DAFER45_TBTK_EXCEPTION
2 #define COM_DAFER45_TBTK_EXCEPTION
3 
4 #include <exception>
5 #include <string>
6 
7 namespace TBTK{
8 
9 class Exception : public std::exception{
10 public:
12  Exception();
13 
15  Exception(
16  const std::string& function,
17  const std::string& where,
18  const std::string& message,
19  const std::string& hint
20  );
21 
23  virtual ~Exception();
24 
26  virtual const char* what() const noexcept;
27 
29  virtual void print() const;
30 
32  const std::string& getFunction() const;
33 
35  const std::string& getWhere() const;
36 
38  const std::string& getMessage() const;
39 
41  const std::string& getHint() const;
42 private:
44  std::string function;
45 
47  std::string where;
48 
50  std::string message;
51 
53  std::string hint;
54 };
55 
56 inline const std::string& Exception::getFunction() const{
57  return function;
58 }
59 
60 inline const std::string& Exception::getWhere() const{
61  return where;
62 }
63 
64 inline const std::string& Exception::getMessage() const{
65  return message;
66 }
67 
68 inline const std::string& Exception::getHint() const{
69  return hint;
70 }
71 
72 }; //End of namespace TBTK
73 
74 #endif
TBTK::Exception::getMessage
const std::string & getMessage() const
Definition: Exception.h:64
TBTK::Exception::what
virtual const char * what() const noexcept
TBTK::Exception::getFunction
const std::string & getFunction() const
Definition: Exception.h:56
TBTK::Exception::getHint
const std::string & getHint() const
Definition: Exception.h:68
TBTK::Exception
Definition: Exception.h:9
TBTK::Exception::getWhere
const std::string & getWhere() const
Definition: Exception.h:60
TBTK::Exception::Exception
Exception()
TBTK::Exception::~Exception
virtual ~Exception()
TBTK::Exception::print
virtual void print() const