1 #ifndef INTERVALTREE_HPP 2 #define INTERVALTREE_HPP 11 namespace intervaltree_internal {
12 template <
class Node,
class INB,
class NodeTraits,
bool skipfirst,
14 Node * find_next_overlapping(Node * cur,
const Comparable & q);
16 template <
class KeyType>
22 template <
class Node,
class NodeTraits>
25 template <
class T1,
class T2>
26 bool operator()(
const T1 & lhs,
const T2 & rhs)
const;
30 template <
class Node,
class INB,
class NodeTraits>
34 template <
class BaseTree>
35 static void leaf_inserted(Node & node, BaseTree & t);
37 static void fix_node(Node & node);
38 template <
class BaseTree>
39 static void rotated_left(Node & node, BaseTree & t);
40 template <
class BaseTree>
41 static void rotated_right(Node & node, BaseTree & t);
42 template <
class BaseTree>
43 static void deleted_below(Node & node, BaseTree & t);
44 template <
class BaseTree>
46 delete_leaf(Node & node, BaseTree & t)
51 template <
class BaseTree>
52 static void swapped(Node & n1, Node & n2, BaseTree & t);
55 static typename NodeTraits::key_type get_lower(
58 static typename NodeTraits::key_type get_upper(
64 template <
class Node,
class NodeTraits,
class Options = DefaultOptions,
68 typename NodeTraits::key_type _it_max_upper;
96 static key_type get_lower(
const Node & n) =
delete;
105 static key_type get_upper(
const Node & n) =
delete;
123 template <
class Node,
class NodeTraits,
class Options = DefaultOptions,
128 intervaltree_internal::ExtendedNodeTraits<
129 Node, ITreeNodeBase<Node, NodeTraits, Options, Tag>, NodeTraits>,
131 intervaltree_internal::IntervalCompare<Node, NodeTraits>> {
133 using Key =
typename NodeTraits::key_type;
137 static_assert(std::is_base_of<INB, Node>::value,
138 "Node class not properly derived from ITreeNodeBase!");
141 "NodeTraits not properly derived from ITreeNodeTraits!");
151 bool verify_integrity()
const;
152 void dump_to_dot(
const std::string & filename)
const;
155 using BaseTree::empty;
156 using BaseTree::insert;
157 using BaseTree::remove;
160 template <
class Comparable>
165 typedef ptrdiff_t difference_type;
166 typedef Node value_type;
167 typedef const Node & const_reference;
168 typedef const Node * const_pointer;
169 typedef std::input_iterator_tag iterator_category;
183 const_reference operator*()
const;
184 const_pointer operator->()
const;
217 template <
class Comparable>
220 template <
class Comparable>
222 interval_upper_bound(
const Comparable & query_range)
const;
225 void fixup_maxima(Node & lowest);
228 using BaseTree::begin;
232 bool verify_maxima(Node * n)
const;
237 #include "intervaltree.cpp" 239 #endif // INTERVALTREE_HPP Abstract base class for the Node Traits that need to be implemented.
Definition: intervaltree.hpp:80
Definition: intervaltree.hpp:23
Stores an Interval Tree.
Definition: intervaltree.hpp:125
Definition: intervaltree.hpp:66
Definition: intervaltree.hpp:17
Base class (template) to supply your node class with metainformation.
Definition: rbtree.hpp:92
Definition: intervaltree.hpp:161
Definition: intervaltree.hpp:31
void key_type
The type of your interval bounds. This is the type that get_lower() and get_upper() must return...
Definition: intervaltree.hpp:87
The Red-Black Tree.
Definition: rbtree.hpp:194
Definition: intervaltree.hpp:163
Definition: rbtree.hpp:18