Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
MarkerBuilder< K, T, C > Class Template Reference

#include <elm/stree/MarkerBuilder.h>

+ Inheritance diagram for MarkerBuilder< K, T, C >:

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_tallocate (t::uint32 n)
 
int make (node_t *nodes, int &s, int start, int end)
 

Detailed Description

template<class K, class T, class C = Comparator<K>>
class elm::stree::MarkerBuilder< K, T, C >

Efficient and easy builder for elm::stree::Tree class thatjust records segments and their value.

Parameters
KKey type.
TRetrieven item type.
CComparator to compare keys (default to Comparator<K>).

Member Function Documentation

◆ add()

void add ( const K &  mark,
const T &  val 
)
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.

Parameters
markMark to add.
valValue of the segment.

◆ make()

void make ( stree::Tree< K, T, C > &  tree)
inline

Build the segmented tree from the markers and values.

Parameters
treeTree 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.


The documentation for this class was generated from the following files: