39 static bool&
doit() {
return doit_; }
167 const std::string&
function,
const std::string& disc = std::string(
"")) throw();
170 virtual const
char* what() const throw();
174 virtual std::ostream& info(std::ostream& os) const throw();
177 mutable std::
string outputMessage_ ;
223 const std::string&
function,
const std::string& excName,
224 const std::string& feature = std::string(
"")) throw();
228 virtual std::ostream& info(std::ostream& os) const throw();
231 std::
string feature_;
271 Assertion(const std::
string& file, const
unsigned int line,
272 const std::
string&
function, const std::
string& excName,
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();
290 virtual std::ostream& info(std::ostream& os) const throw();
296# define __PRETTY_FUNCTION__ "(unknown)"
317 const unsigned int line,
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))
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); \
Assertion()
Default constructor.
ExceptionBase(const std::string &file, const unsigned int line, const std::string &function, const std::string &excName)
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
std::string excName_
The name of the exception with calling sequence.
std::string function_
Name of the function that threw the exception.
unsigned int line_
Line where the exception was thrown from.
std::string file_
Filename where the exception was thrown from.
ExceptionBase()
Default constructor.
void setFields(const std::string &file, const unsigned int line, const std::string &function, const std::string &excName)
MissingFeature(const std::string &feature)
MissingFeature(const std::string &file, const unsigned int line, const std::string &function, const std::string &excName, const std::string &feature=std::string(""))
static bool & doit()
If doit is set to false, no stacktrace is printed.
static void print()
Prints the stacktrace.
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)
Set< F > makeSet(uint n, const F &first,...)
exc exception_set_fields(exc e, const std::string &file, const unsigned int line, const std::string &function, const std::string &excName)