@@ -61,6 +61,11 @@ Create a build folder, navigate there, run cmake and build the tree-tests target
61
61
You might have to adapt the linker line for gtest, if you built it yourself and didn't install it into your system.
62
62
If you want to generate the pretty drawings, install cairo, pull the submodule and pass INT_TREE_DRAW_EXAMPLES=on to the cmake command line to generate a drawings/make_drawings executeable.
63
63
64
+ Some features of this library require the presence of an optional type.
65
+ If you are using C++17 and up, it will be std::optional.
66
+ Otherwise you can specify INTERVAL_TREE_HAVE_BOOST_OPTIONAL to use boost::optional.
67
+ And if neither, a reduced version of optional is provided in the library, not perfectly exchangeable with std::optional, but sufficient for the library to work.
68
+
64
69
## Draw Dot Graph
65
70
This draws a dot graph of the tree:
66
71
``` c++
@@ -137,37 +142,73 @@ Options are:
137
142
138
143
## Members of IntervalTree<Interval >
139
144
140
- - [ Members of IntervalTree<Interval >] ( #members-of-intervaltreeinterval )
141
- - [ iterator insert(interval_type const& ival)] ( #iterator-insertinterval_type-const-ival )
142
- - [ iterator insert_overlap(interval_type const& ival, bool, bool)] ( #iterator-insert_overlapinterval_type-const-ival-bool-bool )
145
+ - [ interval-tree] ( #interval-tree )
146
+ - [ How an interval tree looks like:] ( #how-an-interval-tree-looks-like )
147
+ - [ Example] ( #example )
148
+ - [ Compile \& Run Testing] ( #compile--run-testing )
149
+ - [ Draw Dot Graph] ( #draw-dot-graph )
150
+ - [ Free Functions] ( #free-functions )
151
+ - [ interval\< NumericT, Kind\> make\_ safe\_ interval(NumericT border1, NumericT border2)] ( #intervalnumerict-kind-make_safe_intervalnumerict-border1-numerict-border2 )
152
+ - [ draw\_ dot\_ graph(std::ostream\& os, interval\_ tree\_ t const\& tree, DrawOptions const\& options)] ( #draw_dot_graphstdostream-os-interval_tree_t-const-tree-drawoptions-const-options )
153
+ - [ Members of IntervalTree] ( #members-of-intervaltree )
154
+ - [ iterator insert(interval\_ type const\& ival)] ( #iterator-insertinterval_type-const-ival )
155
+ - [ Parameters] ( #parameters )
156
+ - [ iterator insert\_ overlap(interval\_ type const\& ival, bool, bool)] ( #iterator-insert_overlapinterval_type-const-ival-bool-bool )
157
+ - [ Parameters] ( #parameters-1 )
143
158
- [ iterator erase(iterator iter)] ( #iterator-eraseiterator-iter )
144
- - [ size_type size() const] ( #size_type-size-const )
145
- - [ (const)iterator find(interval_type const& ival)] ( #constiterator-findinterval_type-const-ival )
146
- - [ (const)iterator find(interval_type const& ival, CompareFunctionT const& compare)] ( #constiterator-findinterval_type-const-ival-comparefunctiont-const-compare )
147
- - [ (const)iterator find_all(interval_type const& ival, OnFindFunctionT const& on_find)] ( #constiterator-find_allinterval_type-const-ival-onfindfunctiont-const-on_find )
159
+ - [ Parameters] ( #parameters-2 )
160
+ - [ size\_ type size() const] ( #size_type-size-const )
161
+ - [ (const)iterator find(interval\_ type const\& ival)] ( #constiterator-findinterval_type-const-ival )
162
+ - [ Parameters] ( #parameters-3 )
163
+ - [ (const)iterator find(interval\_ type const\& ival, CompareFunctionT const\& compare)] ( #constiterator-findinterval_type-const-ival-comparefunctiont-const-compare )
164
+ - [ Parameters] ( #parameters-4 )
165
+ - [ (const)iterator find\_ all(interval\_ type const\& ival, OnFindFunctionT const\& on\_ find)] ( #constiterator-find_allinterval_type-const-ival-onfindfunctiont-const-on_find )
166
+ - [ Parameters] ( #parameters-5 )
148
167
- [ Example] ( #example-1 )
149
- - [ (const)iterator find_all(interval_type const& ival, OnFindFunctionT const& on_find, CompareFunctionT const& compare)] ( #constiterator-find_allinterval_type-const-ival-onfindfunctiont-const-on_find-comparefunctiont-const-compare )
150
- - [ (const)iterator find_next_in_subtree(iterator from, interval_type const& ival)] ( #constiterator-find_next_in_subtreeiterator-from-interval_type-const-ival )
151
- - [ (const)iterator find_next_in_subtree(iterator from, interval_type const& ival, CompareFunctionT const& compare)] ( #constiterator-find_next_in_subtreeiterator-from-interval_type-const-ival-comparefunctiont-const-compare )
152
- - [ (const)iterator overlap_find(interval_type const& ival, bool exclusive)] ( #constiterator-overlap_findinterval_type-const-ival-bool-exclusive )
153
- - [ (const)iterator overlap_find_all(interval_type const& ival, OnFindFunctionT const& on_find, bool exclusive)] ( #constiterator-overlap_find_allinterval_type-const-ival-onfindfunctiont-const-on_find-bool-exclusive )
168
+ - [ (const)iterator find\_ all(interval\_ type const\& ival, OnFindFunctionT const\& on\_ find, CompareFunctionT const\& compare)] ( #constiterator-find_allinterval_type-const-ival-onfindfunctiont-const-on_find-comparefunctiont-const-compare )
169
+ - [ Parameters] ( #parameters-6 )
170
+ - [ (const)iterator find\_ next\_ in\_ subtree(iterator from, interval\_ type const\& ival)] ( #constiterator-find_next_in_subtreeiterator-from-interval_type-const-ival )
171
+ - [ Parameters] ( #parameters-7 )
172
+ - [ (const)iterator find\_ next\_ in\_ subtree(iterator from, interval\_ type const\& ival, CompareFunctionT const\& compare)] ( #constiterator-find_next_in_subtreeiterator-from-interval_type-const-ival-comparefunctiont-const-compare )
173
+ - [ Parameters] ( #parameters-8 )
174
+ - [ (const)iterator overlap\_ find(interval\_ type const\& ival, bool exclusive)] ( #constiterator-overlap_findinterval_type-const-ival-bool-exclusive )
175
+ - [ Parameters] ( #parameters-9 )
176
+ - [ (const)iterator overlap\_ find\_ all(interval\_ type const\& ival, OnFindFunctionT const\& on\_ find, bool exclusive)] ( #constiterator-overlap_find_allinterval_type-const-ival-onfindfunctiont-const-on_find-bool-exclusive )
177
+ - [ Parameters] ( #parameters-10 )
154
178
- [ Example] ( #example-2 )
155
- - [ (const)iterator overlap_find_next_in_subtree(interval_type const& ival, bool exclusive)] ( #constiterator-overlap_find_next_in_subtreeinterval_type-const-ival-bool-exclusive )
156
- - [ interval_tree& deoverlap()] ( #interval_tree-deoverlap )
179
+ - [ (const)iterator overlap\_ find\_ next\_ in\_ subtree(interval\_ type const\& ival, bool exclusive)] ( #constiterator-overlap_find_next_in_subtreeinterval_type-const-ival-bool-exclusive )
180
+ - [ Parameters] ( #parameters-11 )
181
+ - [ interval\_ tree\& deoverlap()] ( #interval_tree-deoverlap )
157
182
- [ After deoverlap] ( #after-deoverlap )
158
- - [ interval_tree& deoverlap_copy ()] ( #interval_tree-deoverlap_copy )
159
- - [ interval_tree punch(interval_type const& ival)] ( #interval_tree-punchinterval_type-const-ival )
160
- - [ After punching (with [ 0, 50] )] ( #after-punching-with-0-50 )
161
- - [ interval_tree punch()] ( #interval_tree-punch )
183
+ - [ interval \_ tree deoverlap \_ copy ()] ( #interval_tree-deoverlap_copy )
184
+ - [ interval \_ tree punch(interval \_ type const\ & ival)] ( #interval_tree-punchinterval_type-const-ival )
185
+ - [ After punching (with \ [ 0, 50\ ] )] ( #after-punching-with-0-50 )
186
+ - [ interval \_ tree punch()] ( #interval_tree-punch )
162
187
- [ bool empty() const noexcept] ( #bool-empty-const-noexcept )
163
188
- [ iterator begin()] ( #iterator-begin )
164
189
- [ iterator end()] ( #iterator-end )
165
190
- [ iterator cbegin()] ( #iterator-cbegin )
166
191
- [ iterator cend()] ( #iterator-cend )
167
- - [ reverse_iterator rbegin()] ( #reverse_iterator-rbegin )
168
- - [ reverse_iterator rend()] ( #reverse_iterator-rend )
169
- - [ reverse_iterator crbegin()] ( #reverse_iterator-crbegin )
170
- - [ reverse_iterator crend()] ( #reverse_iterator-crend )
192
+ - [ reverse\_ iterator rbegin()] ( #reverse_iterator-rbegin )
193
+ - [ reverse\_ iterator rend()] ( #reverse_iterator-rend )
194
+ - [ reverse\_ iterator crbegin()] ( #reverse_iterator-crbegin )
195
+ - [ reverse\_ iterator crend()] ( #reverse_iterator-crend )
196
+ - [ Members of Interval] ( #members-of-interval )
197
+ - [ using value\_ type] ( #using-value_type )
198
+ - [ using interval\_ kind] ( #using-interval_kind )
199
+ - [ friend bool operator==(interval const\& lhs, interval const\& other)] ( #friend-bool-operatorinterval-const-lhs-interval-const-other )
200
+ - [ friend bool operator!=(interval const\& lhs, interval const\& other)] ( #friend-bool-operatorinterval-const-lhs-interval-const-other-1 )
201
+ - [ value\_ type low() const] ( #value_type-low-const )
202
+ - [ value\_ type high() const] ( #value_type-high-const )
203
+ - [ \[\[ deprecated\]\] bool overlaps(value\_ type l, value\_ type h) const] ( #deprecated-bool-overlapsvalue_type-l-value_type-h-const )
204
+ - [ bool overlaps\_ exclusive(value\_ type l, value\_ type h) const] ( #bool-overlaps_exclusivevalue_type-l-value_type-h-const )
205
+ - [ bool overlaps(interval const\& other) const] ( #bool-overlapsinterval-const-other-const )
206
+ - [ bool overlaps\_ exclusive(interval const\& other) const] ( #bool-overlaps_exclusiveinterval-const-other-const )
207
+ - [ bool within(value\_ type value) const] ( #bool-withinvalue_type-value-const )
208
+ - [ bool within(interval const\& other) const] ( #bool-withininterval-const-other-const )
209
+ - [ value\_ type operator-(interval const\& other) const] ( #value_type-operator-interval-const-other-const )
210
+ - [ value\_ type size() const] ( #value_type-size-const )
211
+ - [ interval join(interval const\& other) const] ( #interval-joininterval-const-other-const )
171
212
172
213
### iterator insert(interval_type const& ival)
173
214
Adds an interval into the tree.
0 commit comments