aboutsummaryrefslogtreecommitdiff
path: root/include/cru/base/Event.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/base/Event.h')
-rw-r--r--include/cru/base/Event.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/cru/base/Event.h b/include/cru/base/Event.h
index 276c313f..c26bea83 100644
--- a/include/cru/base/Event.h
+++ b/include/cru/base/Event.h
@@ -128,6 +128,13 @@ class Event : public EventBase, public IEvent<TEventArgs> {
EventHandlerToken current_token_ = 0;
};
+#define CRU_DEFINE_EVENT(name, arg_type) \
+ private: \
+ ::cru::Event<arg_type> name##Event_; \
+ \
+ public: \
+ ::cru::IEvent<arg_type>* name##Event() { return &name##Event_; }
+
namespace details {
struct EventHandlerRevokerDestroyer {
void operator()(EventHandlerRevoker* p) {