Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/stree/MarkerBuilder.h>
Public Member Functions | |
void | add (const K &mark, const T &val) |
void | make (stree::Tree< K, T, C > &tree) |
Additional Inherited Members | |
Protected Types inherited from Builder< K, T, Comparator< K > > | |
typedef Tree< K, T, Comparator< K > >::node_t | node_t |
Protected Member Functions inherited from Builder< K, T, Comparator< K > > | |
node_t * | allocate (t::uint32 n) |
int | make (node_t *nodes, int &s, int start, int end) |
Efficient and easy builder for elm::stree::Tree class thatjust records segments and their value.
K | Key type. |
T | Retrieven item type. |
C | Comparator to compare keys (default to Comparator<K>). |
|
inline |
Add a segment starting at the given mark, containing the given value and spanning the next upper given mark. It must be noticed that the value of the greater mark is not used.
mark | Mark to add. |
val | Value of the segment. |
|
inline |
Build the segmented tree from the markers and values.
tree | Tree to initialize. |
References Builder< K, T, C >::allocate(), Tree< K, T, C >::node_t::data, Pair< T1, T2 >::fst, elm::iter(), Builder< K, T, C >::make(), Tree< K, T, C >::set(), and Pair< T1, T2 >::snd.