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