From b66dc3f5f5b4fe25069c30080ed83e47d4eda79d Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Sun, 4 Jan 2015 01:54:54 +0100 Subject: Allowing to return human readable name of an event --- src/core/managed/Events.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/managed/Events.hpp') diff --git a/src/core/managed/Events.hpp b/src/core/managed/Events.hpp index 177824c..768f0aa 100644 --- a/src/core/managed/Events.hpp +++ b/src/core/managed/Events.hpp @@ -173,6 +173,18 @@ struct EventHandlerDescriptor { : type(type), handler(handler), owner(owner), data(data) { } + + /** + * Returns a human readable name of the given event type. + */ + static const char *getEventTypeName(EventType type); + + /** + * Returns the name of the current event type. + */ + const char *getEventTypeName() const { + return getEventTypeName(this->type); + } }; } -- cgit v1.2.3