pinocchio  2.1.3
exception.hpp
1 //
2 // Copyright (c) 2015 CNRS
3 //
4 
5 #ifndef __pinocchio_exception_hpp__
6 #define __pinocchio_exception_hpp__
7 
8 #include <exception>
9 #include <string>
10 
11 namespace pinocchio
12 {
13  class Exception : public std::exception
14  {
15  public:
16  Exception() : message() {}
17  Exception(std::string msg) : message(msg) {}
18  const char *what() const throw()
19  {
20  return this->getMessage().c_str();
21  }
22  ~Exception() throw() {}
23  virtual const std::string & getMessage() const { return message; }
24  std::string copyMessage() const { return getMessage(); }
25 
26  protected:
27  std::string message;
28  };
29 
30 } // namespace
31 
32 #endif // ifndef __pinocchio_exception_hpp__
Main pinocchio namespace.
Definition: treeview.dox:24