You.i Engine
YiEventDispatcherThread.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. 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:
20  virtual ~CYIEventDispatcherThread();
21 
22  void Exit(bool join = false);
23 
24  const std::shared_ptr<CYIEventDispatcher> &GetEventDispatcher() const;
25 
26 protected:
27  virtual void OnThreadStarted(CYIThread *pPublisher) override;
28  virtual void Run() override;
29  virtual void OnThreadTerminated(CYIThread *pPublisher) override;
30 
31  std::shared_ptr<CYIEventDispatcher> m_pEventDispatcher;
32 };
33 
38 inline const std::shared_ptr<CYIEventDispatcher> &CYIEventDispatcherThread::GetEventDispatcher() const
39 {
40  return m_pEventDispatcher;
41 }
42 
43 #endif // _YI_EVENT_DISPATCHER_THREAD_H
static const size_t DEFAULT_STACK_SIZE
Definition: YiThread.h:76
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
const std::shared_ptr< CYIEventDispatcher > & GetEventDispatcher() const
Definition: YiEventDispatcherThread.h:38
virtual void Run() override
Definition: YiEventDispatcherThread.h:16
CYIEventDispatcherThread(const CYIString &name=CYIString(), CYIThread::Priority priority=CYIThread::Priority::Default, size_t stackSize=DEFAULT_STACK_SIZE)
virtual void OnThreadTerminated(CYIThread *pPublisher) override
std::shared_ptr< CYIEventDispatcher > m_pEventDispatcher
Definition: YiEventDispatcherThread.h:31
Priority
Definition: YiThread.h:78
virtual ~CYIEventDispatcherThread()
virtual void OnThreadStarted(CYIThread *pPublisher) override
Stores, queues and dispatches events as well as sending notifications to IYIEventDispatcherListener o...
Definition: YiEventDispatcher.h:66
Definition: YiThread.h:102
Definition: YiThread.h:71
void Exit(bool join=false)