本文整理汇总了C++中EventQueue::pop_front方法的典型用法代码示例。如果您正苦于以下问题:C++ EventQueue::pop_front方法的具体用法?C++ EventQueue::pop_front怎么用?C++ EventQueue::pop_front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EventQueue
的用法示例。
在下文中一共展示了EventQueue::pop_front方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processQueue
void InputService::processQueue(EventQueue& queue)
{
// Send events which are piled on queue so far
size_t numEvents = queue.size(); // TODO: Do we have to limit by numEvents?
while (!queue.empty())
{
EventEntry& e = queue.front();
EventId id = e.eventID;
Ref<InputEvent> evt = e.event;
queue.pop_front();
if (evt && evt->isConsumed())
continue;
EventChannel* channel = e.channel;
if (channel)
{
// If channel specified on post : Send to that channel
channel->send(id, evt);
continue;
}
// When channel not specified: broadcast upward from source channel
if (evt == NULL)
continue; // Can't handle event with no channel specified.
// 1. Broadcast to source channel
Ref<InputSource> source = evt->getSource();
if (source && source->hasChannel())
{
source->channel()->send(id, evt);
if (evt->isConsumed() || !evt->isUplinking())
continue;
}
// 2. Broadcast to device channel
Weak<InputDevice> device = evt->getDevice();
if (device && device->hasChannel())
{
device->channel()->send(id, evt);
if (evt->isConsumed() || !evt->isUplinking())
continue;
}
// 3. Broadcast to user channel
Ref<InputUser> user = evt->getUser();
if (user && user->hasChannel())
{
user->channel()->send(id, evt);
if (evt->isConsumed() || !evt->isUplinking())
continue;
}
// TODO: 4. Broadcast to service channel?
}
}