• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ queue_type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中queue_type的典型用法代码示例。如果您正苦于以下问题:C++ queue_type类的具体用法?C++ queue_type怎么用?C++ queue_type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了queue_type类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: dump

	void dump() {
		queue_type::stored_ptr entry;
		while ((entry = queue.pop()) != nullptr)
			write_entry(std::move(entry));
	}
开发者ID:ssteinberg,项目名称:ste,代码行数:5,代码来源:log.hpp


示例2: reset_queue_entry

 reset_queue_entry(barrier_queue_entry& e, queue_type& q)
   : e_(e), q_(q), last_(q.last())
 {}
开发者ID:NOMORECOFFEE,项目名称:hpx,代码行数:3,代码来源:barrier.hpp


示例3: swap

 void swap(queue_type &q) {
   m_mutex.lock();
   q.swap(m_queue);
   m_mutex.unlock();
 }
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:5,代码来源:fiber_blocking_queue.hpp


示例4: fill

 void fill(size_t num)
 {
     for (size_t i = 0; i < m_max_priority; ++i)
         for (size_t j = 0; j < num; ++j)
             m_queue.push(i, j);
 }
开发者ID:hundeboll,项目名称:rlncd,代码行数:6,代码来源:test_queue.cpp


示例5: size

		std::size_t size(unsigned int timeout = 5) {
			boost::shared_lock<boost::shared_mutex> lock(mutex_, boost::get_system_time() + boost::posix_time::seconds(timeout));
			if (!lock || queue_.empty())
				return 0;
			return queue_.size();
		}
开发者ID:mickem,项目名称:nscp,代码行数:6,代码来源:queue.hpp


示例6: dequeue_

 void dequeue_( msg_type & msg)
 {
   msg = queue_.front();
   queue_.pop();
 }
开发者ID:maoy,项目名称:mosaic,代码行数:5,代码来源:queue.hpp


示例7: empty_

 bool empty_() const
 { return queue_.empty(); }
开发者ID:maoy,项目名称:mosaic,代码行数:2,代码来源:queue.hpp


示例8: size

	//! Returns the current number of nodes in the queue.
	size_type size() const { return m_queue.size(); }
开发者ID:tsnorri-helsinki-fi,项目名称:sdsl-lite,代码行数:2,代码来源:cst_iterators.hpp


示例9: size

 std::size_t size() const{
   return queue_.size();
 }
开发者ID:maoy,项目名称:mosaic,代码行数:3,代码来源:queue.hpp


示例10: dequeue

 bool dequeue(T& value) {
     return m_queue.pop(value);
 }
开发者ID:erlanger,项目名称:eixx,代码行数:3,代码来源:async_queue.hpp


示例11: empty

 //! Returns true if the queue is empty
 inline bool empty() { 
   m_mutex.lock();
   bool res = m_queue.empty();
   m_mutex.unlock();
   return res;
 }
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:7,代码来源:fiber_blocking_queue.hpp


