|
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
21 #ifndef ELM_STREE_SEGMENTBUILDER_H_
22 #define ELM_STREE_SEGMENTBUILDER_H_
24 #include <elm/stree/Builder.h>
25 #include <elm/avl/Map.h>
27 namespace elm {
namespace stree {
29 template <
class K,
class T,
class C = Comparator<K> >
35 } segment_comparator_t;
37 typedef typename map_t::PairIter iter_t;
43 void add(
const K& low,
const K& high,
const T& val) {
56 K
p =
iter.item().fst.snd;
59 if(C::compare(
iter.item().fst.fst,
p) != 0)
61 p =
iter.item().fst.snd;
75 K
p =
iter.item().fst.snd;
78 if(C::compare(
iter.item().fst.fst,
p) != 0) {
80 nodes[i++].
data = _def;
84 p =
iter.item().fst.snd;
92 tree.
set(root, nodes);
Definition: util_WAHVector.cpp:157
Printable< T, M > p(const T &data, const M &man)
Definition: Output.h:302
void make(stree::Tree< K, T, C > &tree)
Definition: SegmentBuilder.h:47
void iter(const C &c, const F &f)
Definition: util.h:95
Pair< T1, T2 > pair(const T1 &v1, const T2 &v2)
Definition: Pair.h:63
void set(int _root, node_t *_nodes)
Definition: Tree.h:53
node_t * allocate(t::uint32 n)
Definition: Builder.h:33
void put(const K &key, const T &value)
Definition: Map.h:105
Definition: SegmentBuilder.h:30
void add(const K &low, const K &high, const T &val)
Definition: SegmentBuilder.h:43
int make(node_t *nodes, int &s, int start, int end)
Definition: Builder.h:38
SegmentBuilder(const T &def)
Definition: SegmentBuilder.h:41
T data
Definition: Tree.h:48
T1 fst
Definition: Pair.h:35