/* * File: Exception.h * Author: lpiccoli * * Created on May 26, 2010, 11:49 AM */ #ifndef _EXCEPTION_H #define _EXCEPTION_H #include #include #include #include #include "Defs.h" FF_NAMESPACE_START /** * @author L.Piccoli */ class Exception : public std::exception { public: /** * Codes used to identify the Exceptions generated by the feedback * software. */ enum Code { DEFAULT = 0, STATE_LIMIT, ACTUATOR_LIMIT, }; Exception(std::string message, Code code = DEFAULT) : _message(message), _code(code) { } virtual ~Exception() throw() { } virtual const char* what() const throw() { return _message.c_str(); } Code getCode() { return _code; } protected: // Exception message std::string _message; // Error code Code _code; }; FF_NAMESPACE_END #endif /* _EXCEPTION_H */