MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / dispatch

Method dispatch

Source/Input/TouchDispather.cpp:500–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498}
499
500void TouchDispatcher::dispatch() {
501 if (!_events.empty() && !_handlers.empty()) {
502 for (auto it = _handlers.rbegin(); it != _handlers.rend(); ++it) {
503 auto handler = it->lock();
504 for (auto eit = _events.begin(); eit != _events.end();) {
505 auto e = std::any_cast<SDL_Event>(&(*eit));
506 if (handler && handler->handle(*e)) {
507 eit = _events.erase(eit);
508 } else {
509 ++eit;
510 }
511 }
512 if (_events.empty()) {
513 break;
514 }
515 }
516 }
517 clearHandlers();
518}
519
520void TouchDispatcher::clearHandlers() {
521 _handlers.clear();

Callers 1

handleTouchEventsMethod · 0.45

Calls 8

emptyMethod · 0.45
rbeginMethod · 0.45
rendMethod · 0.45
lockMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
handleMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected