本文整理汇总了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);
}
}
示例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)));
}
示例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();
}