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


C++ LLSegment::isOnChannel方法代码示例

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


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

示例1: operator

void LLChangeChannel::operator()(LLSegment& segment)
{
    if(segment.isOnChannel(mIs))
    {
        segment.setChannel(mBecomes);
    }
}
开发者ID:Tjarko-Holtjer,项目名称:rainbow,代码行数:7,代码来源:llioutil.cpp

示例2: setChannel

	void buffer_object_t::test<2>()
	{
		LLSegment segment;
		ensure("LLSegment get functions failed", (0 == segment.getChannel() && NULL == segment.data() && 0 == segment.size()));
		segment.setChannel(50);
		ensure_equals("LLSegment setChannel() function failed", segment.getChannel(), 50);
		ensure("LLSegment isOnChannel() function failed", (TRUE == segment.isOnChannel(50)));
	}	
开发者ID:9skunks,项目名称:imprudence,代码行数:8,代码来源:llbuffer_tut.cpp

示例3: underflow

// virtual
int LLBufferStreamBuf::underflow()
{
	LLMemType m1(LLMemType::MTYPE_IO_BUFFER);
	//lldebugs << "LLBufferStreamBuf::underflow()" << llendl;
	if(!mBuffer)
	{
		return EOF;
	}

	LLMutexLock lock(mBuffer->getMutex());
	LLBufferArray::segment_iterator_t iter;
	LLBufferArray::segment_iterator_t end = mBuffer->endSegment();
	U8* last_pos = (U8*)gptr();
	LLSegment segment;
	if(last_pos)
	{
		// Back up into a piece of memory we know that we have
		// allocated so that calls for the next segment based on
		// 'after' will succeed.
		--last_pos;
		iter = mBuffer->splitAfter(last_pos);
		if(iter != end)
		{
			// We need to clear the read segment just in case we have
			// an early exit in the function and never collect the
			// next segment. Calling eraseSegment() with the same
			// segment twice is just like double deleting -- nothing
			// good comes from it.
			mBuffer->eraseSegment(iter++);
			if(iter != end) segment = (*iter);
		}
		else
		{
			// This should never really happen, but somehow, the
			// istream is telling the buf that it just finished
			// reading memory that is not in the buf. I think this
			// would only happen if there were a bug in the c++ stream
			// class. Just bail.
			// *TODO: can we set the fail bit on the stream somehow?
			return EOF;
		}
	}
	else
	{
		// Get iterator to full segment containing last_pos
		// and construct sub-segment starting at last_pos.
		// Note: segment may != *it at this point
		iter = mBuffer->constructSegmentAfter(last_pos, segment);
	}
	if(iter == end)
	{
		return EOF;
	}

	// Iterate through segments to find a non-empty segment on input channel.
	while((!segment.isOnChannel(mChannels.in()) || (segment.size() == 0)))
	{
		++iter;
		if(iter == end)
		{
			return EOF;
		}

		segment = *(iter);
	}

	// set up the stream to read from the next segment.
	char* start = (char*)segment.data();
	setg(start, start, start + segment.size());
	return *gptr();
}
开发者ID:IamusNavarathna,项目名称:SingularityViewer,代码行数:72,代码来源:llbufferstream.cpp


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