43 #ifndef ARGOS_EXCEPTION_H
44 #define ARGOS_EXCEPTION_H
47 class CARGoSException;
70 CARGoSException(
const std::string& str_what, std::exception* pc_nested = NULL)
throw() :
71 m_strWhat(
"[FATAL] " + str_what), m_pcNested(pc_nested) {
72 if (m_pcNested != NULL) {
76 << m_pcNested->what();
90 virtual const char*
what()
const throw() {
91 return m_strWhat.c_str();
100 std::string m_strWhat;
102 std::exception* m_pcNested;
111 #define THROW_ARGOSEXCEPTION(message) { std::ostringstream what; what << message; throw CARGoSException(what.str()); }
115 #define THROW_ARGOSEXCEPTION_NESTED(message, nested) { std::ostringstream what; what << message; throw CARGoSException(what.str(), &nested); }
122 #define ARGOS_ASSERT(condition, message) { if ( !(condition) ) THROW_ARGOSEXCEPTION(message); }
124 #define ARGOS_ASSERT(condition, message)
The namespace containing all the ARGoS related code.
The exception that wraps all errors in ARGoS.
virtual const char * what() const
Returns the error message that explains what happened and why the exception was thrown The returned m...
CARGoSException(const std::string &str_what, std::exception *pc_nested=NULL)
Class constructor.
virtual ~CARGoSException()
Class destructor.