Ejemplo n.º 1
0
bool overlaps(const ListType& src,
    const typename ListType::FragmentType& match)
{
    typename ListType::ConstIteratorPair matchPair
        = src.overlappingRange( match );
    return matchPair.first != matchPair.second;
}    
Ejemplo n.º 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;
}
Ejemplo n.º 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;
}
Ejemplo n.º 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;
}