本文整理汇总了C++中ArrayQueue::front方法的典型用法代码示例。如果您正苦于以下问题:C++ ArrayQueue::front方法的具体用法?C++ ArrayQueue::front怎么用?C++ ArrayQueue::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayQueue
的用法示例。
在下文中一共展示了ArrayQueue::front方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: completeEvent
/**
* Signal the completion of an event. The value passed to this
* method must be the same as the return value previously obtained
* from the startEvent method. This method will signal the
* completion of all pending barriers that were completed by the
* completion of this event.
*
* @param token opaque token identifying the completed event
**/
void completeEvent(uint32_t token) {
if (token == _token) {
--_count;
return;
}
--_queue.access(_queue.size() - (_token - token)).first;
while (!_queue.empty() && _queue.front().first == 0) {
_queue.front().second->completeBarrier();
_queue.pop();
}
}
示例2: print
void print(const ArrayQueue<T> & q)
{
cout << "capacity = " << q.capacity() << endl
<< "size = " << q.size() << endl;
for (int i = 0; i < q.size(); ++i)
cout << (T) q.front(i) << " ";
cout << endl ;
for (int i = 0; i < q.size(); ++i)
cout << (T) q.rear(i) << " ";
cout << endl
<< endl;
}