Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::EventQueue Class Reference

Public Member Functions

 EventQueue ()
 
void Add (Event *event)
 
EventGet ()
 
void RemoveEventsForIsolate (Dart_Isolate isolate)
 

Detailed Description

Definition at line 100 of file custom_isolate_test.cc.

Constructor & Destructor Documentation

◆ EventQueue()

dart::EventQueue::EventQueue ( )
inline

Definition at line 102 of file custom_isolate_test.cc.

102{ head_ = nullptr; }

Member Function Documentation

◆ Add()

void dart::EventQueue::Add ( Event event)
inline

Definition at line 104 of file custom_isolate_test.cc.

104 {
105 if (head_ == nullptr) {
106 head_ = event;
107 tail_ = event;
108 } else {
109 tail_->next_ = event;
110 tail_ = event;
111 }
112 }
FlKeyEvent * event

◆ Get()

Event * dart::EventQueue::Get ( )
inline

Definition at line 114 of file custom_isolate_test.cc.

114 {
115 if (head_ == nullptr) {
116 return nullptr;
117 }
118 Event* tmp = head_;
119 head_ = head_->next_;
120 if (head_ == nullptr) {
121 // Not necessary, but why not.
122 tail_ = nullptr;
123 }
124
125 return tmp;
126 }
Definition: dart.idl:641

◆ RemoveEventsForIsolate()

void dart::EventQueue::RemoveEventsForIsolate ( Dart_Isolate  isolate)
inline

Definition at line 128 of file custom_isolate_test.cc.

128 {
129 Event* cur = head_;
130 Event* prev = nullptr;
131 while (cur != nullptr) {
132 Event* next = cur->next_;
133 if (cur->isolate() == isolate) {
134 // Remove matching event.
135 if (prev != nullptr) {
136 prev->next_ = next;
137 } else {
138 head_ = next;
139 }
140 delete cur;
141 } else {
142 // Advance.
143 prev = cur;
144 }
145 cur = next;
146 }
147 tail_ = prev;
148 }
static float next(float f)
static float prev(float f)

The documentation for this class was generated from the following file: