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, A, Pr, M > Class Template Reference

all memory allocations are on the external allocators More...

#include <map.h>

Inheritance diagram for _map< K, T, A, Pr, M >:

base_map< K, T, Pr, M >

List of all members.

Public Member Functions

 _map (const Pr &pr=Pr())
 constructor
 _map (const _map< K, T, A, Pr, M > &x)
 copy constructor
 ~_map ()
 destructor
void assign (A &allocator_, const _map< K, T, A, Pr, M > &x)
 assigns external map external allocator is required
TYPENAME _map< K, T, A, Pr, M >
::pairib_t 
insert (A &allocator_, const K &k, const T &v)
 inserts key/value external allocator required
TYPENAME _map< K, T, A, Pr, M >
::iterator 
erase (TYPENAME _map< K, T, A, Pr, M >::iterator p)
 erases node by iterator erase for byte_allocator, which can not deallocate random items
TYPENAME _map< K, T, A, Pr, M >
::iterator 
erase (node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &allocator_, TYPENAME _map< K, T, A, Pr, M >::iterator p)
 erases node by iterator node_allocator can deallocate random items
void erase (const K &k)
 erases node by key, no memory deallocation
void erase (node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &allocator_, const K &k)
 erases node by key with memory deallocation on external allocator
TYPENAME _map< K, T, A, Pr, M >
::iterator 
erase (TYPENAME _map< K, T, A, Pr, M >::iterator first, TYPENAME _map< K, T, A, Pr, M >::iterator last)
 erases the range of iterators no memory deallocation
TYPENAME _map< K, T, A, Pr, M >
::iterator 
erase (node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &allocator_, TYPENAME _map< K, T, A, Pr, M >::iterator first, TYPENAME _map< K, T, A, Pr, M >::iterator last)
 erases the range of iterators with memory deallocaton on external allocator

Protected Member Functions

void _erase (TYPENAME _map< K, T, A, Pr, M >::_node *x)
 removes node, no memory deallocation
void _erase (node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &allocator_, TYPENAME _map< K, T, A, Pr, M >::_node *x)
 removes node with memory deallocation on external allocator
TYPENAME _map< K, T, A, Pr, M >
::iterator 
_insert (A &_allocator, bool left, TYPENAME _map< K, T, A, Pr, M >::_node *w, const K &k, const T &v)
 creates new node on external allocator and insert it
TYPENAME _map< K, T, A, Pr, M >
::_node
_buynode (byte_allocator &_allocator, TYPENAME _map< K, T, A, Pr, M >::_node *p, TYPENAME _map< K, T, A, Pr, M >::redblack c, TYPENAME _map< K, T, A, Pr, M >::nodetype t)
 creates new node on external allocator (byte_allocator)
TYPENAME _map< K, T, A, Pr, M >
::_node
_buynode (node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &_allocator, TYPENAME _map< K, T, A, Pr, M >::_node *p, TYPENAME _map< K, T, A, Pr, M >::redblack c, TYPENAME _map< K, T, A, Pr, M >::nodetype t)
 creates new node on external allocator (node_allocator)
void _freenode (node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &_allocator, TYPENAME _map< K, T, A, Pr, M >::_node *s)
 destroys node and returns memory to external allocator

Private Member Functions

_map< K, T, A, Pr, M > & operator= (const _map< K, T, A, Pr, M > &x)
 private assign operator


Detailed Description

template<class K, class T, class A = byte_allocator, class Pr = less< K >, bool M = false>
class _map< K, T, A, Pr, M >

all memory allocations are on the external allocators

Definition at line 635 of file map.h.


Constructor & Destructor Documentation

template<class K, class T, class A, class Pr, bool M>
_map< K, T, A, Pr, M >::_map ( const Pr &  pr = Pr()  )  [inline, explicit]

constructor

Parameters:
pr  predicate

Definition at line 625 of file map.hpp.

References base_map< K, T, Pr, M >::clear().

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

copy constructor

Parameters:
x  input

Definition at line 637 of file map.hpp.

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

destructor

Definition at line 632 of file map.hpp.


Member Function Documentation

template<class K, class T, class A = byte_allocator, class Pr = less< K >, bool M = false>
_map< K, T, A, Pr, M >& _map< K, T, A, Pr, M >::operator= ( const _map< K, T, A, Pr, M > &  x  )  [private]

private assign operator

template<class K, class T, class A, class Pr, bool M>
void _map< K, T, A, Pr, M >::assign ( A &  allocator_,
const _map< K, T, A, Pr, M > &  x 
) [inline]

assigns external map external allocator is required

Parameters:
allocator_  external allocator
x  input map

Definition at line 645 of file map.hpp.

References base_map< K, T, Pr, M >::begin(), base_map< K, T, Pr, M >::clear(), base_map< K, T, Pr, M >::end(), _map< K, T, A, Pr, M >::insert(), and TYPENAME.

template<class K, class T, class A, class Pr, bool M>
TYPENAME _map< K, T, A, Pr, M >::iterator _map< K, T, A, Pr, M >::erase ( TYPENAME _map< K, T, A, Pr, M >::iterator  p  )  [inline]

