You.i Engine
YiEventHandlerProxy.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_EVENT_HANLDER_PROXY_H_
3 #define _YI_EVENT_HANLDER_PROXY_H_
4 
5 #include "framework/YiPredef.h"
6 
7 #include <atomic>
8 #include <memory>
9 
10 class CYIEvent;
11 class CYIEventHandler;
12 class CYIEventDispatcher;
13 class CYIEventFilter;
14 
27 {
28  friend class CYIEventHandler;
29  friend class CYIEventDispatcher;
30 
31 public:
33 
34  bool RegisterEventFilter(CYIEventFilter *pFilter);
35 
37 
38  bool PreFilter(const std::shared_ptr<CYIEventDispatcher> &pDispatcher, CYIEvent *pEvent);
39 
40  bool PostFilter(const std::shared_ptr<CYIEventDispatcher> &pDispatcher, CYIEvent *pEvent);
41 
42  bool HandleEvent(const std::shared_ptr<CYIEventDispatcher> &pDispatcher, CYIEvent *pEvent);
43 
44 private:
46  CYIEventHandlerProxy &operator=(const CYIEventHandlerProxy &);
47 
48  std::atomic<CYIEventHandler *> m_pEventHandler;
49 };
50 
53 #endif /* _YI_EVENT_HANLDER_PROXY_H_ */
bool UnregisterEventFilter(CYIEventFilter *pFilter)
Allows registering of event filters which can be used to perform processing on an event before and af...
Definition: YiEventHandler.h:25
bool RegisterEventFilter(CYIEventFilter *pFilter)
bool HandleEvent(const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
Base class for events.
Definition: YiEvent.h:489
bool PreFilter(const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
bool PostFilter(const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
Stores, queues and dispatches events as well as sending notifications to IYIEventDispatcherListener o...
Definition: YiEventDispatcher.h:65
Allows children that inherit from this class to implement processing before and after events are hand...
Definition: YiEventFilter.h:24
Proxy for a CYIEventHandler allowing safe destruction of the internal event handler objects...
Definition: YiEventHandlerProxy.h:26