本文整理汇总了C++中Timers::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ Timers::empty方法的具体用法?C++ Timers::empty怎么用?C++ Timers::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timers
的用法示例。
在下文中一共展示了Timers::empty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pollTimers
void Timer::pollTimers()
{
assert_ui_thread();
// Generate messages for timers
if (running_timers != 0) {
ASSERT(!timers.empty());
base::tick_t t = base::current_tick();
for (auto timer : timers) {
if (timer && timer->isRunning()) {
int64_t count = ((t - timer->m_lastTick) / timer->m_interval);
if (count > 0) {
timer->m_lastTick += count * timer->m_interval;
ASSERT(timer->m_owner != nullptr);
Message* msg = new TimerMessage(count, timer);
msg->setRecipient(timer->m_owner);
Manager::getDefault()->enqueueMessage(msg);
}
}
}
}
}
示例2: pollTimers
void Timer::pollTimers()
{
// Generate messages for timers
if (!timers.empty()) {
int t = ji_clock;
int count;
for (Timers::iterator it=timers.begin(), end=timers.end(); it != end; ++it) {
Timer* timer = *it;
if (timer && timer->m_lastTime >= 0) {
count = 0;
while (t - timer->m_lastTime > timer->m_interval) {
timer->m_lastTime += timer->m_interval;
++count;
/* we spend too much time here */
if (ji_clock - t > timer->m_interval) {
timer->m_lastTime = ji_clock;
break;
}
}
if (count > 0) {
ASSERT(timer->m_owner != NULL);
Message* msg = new TimerMessage(count, timer);
msg->addRecipient(timer->m_owner);
Manager::getDefault()->enqueueMessage(msg);
}
}
}
}
}
示例3: haveTimers
bool Timer::haveTimers()
{
return !timers.empty();
}
示例4: checkNoTimers
void Timer::checkNoTimers()
{
ASSERT(timers.empty());
}