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


C++ Kmer::dump方法代码示例

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


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

示例1: dump

int GraphPath::dump(char * buffer) const {
	int position = 0;

	uint32_t elements = size();

	int operationSize = sizeof(uint32_t);
	memcpy(buffer + position, &elements, operationSize);
	position += operationSize;

	uint32_t kmerLength = getKmerLength();

#ifdef CONFIG_ASSERT
	assert(kmerLength > 0);
#endif

	memcpy(buffer + position, &kmerLength, operationSize);
	position += operationSize;

	//cout << "[DEBUG] GraphPath::dump kmerLength " << kmerLength << endl;

	for(int i = 0 ; i < (int)elements ; i ++) {
		Kmer value;
		at(i, &value);
		position += value.dump(buffer + position);
	}

	return position;
}
开发者ID:fredericraymond,项目名称:ray,代码行数:28,代码来源:GraphPath.cpp

示例2: sendKmersSamples

void StoreKeeper::sendKmersSamples() {

	char buffer[MAXIMUM_MESSAGE_SIZE_IN_BYTES];
	int bytes = 0;

	ExperimentVertex * currentVertex = NULL;
	VirtualKmerColorHandle currentVirtualColor = NULL_VIRTUAL_COLOR;

	vector<bool> samplesVector (m_sampleSize, false);

	if(m_hashTableIterator.hasNext()){

		currentVertex = m_hashTableIterator.next();
		Kmer kmer = currentVertex->getKey();

		bytes += kmer.dump(buffer);

		currentVirtualColor = currentVertex->getVirtualColor();
		set<PhysicalKmerColor> * samples = m_colorSet.getPhysicalColors(currentVirtualColor);

		for(set<PhysicalKmerColor>:: iterator sampleIterator = samples->begin();
			sampleIterator != samples->end(); ++sampleIterator) {
			PhysicalKmerColor value = *sampleIterator;
			samplesVector[value] = true;
		}

		for (std::vector<bool>::iterator it = samplesVector.begin();
			it != samplesVector.end(); ++it) {
			buffer[bytes] = *it;
			bytes++;
		}
	}


	Message message;
	message.setNumberOfBytes(bytes);
	message.setBuffer(buffer);

	if(m_hashTableIterator.hasNext()){
		message.setTag(KmerMatrixOwner::PUSH_KMER_SAMPLES);
	}else{
		message.setTag(KmerMatrixOwner::PUSH_KMER_SAMPLES_END);
	}

	send(m_kmerMatrixOwner, message);

}
开发者ID:fredericraymond,项目名称:ray,代码行数:47,代码来源:StoreKeeper.cpp


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