当前位置: 首页>>代码示例>>C++>>正文


C++ Sequence::get方法代码示例

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


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

示例1: waitFor

	long waitFor(long sequence, const Sequence& cursor,
			const SequenceGroup& dependent,
			const AlertableBarrier& barrier) {

		long availableSequence;

		if ((availableSequence = cursor.get()) < sequence) {
			std::unique_lock<std::mutex> ulock(m_mutex);

			while ((availableSequence = cursor.get()) < sequence) {
				barrier.checkAlert();
				std::cv_status status =
						m_condition.wait_for(ulock, std::chrono::microseconds(m_timeout_micros));
				if (status == std::cv_status::timeout) {
					break;
				}

			}

		}

		if (!dependent.isEmpty()) {
			while ((availableSequence = dependent.get()) < sequence) {
				barrier.checkAlert();
			}
		}

		return availableSequence;
	}
开发者ID:reiver-dev,项目名称:disruptorcpp,代码行数:29,代码来源:timeout_blocking_wait_strategy.hpp

示例2: test

void test()
{
	Sequence s;
	assert(s.insert(0, 10));
	assert(s.insert(0, 20));
	assert(s.size() == 2);
	ItemType x = 999;
	assert(s.get(0, x) && x == 20);
	assert(s.get(1, x) && x == 10);
}
开发者ID:DevilPandaKnight,项目名称:CS32,代码行数:10,代码来源:testSequence.cpp

示例3: size

    virtual bool operator==(const Sequence<T>& seq) const {
      index_t len = size();

      if (len != seq.size()) return false;

      for (index_t i = 0; i < len; ++i)
        if ( ! (this->get(i) == seq.get(i)) )
          return false;

      return true;
    }
开发者ID:jeffreyhunter77,项目名称:cpp-objects,代码行数:11,代码来源:StaticArray.hpp

示例4: getSummationSeq

Sequence* getSummationSeq(Sequence * seq)
{
	Sequence * res = new Sequence(seq->getLength());
	res->set(1, seq->get(1));
	for(int i = 2; i <= res->getLength(); i++)
	{
		res->set(i, res->get(i-1) + seq->get(i));
	}

	return res;
}
开发者ID:kalngyk,项目名称:codes,代码行数:11,代码来源:AlcsRmsdSolver.cpp

示例5: waitFor

	long waitFor(const long& sequence, const Sequence& cursor,
			const SequenceGroup& dependents, const AlertableBarrier& barrier) {
		long available_sequence = 0;
		if (dependents.isEmpty()) {
			while ((available_sequence = cursor.get()) < sequence) {
				barrier.checkAlert();
			}
		} else {
			while ((available_sequence = dependents.get()) < sequence) {
				barrier.checkAlert();
			}
		}
		return available_sequence;
	}
开发者ID:reiver-dev,项目名称:disruptorcpp,代码行数:14,代码来源:busyspin_wait_strategy.hpp

示例6: operator

  void operator()() {
    sequenceBarrier_.waitFor(0L);

    sequence_.set(sequence_.get() + 1L);
  }
开发者ID:lclark,项目名称:varont,代码行数:5,代码来源:RingBufferTest.cpp


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