ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/utils/OpenMDException.hpp
(Generate patch)

Comparing trunk/src/utils/OpenMDException.hpp (file contents):
Revision 2044 by gezelter, Sun Jun 16 15:15:42 2013 UTC vs.
Revision 2045 by gezelter, Fri Nov 28 20:10:17 2014 UTC

# Line 42 | Line 42
42  
43   #ifndef UTILS_OPENMDEXCEPTION_HPP
44   #define UTILS_OPENMDEXCEPTION_HPP
45 +
46 + #include <exception>
47 +
48   namespace OpenMD {
49  
50 <  class OpenMDException {
50 >  class OpenMDException : public std::exception {
51    public:
52      OpenMDException() : msg_("") {}
53 <    OpenMDException(const std::string &msg) : msg_(msg) {}
54 <    const std::string getMessage() {return msg_;}
53 >    explicit OpenMDException(const std::string &msg) : msg_(msg) {};
54 >
55 >    ~OpenMDException() throw() {}
56 >
57 >    const char * what () const throw ()
58 >    {
59 >      return msg_.c_str();
60 >    }
61    private:    
62      std::string msg_;
63      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines