00001 /* 00002 Error class that incorporates additional information. 00003 00004 Copyright (C) 2010 - 2014 Christoph Haenisch 00005 00006 Chair of Medical Engineering (mediTEC) 00007 RWTH Aachen University 00008 Pauwelsstr. 20 00009 52074 Aachen 00010 Germany 00011 00012 See license.txt for more information. 00013 00014 Version 0.7.1 (2011-09-09) 00015 */ 00016 00023 #ifndef ERROR_OBJ_HPP_6804646817 00024 #define ERROR_OBJ_HPP_6804646817 00025 00026 // #include <boost/any.hpp> // disabled for the moment 00027 #include <exception> 00028 #include <string> 00029 00030 00031 namespace TRTK 00032 { 00033 00034 00144 class ErrorObj : public std::exception 00145 { 00146 public: 00147 ErrorObj(); 00148 00149 ErrorObj(const std::string error_message); 00150 00151 ErrorObj(const std::string error_message, 00152 const std::string class_name); 00153 00154 ErrorObj(const std::string error_message, 00155 const std::string class_name, 00156 const std::string function_name, 00157 const int error_code = 0); 00158 00159 virtual ~ErrorObj() throw(); 00160 00167 enum Verbosity {NON_VERBOSE, 00168 VERBOSE 00169 }; 00170 00171 virtual const char * what() const throw(); 00172 virtual const char * what(const Verbosity = NON_VERBOSE) const throw(); 00173 00174 std::string getClassName(void) const; 00175 int getErrorCode(void) const; 00176 std::string getErrorMessage(void) const; 00177 std::string getFunctionName(void) const; 00178 // boost::any getValue(void) const; ///< Returns the stored value. // disabled for the moment 00179 00180 void setClassName(const std::string class_name); 00181 void setErrorCode(const int error_code); 00182 void setErrorMessage(const std::string error_message); 00183 void setFunctionName(const std::string function_name); 00184 // void setValue(const boost::any value); ///< Stores an abitrary value. // disabled for the moment 00185 00186 private: 00187 int error_code; 00188 std::string class_name; 00189 std::string function_name; 00190 std::string error_message; 00191 // boost::any value; // disabled for the moment 00192 }; 00193 00194 00195 } // namespace TRTK 00196 00197 00198 #endif // ERROR_OBJ_HPP_6804646817 00199 00200 // kate: indent-mode cstyle; space-indent on; indent-width 4;
Documentation generated by Doxygen