You.i Engine
YiEventDispatcherThread.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_EVENT_DISPATCHER_THREAD_H
3 #define _YI_EVENT_DISPATCHER_THREAD_H
4 
5 #include "thread/YiThread.h"
6 
7 #include <memory>
8 
10 
17 {
18 public:
19  CYIEventDispatcherThread(const CYIString &name = CYIString(), YI_PRIORITY ePriority = YI_PRIORITY_DEFAULT, uint32_t uStackSize = DEFAULT_STACK_SIZE);
20  virtual ~CYIEventDispatcherThread();
21 
22  void Exit(bool bJoin = false);
23 
24  const std::shared_ptr<CYIEventDispatcher> &GetEventDispatcher() const;
25 
26 protected:
27 
28  virtual void OnThreadStarted(CYIThread *pPublisher) override;
29  virtual void Run() override;
30  virtual void OnThreadTerminated(CYIThread *pPublisher) override;
31 
32  std::shared_ptr<CYIEventDispatcher> m_pEventDispatcher;
33 };
34 
39 inline const std::shared_ptr<CYIEventDispatcher> &CYIEventDispatcherThread::GetEventDispatcher() const
40 {
41  return m_pEventDispatcher;
42 }
43 
44 #endif // _YI_EVENT_DISPATCHER_THREAD_H
void Exit(bool bJoin=false)
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:35
static const uint32_t DEFAULT_STACK_SIZE
Definition: YiThread.h:91
YI_PRIORITY
Definition: YiThread.h:14
Definition: YiThread.h:24
virtual void Run() override
Definition: YiEventDispatcherThread.h:16
virtual void OnThreadTerminated(CYIThread *pPublisher) override
std::shared_ptr< CYIEventDispatcher > m_pEventDispatcher
Definition: YiEventDispatcherThread.h:32
virtual ~CYIEventDispatcherThread()
virtual void OnThreadStarted(CYIThread *pPublisher) override
Stores, queues and dispatches events as well as sending notifications to IYIEventDispatcherListener o...
Definition: YiEventDispatcher.h:65
CYIEventDispatcherThread(const CYIString &name=CYIString(), YI_PRIORITY ePriority=YI_PRIORITY_DEFAULT, uint32_t uStackSize=DEFAULT_STACK_SIZE)
Definition: YiThread.h:104
Definition: YiThread.h:86
const std::shared_ptr< CYIEventDispatcher > & GetEventDispatcher() const
Definition: YiEventDispatcherThread.h:39