Thread portable class


Gate portable class


Timer class


Pool class


Terimber 2.0


About C++


Downloads Products & Services Support Clients Open Source About



Home / Open source / Terimber 2.0

map< K, T, Pr, M > Class Template Reference

impelments map with internal node allocator More...

#include <map.h>

Inheritance diagram for map< K, T, Pr, M >:

base_map< K, T, Pr, M >

List of all members.

Public Member Functions

 map (const Pr &pr=Pr(), size_t size=os_def_size)
 constructor
 map (const map< K, T, Pr, M > &x)
 copy constructor
 ~map ()
 destructor
map< K, T, Pr, M > & operator= (const map< K, T, Pr, M > &x)
 assign operator
TYPENAME map< K, T, Pr, M >
::pairib_t 
insert (const K &k, const T &v)
 inserts new element key/value
TYPENAME map< K, T, Pr, M >
::iterator 
erase (TYPENAME map< K, T, Pr, M >::iterator p)
 erases element by iterator
void erase (const K &k)
 erases element by key
void clear ()
 clears map

Protected Member Functions

TYPENAME map< K, T, Pr, M >
::iterator 
erase (TYPENAME map< K, T, Pr, M >::iterator first, TYPENAME map< K, T, Pr, M >::iterator last)
 the range of ierators
void _erase (TYPENAME map< K, T, Pr, M >::_node *x)
 erases a node
TYPENAME map< K, T, Pr, M >
::iterator 
_insert (bool left, TYPENAME map< K, T, Pr, M >::_node *w, const K &k, const T &v)
 inserts a new node
TYPENAME map< K, T, Pr, M >
::_node
_buynode (TYPENAME map< K, T, Pr, M >::_node *p, TYPENAME map< K, T, Pr, M >::redblack c, TYPENAME map< K, T, Pr, M >::nodetype t)
 create a new node on internal allocator
void _freenode (TYPENAME map< K, T, Pr, M >::_node *s)
 destroys node

Protected Attributes

node_allocator< TYPENAME
base_map< K, T, Pr, M >::_node
_allocator
 internal node allocator


Detailed Description

template<class K, class T, class Pr = less< K >, bool M = false>
class map< K, T, Pr, M >

impelments map with internal node allocator

Definition at line 767 of file map.h.


Constructor & Destructor Documentation

template<class K, class T, class Pr, bool M>
map< K, T, Pr, M >::map ( const Pr &  pr = Pr(),
size_t  size = os_def_size 
) [inline, explicit]

constructor

Parameters:
pr  predicate
size  number of element on one page of allocator

Definition at line 885 of file map.hpp.

template<class K, class T, class Pr, bool M>
map< K, T, Pr, M >::map ( const map< K, T, Pr, M > &  x  )  [inline]

copy constructor

Definition at line 896 of file map.hpp.

template<class K, class T, class Pr, bool M>
map< K, T, Pr, M >::~map (  )  [inline]

destructor

Definition at line 891 of file map.hpp.


Member Function Documentation

template<class K, class T, class Pr, bool M>
map< K, T, Pr, M > & map< K, T, Pr, M >::operator= ( const map< K, T, Pr, M > &  x  )  [inline]

template<class K, class T, class Pr, bool M>
void map< K, T, Pr, M >::erase ( const K &  k  )  [inline]

erases element by key

Parameters:
k  key

Definition at line 1008 of file map.hpp.

References base_map< K, T, Pr, M >::_size, base_map< K, T, Pr, M >::equal_range(), map< K, T, Pr, M >::erase(), and TYPENAME.

template<class K, class T, class Pr, bool M>
TYPENAME map< K, T, Pr, M >::iterator map< K, T, Pr, M >::erase ( TYPENAME map< K, T, Pr, M >::iterator  first,
TYPENAME map< K, T, Pr, M >::iterator  last 
) [inline, protected]

template<class K, class T, class Pr, bool M>
void map< K, T, Pr, M >::_erase ( TYPENAME map< K, T, Pr, M >::_node x  )  [inline, protected]

erases a node

Parameters:
x  pointer to node

Definition at line 1057 of file map.hpp.

References base_map< K, T, Pr, M >::_destkey(), base_map< K, T, Pr, M >::_destval(), map< K, T, Pr, M >::_freenode(), t_head, and TYPENAME.

Referenced by map< K, T, Pr, M >::erase().

template<class K, class T, class Pr, bool M>
TYPENAME map< K, T, Pr, M >::iterator map< K, T, Pr, M >::_insert ( bool  left,
TYPENAME map< K, T, Pr, M >::_node w,
const K &  k,
const T &  v 
) [inline, protected]

inserts a new node

Parameters:
left  left flag
w  target node
k  key
v  value

Definition at line 1072 of file map.hpp.

References map< K, T, Pr, M >::_buynode(), base_map< K, T, Pr, M >::_insert(), c_red, base_map< K, T, Pr, M >::end(), t_leaf, and TYPENAME.

Referenced by map< K, T, Pr, M >::insert().

template<class K, class T, class Pr, bool M>
TYPENAME map< K, T, Pr, M >::_node * map< K, T, Pr, M >::_buynode ( TYPENAME map< K, T, Pr, M >::_node p,
TYPENAME map< K, T, Pr, M >::redblack  c,
TYPENAME map< K, T, Pr, M >::nodetype  t 
) [inline, protected]

create a new node on internal allocator

Parameters:
p  parent node
c  node color
t  node type

Definition at line 1084 of file map.hpp.

References map< K, T, Pr, M >::_allocator, base_map< K, T, Pr, M >::_node_::_color, base_map< K, T, Pr, M >::_node_::_parent, node_allocator< T >::allocate(), base_map< K, T, Pr, M >::head(), and TYPENAME.

Referenced by map< K, T, Pr, M >::_insert().

template<class K, class T, class Pr, bool M>
void map< K, T, Pr, M >::_freenode ( TYPENAME map< K, T, Pr, M >::_node s  )  [inline, protected]

destroys node

Parameters:
s  pointer to node

Definition at line 1099 of file map.hpp.

References map< K, T, Pr, M >::_allocator, and rep_allocator::deallocate().

Referenced by map< K, T, Pr, M >::_erase(), and map< K, T, Pr, M >::erase().


Member Data Documentation

template<class K, class T, class Pr = less< K >, bool M = false>
node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > map< K, T, Pr, M >::_allocator [protected]

internal node allocator

Definition at line 844 of file map.h.

Referenced by map< K, T, Pr, M >::_buynode(), map< K, T, Pr, M >::_freenode(), and map< K, T, Pr, M >::clear().


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


© Copyright Terimber 2003-.