Template Class IntervalTree

Nested Relationships

Nested Types

Class Documentation

template<typename EndPointType, typename ValueType>
class IntervalTree

A sorted associative container of Intervals<> that provides enumeration over all Intervals<> that overlap a given interval.

Param <EndPointType>

The type of Interval<> end point

Param <ValueType>

The type of value to associate with each Interval<>

Public Functions

inline IntervalTree() = default
Parameters

Constructs -- an instance of IntervalTree<>

inline IntervalTree(IntervalTree<EndPointType, ValueType> &&other)

Moves an instance of IntervalTree<>

Parameters

other -- [in] The IntervalTree<> to move from

inline IntervalTree<EndPointType, ValueType> &operator=(IntervalTree<EndPointType, ValueType> &&other)

Moves an instance of IntervalTree<>

Parameters

other -- [in] The IntervalTree<> to move from

Returns

This IntervalTree<> after being moved to

inline ~IntervalTree()
Parameters

Destroys -- this instance of IntervalTree<>

inline ValueType &operator[](EndPointType const &point)

Gets a reference to the value associated with a given EndPointType, performing an insertion if the given EndPointType does not already exist.

Parameters

point -- [in] The EndPointType of the value to find

Returns

A reference to the value associated with the given EndPointType

inline ValueType &operator[](Interval<EndPointType> const &interval)

Gets a reference to the value associated with a given Interval<>, performing an insertion if the given Interval<> does not already exist.

Parameters

interval -- [in] The Interval<> of the value to find

Returns

A reference to the value associated with the given Interval<>

template<typename EnumerationFunctionType>
inline void EnumerateOverlappingIntervals(EndPointType point, EnumerationFunctionType enumerationFunction) const

Enumerates all Interval<>s that overlap a given EndPointType, calling a given enumeration function for each.

Note

This function must have a signature compatible with void(Interval<EndPointType>, ValueType)

Parameters
  • <EnumerationFunctionType> -- The type of function to call for each overlapping Interval<>

  • point -- [in] The EndPointType to find overlapping intervals for

  • enumerationFunction -- [in] The function to call for each overlapping Interval<>

template<typename EnumerationFunctionType>
inline void EnumerateOverlappingIntervals(Interval<EndPointType> const &interval, EnumerationFunctionType enumerationFunction) const

Enumerates all Interval<>s that overlap a given Interval<>, calling a given enumeration function for each.

Note

This function must have a signature compatible with void(Interval<EndPointType>, ValueType)

Parameters
  • <EnumerationFunctionType> -- The type of function to call for each overlapping Interval<>

  • interval -- [in] The Interval<> to find overlapping intervals for

  • enumerationFunction -- [in] The function to call for each overlapping Interval<>