本文整理汇总了C++中op_queue类的典型用法代码示例。如果您正苦于以下问题:C++ op_queue类的具体用法?C++ op_queue怎么用?C++ op_queue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了op_queue类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: perform_operations_for_descriptors
void perform_operations_for_descriptors(
const Descriptor_Set& descriptors, op_queue<operation>& ops)
{
typename operations_map::iterator i = operations_.begin();
while (i != operations_.end())
{
typename operations_map::iterator op_iter = i++;
if (descriptors.is_set(op_iter->first))
{
while (reactor_op* op = op_iter->second.op_queue_.front())
{
if (op->perform())
{
op_iter->second.op_queue_.pop();
ops.push(op);
}
else
{
break;
}
}
if (op_iter->second.op_queue_.empty())
operations_.erase(op_iter);
}
}
}
开发者ID:batmancn,项目名称:MyLife,代码行数:27,代码来源:reactor_op_queue.hpp
示例2: get_all_operations
// Get all operations owned by the queue.
void get_all_operations(op_queue<operation>& ops)
{
typename operations_map::iterator i = operations_.begin();
while (i != operations_.end())
{
typename operations_map::iterator op_iter = i++;
ops.push(op_iter->second.op_queue_);
operations_.erase(op_iter);
}
}
开发者ID:batmancn,项目名称:MyLife,代码行数:11,代码来源:reactor_op_queue.hpp
示例3: get_ready_timers
// Dequeue all timers not later than the current time.
virtual void get_ready_timers(op_queue<operation>& ops)
{
const time_type now = Time_Traits::now();
while (!heap_.empty() && !Time_Traits::less_than(now, heap_[0].time_))
{
per_timer_data* timer = heap_[0].timer_;
ops.push(timer->op_queue_);
remove_timer(*timer);
}
}
开发者ID:Almamu,项目名称:evemu_crucible,代码行数:11,代码来源:timer_queue.hpp
示例4: get_all_timers
// Dequeue all timers.
virtual void get_all_timers(op_queue<operation>& ops)
{
while (timers_)
{
per_timer_data* timer = timers_;
timers_ = timers_->next_;
ops.push(timer->op_queue_);
timer->next_ = 0;
timer->prev_ = 0;
}
heap_.clear();
}
开发者ID:Dagarman,项目名称:mame,代码行数:14,代码来源:timer_queue.hpp
示例5: cancel_operations
// Cancel all operations associated with the descriptor identified by the
// supplied iterator. Any operations pending for the descriptor will be
// cancelled. Returns true if any operations were cancelled, in which case
// the reactor's event demultiplexing function may need to be interrupted and
// restarted.
bool cancel_operations(iterator i, op_queue<operation>& ops,
const boost::system::error_code& ec =
boost::asio::error::operation_aborted)
{
if (i != operations_.end())
{
while (reactor_op* op = i->second.front())
{
op->ec_ = ec;
i->second.pop();
ops.push(op);
}
operations_.erase(i);
return true;
}
return false;
}
开发者ID:BranchMetrics,项目名称:react-native-branch-deep-linking,代码行数:23,代码来源:reactor_op_queue.hpp
示例6: cancel_timer
// Cancel and dequeue operations for the given timer.
std::size_t cancel_timer(per_timer_data& timer, op_queue<operation>& ops,
std::size_t max_cancelled = (std::numeric_limits<std::size_t>::max)())
{
std::size_t num_cancelled = 0;
if (timer.prev_ != 0 || &timer == timers_)
{
while (wait_op* op = (num_cancelled != max_cancelled)
? timer.op_queue_.front() : 0)
{
op->ec_ = asio::error::operation_aborted;
timer.op_queue_.pop();
ops.push(op);
++num_cancelled;
}
if (timer.op_queue_.empty())
remove_timer(timer);
}
return num_cancelled;
}
开发者ID:Dagarman,项目名称:mame,代码行数:20,代码来源:timer_queue.hpp
示例7: cancel_operations
// Cancel all operations associated with the descriptor. Any operations
// pending for the descriptor will be notified that they have been cancelled
// next time perform_cancellations is called. Returns true if any operations
// were cancelled, in which case the reactor's event demultiplexing function
// may need to be interrupted and restarted.
bool cancel_operations(Descriptor descriptor, op_queue<operation>& ops,
const asio::error_code& ec =
asio::error::operation_aborted)
{
typename operations_map::iterator i = operations_.find(descriptor);
if (i != operations_.end())
{
while (reactor_op* op = i->second.op_queue_.front())
{
op->ec_ = ec;
i->second.op_queue_.pop();
ops.push(op);
}
operations_.erase(i);
return true;
}
return false;
}
开发者ID:batmancn,项目名称:MyLife,代码行数:24,代码来源:reactor_op_queue.hpp
示例8: perform_operations
// Perform the operations corresponding to the descriptor identified by the
// supplied iterator. Returns true if there are still unfinished operations
// queued for the descriptor.
bool perform_operations(iterator i, op_queue<operation>& ops)
{
if (i != operations_.end())
{
while (reactor_op* op = i->second.front())
{
if (op->perform())
{
i->second.pop();
ops.push(op);
}
else
{
return true;
}
}
operations_.erase(i);
}
return false;
}
开发者ID:BranchMetrics,项目名称:react-native-branch-deep-linking,代码行数:23,代码来源:reactor_op_queue.hpp
示例9: perform_operations
// Perform the operations corresponding to the descriptor. Returns true if
// there are still unfinished operations queued for the descriptor.
bool perform_operations(Descriptor descriptor, op_queue<operation>& ops)
{
typename operations_map::iterator i = operations_.find(descriptor);
if (i != operations_.end())
{
while (reactor_op* op = i->second.op_queue_.front())
{
if (op->perform())
{
i->second.op_queue_.pop();
ops.push(op);
}
else
{
return true;
}
}
operations_.erase(i);
}
return false;
}
开发者ID:batmancn,项目名称:MyLife,代码行数:23,代码来源:reactor_op_queue.hpp
注:本文中的op_queue类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论