5#include <Foundation/Containers/Map.h>
6#include <Foundation/Strings/String.h>
7#include <Foundation/Types/Variant.h>
8#include <Foundation/Utilities/EnumerableClass.h>
43 plUInt32 m_uiNumTimesFired;
44 plUInt16 m_uiNumEventHandlersRegular;
45 plUInt16 m_uiNumEventHandlersOnce;
66 static void PrintGlobalEventStatistics();
69 static void UpdateGlobalEventStatistics();
78 PL_GLOBAL_EVENT_HANDLER m_EventHandler;
80 static EventMap s_KnownEvents;
84#define PL_BROADCAST_EVENT(name, ...) plGlobalEvent::Broadcast(#name, ##__VA_ARGS__);
87#define PL_ON_GLOBAL_EVENT(name) \
88 static void EventHandler_##name(const plVariant& param0, const plVariant& param1, const plVariant& param2, const plVariant& param3); \
89 static plGlobalEvent s_EventHandler_##name(#name, EventHandler_##name, false); \
90 static void EventHandler_##name(const plVariant& param0, const plVariant& param1, const plVariant& param2, const plVariant& param3)
93#define PL_ON_GLOBAL_EVENT_ONCE(name) \
94 static void EventHandler_##name(const plVariant& param0, const plVariant& param1, const plVariant& param2, const plVariant& param3); \
95 static plGlobalEvent s_EventHandler_##name(#name, EventHandler_##name, true); \
96 static void EventHandler_##name(const plVariant& param0, const plVariant& param1, const plVariant& param2, const plVariant& param3)
Base class to add the ability to another class to enumerate all active instance of it,...
Definition EnumerableClass.h:28
A class to broadcast and handle global (system-wide) events.
Definition GlobalEvent.h:35
static const EventMap & GetEventStatistics()
Returns the map that holds the current statistics about the global events.
Definition GlobalEvent.h:72
void(*)(const plVariant &, const plVariant &, const plVariant &, const plVariant &) PL_GLOBAL_EVENT_HANDLER
[internal] Use the macro PL_ON_GLOBAL_EVENT or PL_ON_GLOBAL_EVENT_ONCE to create an event handler.
Definition GlobalEvent.h:52
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
Definition GlobalEvent.h:40