Go to the documentation of this file.
93 new(
this)
ExceptionBase(
"(undefined)", -1,
"(undefined)", message);
104 const std::string&
function,
const std::string& excName)
throw();
117 const
std::
string& excName) throw();
167 const std::string&
function,
const std::string& disc = std::string(
"")) throw();
170 virtual const
char* what() const throw();
177 mutable
std::
string outputMessage_ ;
223 const std::string&
function,
const std::string& excName,
224 const std::string& feature = std::string(
"")) throw();
273 const
std::
string& cond) throw();
285 void setFieldsAssert(const
std::
string& file, const
unsigned int line,
287 const
std::
string& excName,
288 const
std::
string& cond =
std::
string("")) throw();
296 # define __PRETTY_FUNCTION__ "(unknown)"
317 const unsigned int line,
318 const std::string&
function,
319 const std::string& excName) {
320 e.setFields(file, line,
function, excName);
325 std::cout << e << std::endl;
344 #define conceptsException(exc) \
345 exception_set_fields(exc, std::string(__FILE__), __LINE__, \
346 std::string(__PRETTY_FUNCTION__), std::string(#exc))
348 #define CONCEPTS_SIMPLE_EXC(msg) \
349 exception_set_fields(ExceptionBase(), std::string(__FILE__), __LINE__, \
350 std::string(__PRETTY_FUNCTION__), std::string(msg))
365 const std::string&
function,
366 const std::string& exc_name,
367 const std::string& cond, exc e) {
368 e.setFieldsAssert(file, line,
function, exc_name, cond);
371 std::cout << e << std::endl;
394 #define conceptsAssert(cond, exc) { }
396 #define conceptsAssert(cond, exc) { \
398 std::stringstream errorMsg; \
399 errorMsg << "by violating condition <" << #cond << ">"; \
400 exception_throw_assert(std::string(__FILE__), __LINE__, \
401 std::string(__PRETTY_FUNCTION__), \
402 std::string(#exc), errorMsg.str(), exc); \
411 #define conceptsThrowSimpleE(msg) { \
412 std::stringstream errorMsg; \
414 exception_throw_assert(std::string(__FILE__), __LINE__, \
415 std::string(__PRETTY_FUNCTION__), \
416 std::string("SimpleException"), errorMsg.str(), concepts::Assertion()); \
442 #define conceptsAssert3(cond, exc, msg) { }
444 #define conceptsAssert3(cond, exc, msg) { \
446 std::stringstream errorMsg; \
447 errorMsg << "by violating condition <" << #cond << ">, " << msg; \
448 exception_throw_assert(std::string(__FILE__), __LINE__, \
449 std::string(__PRETTY_FUNCTION__), \
450 std::string(#exc), errorMsg.str(), exc); \
457 #endif // exceptions_hh
MissingFeature(const std::string &file, const unsigned int line, const std::string &function, const std::string &excName, const std::string &feature=std::string(""))
Constructor.
ExceptionBase()
Default constructor.
Exception class to express dimensions not matching.
Base class for exceptions.
void exception_throw_assert(const std::string &file, int line, const std::string &function, const std::string &exc_name, const std::string &cond, exc e)
Sets the fields of an assertion and throws it.
static bool & doit()
If doit is set to false, no stacktrace is printed.
unsigned int line_
Line where the exception was thrown from.
static void print()
Prints the stacktrace.
std::string function_
Name of the function that threw the exception.
Assertion()
Default constructor.
Exception class for assertions.
std::string file_
Filename where the exception was thrown from.
ExceptionBase(const std::string &file, const unsigned int line, const std::string &function, const std::string &excName)
Constructor.
void setFields(const std::string &file, const unsigned int line, const std::string &function, const std::string &excName)
Sets the fields of this exception.
Exception class to express that an index in a dynamic array does not exist.
Exception class to express a missing feature.
Dumps a stack trace using gdb.
exc exception_set_fields(exc e, const std::string &file, const unsigned int line, const std::string &function, const std::string &excName)
Sets fields on exception and throws it.
MissingFeature(const std::string &feature)
Constructor.
std::string excName_
The name of the exception with calling sequence.
Class providing an output operator.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Basic namespace for Concepts-2.