![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/stree/SegmentBuilder.h>
Public Member Functions | |
SegmentBuilder (const T &def) | |
void | add (const K &low, const K &high, const T &val) |
void | make (stree::Tree< K, T, C > &tree) |
Additional Inherited Members | |
![]() | |
typedef Tree< K, T, Comparator< K > >::node_t | node_t |
![]() | |
node_t * | allocate (t::uint32 n) |
int | make (node_t *nodes, int &s, int start, int end) |
Builder for elm::stree::Tree based on a list of disjointed segments.
K | Key type. |
T | Retrieven item type. |
C | Comparator to compare keys (default to Comparator<K>). |
|
inline |
|
inline |
SegmentBuilder::SegmentBuilder(const T& def); Build a segment builder with a default value: the value returned when a look-up select an area out of segments.
def | Default value. |
Add a segment for a range of keys between low (inclusive) and high (exclusive).
low | Low value of the segment (inclusive). |
high | High value of the segment (exclusive). |
val | Value associated with the segment. |
References elm::pair(), and Map< K, T, C, E, A >::put().
|
inline |
Build the segmented tree from the segments and values.
tree | Tree to initialize. |
References Builder< K, T, C >::allocate(), Tree< K, T, C >::node_t::data, elm::iter(), Builder< K, T, C >::make(), elm::io::p(), and Tree< K, T, C >::set().