Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::stree::Builder< K, T, C > Class Template Reference

#include <elm/stree/Builder.h>

+ Inheritance diagram for elm::stree::Builder< K, T, C >:

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

template<class K, class T, class C = Comparator<K>>
typedef Tree<K, T, C>::node_t elm::stree::Builder< K, T, C >::node_t
protected

Member Function Documentation

template<class K, class T, class C = Comparator<K>>
node_t * elm::stree::Builder< K, T, C >::allocate ( t::uint32  n)
protected

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).

References elm::leastUpperPowerOf2().

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

template<class K, class T, class C = Comparator<K>>
int elm::stree::Builder< K, T, C >::make ( node_t nodes,
int &  s,
int  start,
int  end 
)
protected

Initialize the structure of the tree. 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 elm::stree::MarkerBuilder< K, T, C >::make(), and elm::stree::SegmentBuilder< K, T, C >::make().


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