cgatools::util::RangeIntersector< TRange, TValue, Overlap, Less > Class Template Reference

Class that maintains a mapping from key -> value, where the key is a type with range semantics, for the purpose of finding the intersection of a range to a set of ranges. More...

#include <RangeIntersector.hpp>

List of all members.

Public Types

typedef std::map< TRange,
TValue, Less > 
MapType

Public Member Functions

 RangeIntersector (const Overlap &overlap=Overlap(), const Less &less=Less())
 Construct RangeIntersector.
void put (const TRange &range, const TValue &value)
 Add a range to the set of ranges.
void intersect (const TRange &range, std::vector< typename MapType::const_iterator > &result) const
 Find the intersection of the given range with all the ranges in the set.
bool intersects (const TRange &range) const
 Returns true iff the given range intersects the set of ranges in this RangeIntersector.
size_t getTreeCount () const
 Debugging function to find out how many trees were required for this RangeIntersector.

Detailed Description

template<class TRange, class TValue, class Overlap, class Less = std::less<TRange>>
class cgatools::util::RangeIntersector< TRange, TValue, Overlap, Less >

Class that maintains a mapping from key -> value, where the key is a type with range semantics, for the purpose of finding the intersection of a range to a set of ranges.

The class requires the key have an overlap operator defined, and a less than operator defined, such that:


Member Function Documentation

template<class TRange, class TValue, class Overlap, class Less = std::less<TRange>>
size_t cgatools::util::RangeIntersector< TRange, TValue, Overlap, Less >::getTreeCount (  )  const [inline]

Debugging function to find out how many trees were required for this RangeIntersector.

Generally, the more trees, the more expensive lookups are.

template<class TRange, class TValue, class Overlap, class Less = std::less<TRange>>
void cgatools::util::RangeIntersector< TRange, TValue, Overlap, Less >::intersect ( const TRange &  range,
std::vector< typename MapType::const_iterator > &  result 
) const [inline]

Find the intersection of the given range with all the ranges in the set.

template<class TRange, class TValue, class Overlap, class Less = std::less<TRange>>
bool cgatools::util::RangeIntersector< TRange, TValue, Overlap, Less >::intersects ( const TRange &  range  )  const [inline]

Returns true iff the given range intersects the set of ranges in this RangeIntersector.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated by  doxygen 1.6.2