Exception class declaration.
- namespace tk
- Toolkit declarations and definitions for general purpose utilities.
Throw macro that always throws an exception.
Throw Exception with arguments passed in. Add source filename, function name, and line number where exception occurred. This macro facilitates a throw of Exception that is somehwat cleaner at the point of invocation than a direct throw of Exception, as it hides the file:func:line arguments. Whenever is possible, it should be used via the Assert and ErrChk macros defined below.
#define Assert(expr, ...)
Assert macro that only throws an exception if expr fails.
If NDEBUG is defined (e.g. cmake's RELEASE or OPTIMIZED mode), do nothing, expr is not evaluated. If NDEBUG is not defined, evaluate expr. If expr is true, do nothing. If expr is false, throw Exception with arguments passed in. The behavior is similar to libc's assert macro, but throwing an Exception instead will also generate a nice call-trace and will attempt to free memory. This macro should be used to detect programmer errors.
#define ErrChk(expr, ...)
ErrChk macro that only throws an exception if expr fails.
The behavior of this macro is the same whether NDEBUG is defined or not: expr is always evaluated. If expr is true, do nothing. If expr is false, throw Exception with arguments passed in. This macro should be used to detect user or runtime errors.