diff options
Diffstat (limited to 'include/mbgl/util/event.hpp')
-rw-r--r-- | include/mbgl/util/event.hpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/include/mbgl/util/event.hpp b/include/mbgl/util/event.hpp new file mode 100644 index 0000000000..7ad3d914e8 --- /dev/null +++ b/include/mbgl/util/event.hpp @@ -0,0 +1,58 @@ +#pragma once + +#include <cstdint> + +namespace mbgl { + +enum class EventSeverity : uint8_t { + Debug, + Info, + Warning, + Error, +}; + +enum class Event : uint8_t { + General, + Setup, + Shader, + ParseStyle, + ParseTile, + Render, + Style, + Database, + HttpRequest, + Sprite, + Image, + OpenGL, + JNI, + Android, + Crash, + Glyph, +}; + +struct EventPermutation { + const EventSeverity severity; + const Event event; + + constexpr bool operator==(const EventPermutation &rhs) const { + return severity == rhs.severity && event == rhs.event; + } +}; + +constexpr EventSeverity disabledEventSeverities[] = { +#ifdef NDEBUG + EventSeverity(-1) // Avoid zero size array +#else + EventSeverity::Debug +#endif +}; + +constexpr Event disabledEvents[] = { + Event(-1) // Avoid zero size array +}; + +constexpr EventPermutation disabledEventPermutations[] = { + { EventSeverity::Debug, Event::Shader } +}; + +} // namespace mbgl |