diff options
Diffstat (limited to 'include/cru/base')
| -rw-r--r-- | include/cru/base/Base.h | 7 | ||||
| -rw-r--r-- | include/cru/base/Event.h | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/include/cru/base/Base.h b/include/cru/base/Base.h index fda45f66..3cd04f8c 100644 --- a/include/cru/base/Base.h +++ b/include/cru/base/Base.h @@ -137,12 +137,17 @@ class CRU_BASE_API Exception : public std::exception { std::shared_ptr<std::exception> inner_; }; +class CRU_BASE_API NotImplementedException : public Exception { + public: + using Exception::Exception; // inherit constructors +}; + class CRU_BASE_API PlatformException : public Exception { public: using Exception::Exception; // inherit constructors }; -class ErrnoException : public Exception { +class CRU_BASE_API ErrnoException : public Exception { public: ErrnoException(); explicit ErrnoException(int error_code); diff --git a/include/cru/base/Event.h b/include/cru/base/Event.h index bdaf3ea6..71c0ac6b 100644 --- a/include/cru/base/Event.h +++ b/include/cru/base/Event.h @@ -141,6 +141,13 @@ class Event : public EventBase, public IEvent<TEventArgs> { public: \ ::cru::IEvent<arg_type>* name##Event() { return &name##Event_; } +#define CRU_DEFINE_EVENT_OVERRIDE(name, arg_type) \ + private: \ + ::cru::Event<arg_type> name##Event_; \ + \ + public: \ + ::cru::IEvent<arg_type>* name##Event() override { return &name##Event_; } + namespace details { struct EventHandlerRevokerCaller { void operator()(const EventHandlerRevoker& revoker) { revoker(); } |