示例12: finish

  static inline void
  finish (bool output_fired,
	  bd_t bda,
	  bd_t bdb)
  {
    if (action_.automaton.get () != 0) {
      // We were executing an action of this automaton.

      switch (action_.action->type) {
      case INPUT:
	// We were executing an input.  Move to the next input.
	++input_action_pos_;
	proceed_to_input ();
	// -EEE
	input_action_list_.front ()->output_action.automaton->unlock_execution ();
	finish_output ();
	break;
      case OUTPUT:
	// We were executing an output ...
	if (output_fired) {
	  // ... and the output output did something.
	  output_buffer_a_ = action_.automaton->lookup_buffer (bda);
	  // Synchronize the buffers.
	  if (output_buffer_a_.get () != 0) {
	    output_buffer_a_->sync (0, output_buffer_a_->size ());
	  }
	  output_buffer_b_ = action_.automaton->lookup_buffer (bdb);
	  if (output_buffer_b_.get () != 0) {
	    output_buffer_b_->sync (0, output_buffer_b_->size ());
	  }
	  // Proceed to execute the inputs.
	  input_action_pos_ = input_action_list_.begin ();
	  // This does not return if there are inputs.
	  proceed_to_input ();
	}
	// No input actions to execute.
	// -EEE
	action_.automaton->unlock_execution ();
	finish_output ();
	break;
      case INTERNAL:
      case SYSTEM:
	// -EEE
	action_.automaton->unlock_execution ();
	break;
      }
    }

    // We are done with the current action.
    action_.automaton = shared_ptr<automaton> ();

    for (;;) {

      irq_handler::process_interrupts ();

      while (!ready_queue_.empty ()) {
	// Get the automaton context and remove it from the ready queue.
	automaton_context* c = ready_queue_.front ();
	ready_queue_.pop_front ();

	// Load the action.
	action_ = c->front ();
	c->pop_front ();

	// The automaton exists.  Continue loading and execute.
	switch (action_.action->type) {
	case INPUT:
	  // Error.  Not a local action.
	  kpanic ("Non-local action on execution queue");
	  break;
	case OUTPUT:
	  {
	    kassert (input_action_list_.empty ());
	    // Copy the bindings.
	    action_.automaton->copy_bound_inputs (action_, back_inserter (input_action_list_));
	    
	    // Sort the bindings by input automaton.
	    sort (input_action_list_.begin (), input_action_list_.end (), sort_bindings_by_input ());
	    
	    // We lock the automata in order.  This is called Havender's Principle.
	    bool output_locked = false;
	    for (input_action_list_type::const_iterator pos = input_action_list_.begin ();
		 pos != input_action_list_.end ();
		 ++pos) {
	      shared_ptr<automaton> input_automaton = (*pos)->input_action.automaton;
	      if (!output_locked && action_.automaton->aid () < input_automaton->aid ()) {
		// +EEE
		action_.automaton->lock_execution ();
		output_locked = true;
	      }
	      // +FFF
	      input_automaton->lock_execution ();
	    }
	    if (!output_locked) {
	      // +EEE
	      action_.automaton->lock_execution ();
	      output_locked = true;
	    }
	    
	    input_action_pos_ = input_action_list_.begin ();
//.........这里部分代码省略.........
开发者ID:jrwilson,项目名称:Lily,代码行数:101,代码来源:global_fifo_scheduler.hpp


示例13: reset

    void reset() {
        cancel();

        T value;
        while (m_queue.pop(value));
    }
开发者ID:erlanger,项目名称:eixx,代码行数:6,代码来源:async_queue.hpp


示例14: clear

 void clear()
 {
     m_queue.clear();
 }
开发者ID:hundeboll,项目名称:rlncd,代码行数:4,代码来源:test_queue.cpp


示例15: empty_unsafe

 bool empty_unsafe() {
   return m_queue.empty();
 }
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:3,代码来源:fiber_blocking_queue.hpp


示例16: outgoing_not_empty

 /// Check if there is any data in the outgoing_queue to be sent over the socket
 bool outgoing_not_empty() const { return !m_outgoing_queue.empty(); }
开发者ID:ThomasSchaeferMS,项目名称:Obbligato,代码行数:2,代码来源:Net_QueuedSocket.hpp


示例17: outgoing_not_full

 /// Check if there is any space in the outgoing_queue
 bool outgoing_not_full() const { return !m_outgoing_queue.full(); }
开发者ID:ThomasSchaeferMS,项目名称:Obbligato,代码行数:2,代码来源:Net_QueuedSocket.hpp


示例18: size

 //! get the current size of the queue
 inline size_t size() {
   return m_queue.size();
 }
开发者ID:Bhushan1002,项目名称:SFrame,代码行数:4,代码来源:fiber_blocking_queue.hpp


示例19: incoming_not_empty

 /// Check if there is any data in the incoming_queue
 bool incoming_not_empty() const { return !m_incoming_queue.empty(); }
开发者ID:ThomasSchaeferMS,项目名称:Obbligato,代码行数:2,代码来源:Net_QueuedSocket.hpp


示例20:

	//! Method for dereferencing the iterator.
	const_reference operator*() const { return m_queue.front(); }
开发者ID:tsnorri-helsinki-fi,项目名称:sdsl-lite,代码行数:2,代码来源:cst_iterators.hpp



注:本文中的queue_type类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ qvector类代码示例发布时间:2022-05-31
下一篇:
C++ queue类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap