1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | #pragma once
|
8 |
|
9 | #include <memory>
|
10 |
|
11 | #include <react/events/EventBeat.h>
|
12 | #include <react/events/EventQueue.h>
|
13 | #include <react/events/RawEvent.h>
|
14 | #include <react/events/primitives.h>
|
15 |
|
16 | namespace facebook {
|
17 | namespace react {
|
18 |
|
19 | class EventDispatcher;
|
20 | using SharedEventDispatcher = std::shared_ptr<const EventDispatcher>;
|
21 | using WeakEventDispatcher = std::weak_ptr<const EventDispatcher>;
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | class EventDispatcher {
|
28 | public:
|
29 | EventDispatcher(
|
30 | const EventPipe &eventPipe,
|
31 | const EventBeatFactory &synchonousEventBeatFactory,
|
32 | const EventBeatFactory &asynchonousEventBeatFactory);
|
33 |
|
34 | |
35 |
|
36 |
|
37 | void dispatchEvent(const RawEvent &rawEvent, EventPriority priority) const;
|
38 |
|
39 | private:
|
40 | std::array<std::unique_ptr<EventQueue>, 4> eventQueues_;
|
41 | };
|
42 |
|
43 | }
|
44 | }
|