#include <exception>
#include <cstring>
#include <cerrno>
#include <cassert>
#include <cstdlib>
#include <cstdio>
#include <sstream>
Go to the source code of this file.
|
| #define | EXCEPTION(type) type(__FILE__, __LINE__, __PRETTY_FUNCTION__) |
| | Without VA_ARGS. More...
|
| |
| #define | EXCEPTION1(type, arg) type(__FILE__, __LINE__, __PRETTY_FUNCTION__, std::string(arg)) |
| |
| #define | EXCEPTION2(type, arg1, arg2) type(__FILE__, __LINE__, __PRETTY_FUNCTION__, std::string(arg1, arg2)) |
| |
| #define | THROW(type) |
| |
| #define | THROW1(type, arg) |
| |
| #define | THROW2(type, arg1, arg2) |
| |
| #define | THROW3(type, arg1, arg2, arg3) |
| |
| #define | THROW4(type, arg1, arg2, arg3, arg4) |
| |
| #define | THROW_IF(Exception, err) |
| |
| #define | DEFINE_EXCEPTION(Name) |
| |
| #define | unreachable() THROW(Unreachable) |
| |
§ DEFINE_EXCEPTION
| #define DEFINE_EXCEPTION |
( |
|
Name | ) |
|
Value: public: \
Name(const char* filename, int line_num, const char* function_name, \
const char* m) \
{ \
} \
}
Definition: kits_exception.h:71
ZappsException(const char *filename, int line_num, const char *function_name, std::string const &m)
Definition: kits_exception.h:78
§ EXCEPTION
§ EXCEPTION1
| #define EXCEPTION1 |
( |
|
type, |
|
|
|
arg |
|
) |
| type(__FILE__, __LINE__, __PRETTY_FUNCTION__, std::string(arg)) |
§ EXCEPTION2
| #define EXCEPTION2 |
( |
|
type, |
|
|
|
arg1, |
|
|
|
arg2 |
|
) |
| type(__FILE__, __LINE__, __PRETTY_FUNCTION__, std::string(arg1, arg2)) |
§ THROW
Value:do { \
assert(false); \
} while (false)
#define __PRETTY_FUNCTION__
Definition: compat.h:34
§ THROW1
| #define THROW1 |
( |
|
type, |
|
|
|
arg |
|
) |
| |
Value:do { \
fprintf(stderr, arg.c_str()); \
fflush(stderr); \
assert(false); \
} while (false)
#define __PRETTY_FUNCTION__
Definition: compat.h:34
§ THROW2
| #define THROW2 |
( |
|
type, |
|
|
|
arg1, |
|
|
|
arg2 |
|
) |
| |
Value:do { \
fprintf(stderr, arg1, arg2); \
fflush(stderr); \
assert(false); \
} while (false)
#define __PRETTY_FUNCTION__
Definition: compat.h:34
§ THROW3
| #define THROW3 |
( |
|
type, |
|
|
|
arg1, |
|
|
|
arg2, |
|
|
|
arg3 |
|
) |
| |
Value:do { \
fprintf(stderr, arg1, arg2, arg3); \
fflush(stderr); \
assert(false); \
} while (false)
#define __PRETTY_FUNCTION__
Definition: compat.h:34
§ THROW4
| #define THROW4 |
( |
|
type, |
|
|
|
arg1, |
|
|
|
arg2, |
|
|
|
arg3, |
|
|
|
arg4 |
|
) |
| |
Value:do { \
fprintf(stderr, arg1, arg2, arg3, arg4); \
fflush(stderr); \
assert(false); \
} while (false)
#define __PRETTY_FUNCTION__
Definition: compat.h:34
§ THROW_IF
| #define THROW_IF |
( |
|
Exception, |
|
|
|
err |
|
) |
| |
Value:do { \
assert(!err); \
if(err) { \
} \
} while (false)
std::string errno_to_str(int err=errno)
Definition: kits_exception.h:114
§ unreachable
| #define unreachable |
( |
| ) |
THROW(Unreachable) |
§ DEFINE_EXCEPTION() [1/5]
| DEFINE_EXCEPTION |
( |
Unreachable |
| ) |
|
§ DEFINE_EXCEPTION() [2/5]
| DEFINE_EXCEPTION |
( |
BadAlloc |
| ) |
|
§ DEFINE_EXCEPTION() [3/5]
| DEFINE_EXCEPTION |
( |
OutOfRange |
| ) |
|
§ DEFINE_EXCEPTION() [4/5]
| DEFINE_EXCEPTION |
( |
FileException |
| ) |
|
§ DEFINE_EXCEPTION() [5/5]
| DEFINE_EXCEPTION |
( |
BdbException |
| ) |
|
§ errno_to_str()
| std::string errno_to_str |
( |
int |
err = errno | ) |
|
|
inline |