Beispiel #1
0
bool overlaps(const ListType& src,
    const typename ListType::FragmentType& match)
{
    typename ListType::ConstIteratorPair matchPair
        = src.overlappingRange( match );
    return matchPair.first != matchPair.second;
}    
Beispiel #2
0
bool hasPosition(const ListType& src, typename ListType::FSizeType pos)
{
    typename ListType::ConstIteratorPair match = src.overlappingRange(
        typename ListType::FragmentType( pos, pos + 1,
        typename ListType::PayloadType() ) );
    return match.first != match.second;
}
Beispiel #3
0
bool overlaps(const ListType& src, const ListType& match)
{
    for( typename ListType::ConstIterator matchIterator = match.begin();
        matchIterator != match.end(); ++matchIterator )
    {
        typename ListType::ConstIteratorPair matchPair
            = src.overlappingRange( *matchIterator );
        if( matchPair.first != matchPair.second ) return true;
    }
    return false;
}
Beispiel #4
0
typename ListType::FSizeType
overlappingSum(const ListType& src,
    const typename ListType::FragmentType& match)
{
    typename ListType::ConstIteratorPair matchIterators
        = src.overlappingRange( match );
    typename ListType::FSizeType result = 0;
    for( ; matchIterators.first != matchIterators.second;
        ++matchIterators.first )
    {
        result += ::std::min( matchIterators.first->end(), match.end() )
            -  ::std::max( matchIterators.first->begin(), match.begin() );
    }
    return result;
}