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

#include <elm/stree/Builder.h>

Protected Types

typedef Tree< K, T, C >::node_t node_t
 

Protected Member Functions

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::Builder< K, T, C >

Very simple allocator that creates a power of 2 number of nodes for elm::stree::Tree class.

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

Member Typedef Documentation

◆ node_t

typedef Tree<K, T, C>::node_t node_t
protected

Member Function Documentation

◆ allocate()

node_t * allocate ( t::uint32  n)
inlineprotected

Allocate an array of nodes whose number is the closest greater number of power of 2.

Parameters
nPower of the number of nodes.
Returns
Allocated array of nodes (caller is responsible for releasing them).

Referenced by MarkerBuilder< K, T, C >::make(), and SegmentBuilder< K, T, C >::make().

◆ make()

int make ( node_t nodes,
int &  s,
int  start,
int  end 
)
inlineprotected

Initialize the structure of the tree. @notice The keys of the nodes should have been initialized first.

Parameters
nodesArray of nodes.
sParent node.
startStart index.
endEnd index.
Returns
Index of the root node.

Referenced by Builder< K, T, Comparator< K > >::make(), MarkerBuilder< K, T, C >::make(), and SegmentBuilder< K, T, C >::make().


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