#include <iostream>
#include <stdexcept>
Go to the source code of this file.
|
| #define | HART_STRINGIFY(x) HART_STRINGIFY2(x) |
| |
| #define | HART_STRINGIFY2(x) #x |
| |
| #define | HART_LINE_STRING HART_STRINGIFY(__LINE__) |
| |
| #define | HART_THROW(ExceptionType, message) do { throw ExceptionType (std::string (message) + ", file: " __FILE__ ", line: " HART_LINE_STRING); } while (0) |
| |
| #define | HART_THROW_OR_RETURN(ExceptionType, message, returnValue) do { HART_THROW (ExceptionType, message); return returnValue; } while (0) |
| |
| #define | HART_THROW_OR_RETURN_VOID(ExceptionType, message) do { HART_THROW (ExceptionType, message); return; } while(0) |
| |
| #define | hassertfalse HART_THROW (hart::HartAssertException, "hassertfalse failed") |
| |
| #define | hassert(condition) if (! (condition)) { HART_THROW (hart::HartAssertException, std::string ("hassert failed:") + #condition); } |
| |
| #define | HART_WARNING(message) std::cout << "Warning: " << message << ", file: " << __FILE__ << ", line: " << __LINE__ << std::endl |
| |
◆ HART_STRINGIFY
◆ HART_STRINGIFY2
| #define HART_STRINGIFY2 |
( |
|
x | ) |
#x |
◆ HART_LINE_STRING
◆ HART_THROW
| #define HART_THROW |
( |
|
ExceptionType, |
|
|
|
message |
|
) |
| do { throw ExceptionType (std::string (message) + ", file: " __FILE__ ", line: " HART_LINE_STRING); } while (0) |
◆ HART_THROW_OR_RETURN
| #define HART_THROW_OR_RETURN |
( |
|
ExceptionType, |
|
|
|
message, |
|
|
|
returnValue |
|
) |
| do { HART_THROW (ExceptionType, message); return returnValue; } while (0) |
◆ HART_THROW_OR_RETURN_VOID
| #define HART_THROW_OR_RETURN_VOID |
( |
|
ExceptionType, |
|
|
|
message |
|
) |
| do { HART_THROW (ExceptionType, message); return; } while(0) |
◆ hassertfalse
◆ hassert
◆ HART_WARNING
| #define HART_WARNING |
( |
|
message | ) |
std::cout << "Warning: " << message << ", file: " << __FILE__ << ", line: " << __LINE__ << std::endl |