TBTK
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  const std::string& function,
14  const std::string& where,
15  const std::string& message,
16  const std::string& hint
17  );
18 
20  virtual ~Exception();
21 
23  virtual const char* what() const noexcept;
24 
26  virtual void print() const;
27 
29  const std::string& getFunction() const;
30 
32  const std::string& getWhere() const;
33 
35  const std::string& getMessage() const;
36 
38  const std::string& getHint() const;
39 private:
41  std::string function;
42 
44  std::string where;
45 
47  std::string message;
48 
50  std::string hint;
51 };
52 
53 inline const std::string& Exception::getFunction() const{
54  return function;
55 }
56 
57 inline const std::string& Exception::getWhere() const{
58  return where;
59 }
60 
61 inline const std::string& Exception::getMessage() const{
62  return message;
63 }
64 
65 inline const std::string& Exception::getHint() const{
66  return hint;
67 }
68 
69 }; //End of namespace TBTK
70 
71 #endif
virtual const char * what() const noexcept
Definition: Exception.h:9
const std::string & getMessage() const
Definition: Exception.h:61
const std::string & getFunction() const
Definition: Exception.h:53
const std::string & getHint() const
Definition: Exception.h:65
virtual void print() const
virtual ~Exception()
Exception(const std::string &function, const std::string &where, const std::string &message, const std::string &hint)
const std::string & getWhere() const
Definition: Exception.h:57
Definition: ModelFactory.h:35