erases node by iterator erase for byte_allocator, which can not deallocate random items

Parameters:
p  iterator

Definition at line 724 of file map.hpp.

References base_map< K, T, Pr, M >::_erase(), and TYPENAME.

Referenced by var_object_repository::delete_object(), _map< K, T, A, Pr, M >::erase(), and var_container::intersect().

template<class K, class T, class A, class Pr, bool M>
TYPENAME _map< K, T, A, Pr, M >::iterator _map< K, T, A, Pr, M >::erase ( node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &  allocator_,
TYPENAME _map< K, T, A, Pr, M >::iterator  p 
) [inline]

erases node by iterator node_allocator can deallocate random items

Parameters:
allocator_  external allocator
p  iterator

Definition at line 734 of file map.hpp.

References base_map< K, T, Pr, M >::_destkey(), base_map< K, T, Pr, M >::_destval(), base_map< K, T, Pr, M >::_erase(), _map< K, T, A, Pr, M >::_freenode(), and TYPENAME.

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

erases node by key, no memory deallocation

Parameters:
k  key

Definition at line 751 of file map.hpp.

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

template<class K, class T, class A, class Pr, bool M>
void _map< K, T, A, Pr, M >::erase ( node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &  allocator_,
const K &  k 
) [inline]

erases node by key with memory deallocation on external allocator

Parameters:
allocator_  external allocator
k  key

Definition at line 762 of file map.hpp.

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

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

erases the range of iterators no memory deallocation

Parameters:
first  first iterator
last  last iterator

Definition at line 773 of file map.hpp.

References _map< K, T, A, Pr, M >::_erase(), base_map< K, T, Pr, M >::_head, base_map< K, T, Pr, M >::_node_::_parent, base_map< K, T, Pr, M >::begin(), base_map< K, T, Pr, M >::clear(), base_map< K, T, Pr, M >::end(), and _map< K, T, A, Pr, M >::erase().

template<class K, class T, class A, class Pr, bool M>
TYPENAME _map< K, T, A, Pr, M >::iterator _map< K, T, A, Pr, M >::erase ( node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &  allocator_,
TYPENAME _map< K, T, A, Pr, M >::iterator  first,
TYPENAME _map< K, T, A, Pr, M >::iterator  last 
) [inline]

erases the range of iterators with memory deallocaton on external allocator

Parameters:
allocator_  external allocator
first  first iterator
last  last iterator

Definition at line 791 of file map.hpp.

References _map< K, T, A, Pr, M >::_erase(), base_map< K, T, Pr, M >::_head, base_map< K, T, Pr, M >::_node_::_parent, base_map< K, T, Pr, M >::begin(), base_map< K, T, Pr, M >::clear(), base_map< K, T, Pr, M >::end(), and _map< K, T, A, Pr, M >::erase().

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

removes node, no memory deallocation

Parameters:
x  pointer to node

Definition at line 809 of file map.hpp.

References t_head, and TYPENAME.

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

template<class K, class T, class A, class Pr, bool M>
void _map< K, T, A, Pr, M >::_erase ( node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &  allocator_,
TYPENAME _map< K, T, A, Pr, M >::_node x 
) [inline, protected]

removes node with memory deallocation on external allocator

Parameters:
allocator_  external allocator
x  pointer to node

Definition at line 821 of file map.hpp.

References _map< K, T, A, Pr, M >::_erase(), t_head, and TYPENAME.

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

creates new node on external allocator and insert it

Parameters:
_allocator  external allocator
left  left flag
w  target node
k  key
v  value

Definition at line 833 of file map.hpp.

References _map< K, T, A, 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, A, Pr, M >::insert().

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

creates new node on external allocator (byte_allocator)

Parameters:
_allocator  external allocator
p  parent node
c  node color
t  node type

Definition at line 844 of file map.hpp.

References byte_allocator::allocate(), base_map< K, T, Pr, M >::head(), and TYPENAME.

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

template<class K, class T, class A, class Pr, bool M>
TYPENAME _map< K, T, A, Pr, M >::_node * _map< K, T, A, Pr, M >::_buynode ( node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &  _allocator,
TYPENAME _map< K, T, A, Pr, M >::_node p,
TYPENAME _map< K, T, A, Pr, M >::redblack  c,
TYPENAME _map< K, T, A, Pr, M >::nodetype  t 
) [inline, protected]

creates new node on external allocator (node_allocator)

Parameters:
_allocator  external allocator
p  parent node
c  node color
t  node type

Definition at line 861 of file map.hpp.

References base_map< K, T, Pr, M >::head(), and TYPENAME.

template<class K, class T, class A, class Pr, bool M>
void _map< K, T, A, Pr, M >::_freenode ( node_allocator< TYPENAME base_map< K, T, Pr, M >::_node > &  _allocator,
TYPENAME _map< K, T, A, Pr, M >::_node s 
) [inline, protected]

destroys node and returns memory to external allocator

Parameters:
_allocator  external allocator
s  pointer to node

Definition at line 877 of file map.hpp.

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


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


© Copyright Terimber 2003-.