itpp_sci  1.0.0
it++ based simulation framework for scicoslab, scilab and scipy
_sim_exception.hpp
1 /*xxx
2 * \brief - sci_error class
3 * \author maki
4 */
5 
6 #ifndef SIM_EXCEPTION_HPP
7 #define SIM_EXCEPTION_HPP
8 
9 #include <stdexcept>
10 
11 class sim_exception : public std::runtime_error
12 {
13  int info_;
14  char *msg_;
15 public:
16 
17  sim_exception(char * msg, int info): std::runtime_error(msg), msg_(msg) , info_(info) {};
18  sim_exception(char * msg): std::runtime_error(msg), msg_(msg)
19  {
20  info_ = 0;
21  };
22  sim_exception(): std::runtime_error("Unknown Error")
23  {
24  msg_ = "Unknown Error";
25  info_ = -1;
26  };
27 
28  int get_info() const
29  {
30  return info_;
31  };
32  const char* get_msg()
33  {
34  return msg_;
35  };
36 
37 };
38 
39 #endif