Storm
1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
macros.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
storm/utility/logging.h
"
4
5
#include <cassert>
6
7
// Define STORM_LOG_ASSERT which is only checked when NDEBUG is not set.
8
#ifndef NDEBUG
9
#define STORM_LOG_ASSERT(cond, message) \
10
do { \
11
if (!(cond)) { \
12
STORM_LOG_ERROR(message); \
13
assert(cond); \
14
} \
15
} while (false)
16
#define STORM_LOG_WARN_COND_DEBUG(cond, message) \
17
do { \
18
if (!(cond)) { \
19
STORM_LOG_WARN(message); \
20
} \
21
} while (false)
22
#else
23
#define STORM_LOG_ASSERT(cond, message)
24
#define STORM_LOG_WARN_COND_DEBUG(cond, message)
25
#endif
26
27
// Define STORM_LOG_THROW to always throw the exception with the given message if the condition fails to hold.
28
#define STORM_LOG_THROW(cond, exception, message) \
29
do { \
30
if (!(cond)) { \
31
STORM_LOG_ERROR(message); \
32
throw exception() << message; \
33
} \
34
} while (false)
35
36
#define STORM_LOG_WARN_COND(cond, message) \
37
do { \
38
if (!(cond)) { \
39
STORM_LOG_WARN(message); \
40
} \
41
} while (false)
42
43
#define STORM_LOG_INFO_COND(cond, message) \
44
do { \
45
if (!(cond)) { \
46
STORM_LOG_INFO(message); \
47
} \
48
} while (false)
49
50
#define STORM_LOG_ERROR_COND(cond, message) \
51
do { \
52
if (!(cond)) { \
53
STORM_LOG_ERROR(message); \
54
} \
55
} while (false)
logging.h
src
storm
utility
macros.h
Generated by
1.15.0