Class IntervalTree::Node
Defined in File interval-tree.h
Nested Relationships
This class is a nested type of Template Class IntervalTree.
Class Documentation
-
class Node
Used to track Interval<>s stored in an IntervalTree<>
Public Functions
-
inline Node() = default
Construcst an instance of Node.
-
inline ~Node()
Destroys this instance of Node.
Public Members
-
ValueType mValue = {}
This Node's ValueType value.
-
EndPointType mMax = {0}
This Node's subtree's maximum end point value.
-
int mBalance = {0}
A value indicating this Node's balance factor.
Public Static Functions
-
template<typename EnumerationFunctionType>
static inline void EnumerateOverlappingIntervals(Node const *node, Interval<EndPointType> const &interval, EnumerationFunctionType enumerationFunction) Recursivley enumerates all Interval<>s that overlap a given Interval<> under a given Node, 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<>
node -- [in] A pointer to the Node under which to search recursively for overlapping Interval<>s
interval -- [in] The Interval<> to find overlapping Interval<>s for
enumerationFunction -- [in] The function to call for each overlapping Interval<>
-
static inline Node *Add(Node *node, Interval<EndPointType> const &interval, bool &added, Node **itr)
Adds or finds a given Interval<> under a given Node.
- Parameters
node -- [in] The Node to add or find the given Interval<> under
interval -- [in] The Interval<> to add or find
added -- [in] Whether or not a new Node has been added
itr -- [out] A pointer to a pointer to the added or found Node
-
static inline void ComputeMax(Node *node)
Computes the max end point value for the subtree at a given Node.
- Parameters
node -- [in] A pointer to the Node to compute the max end point value for
-
inline Node() = default