MCPcopy Create free account
hub / github.com/axmolengine/axmol / isScheduled

Method isScheduled

core/base/Scheduler.cpp:444–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444bool Scheduler::isScheduled(std::string_view key, const void* target) const
445{
446 AXASSERT(!key.empty(), "Argument key must not be empty");
447 AXASSERT(target, "Argument target must be non-nullptr");
448
449 auto timerIt = _timersMap.find(const_cast<void*>(target));
450
451 if (timerIt == _timersMap.end())
452 return false;
453
454 auto&& timers = timerIt->second.timers;
455 const bool found = !timers.empty() && std::find_if(timers.begin(), timers.end(), [&key](Timer* const itimer) {
456 auto timer = dynamic_cast<TimerTargetCallback*>(itimer);
457 return (timer && !timer->isExhausted() && key == timer->getKey());
458 }) != timers.end();
459
460 return found;
461}
462
463void Scheduler::unscheduleUpdate(void* target)
464{

Callers

nothing calls this directly

Calls 5

isExhaustedMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected