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

_list< T, A > Class Template Reference

class _list uses external allocator class for ALL memory allocations only 4 byte size for empty list object only forward and backward iterators are supported More...

#include <list.h>

Inheritance diagram for _list< T, A >:

base_list< T >

List of all members.

Public Member Functions

 _list ()
 constructor
 ~_list ()
 destructor
 _list (const _list< T, A > &x)
 copy constructor copies only pointers to head and to elements NO memory reallocation or copy
_list< T, A > & operator= (const _list< T, A > &x)
 assign operator copies only pointers to head and to elements NO memory reallocation or copy
void assign (A &allocator_, const _list< T, A > &x)
 make a full copy
void assign (A &allocator_, TYPENAME _list< T, A >::const_iterator first, TYPENAME _list< T, A >::const_iterator last)
 makes a full copy
void assign (A &allocator_, size_t n, const T &x=T())
 adds n elements to list
size_t size () const
 gets list size expensive operation
TYPENAME _list< T, A >::iterator push_back (A &allocator_, const T &x)
 inserts new object to the end of list
TYPENAME _list< T, A >::iterator push_front (A &allocator_, const T &x)
 inserts new object to the front of list
bool pop_front ()
 removes first element from list no memory deallocation
bool pop_front (node_allocator< TYPENAME base_list< T >::_node > &allocator_)
 removes first element from list
bool pop_back ()
 no memory deallocation
bool pop_back (node_allocator< TYPENAME base_list< T >::_node > &allocator_)
 removes last element from list
TYPENAME _list< T, A >::iterator insert (A &allocator_, TYPENAME _list< T, A >::iterator it, const T &x=T())
 inserts object before provided iterator
void insert (A &allocator_, TYPENAME _list< T, A >::iterator it, size_t n, const T &x)
 inserts n objects before provided iterator
void insert (A &allocator_, TYPENAME _list< T, A >::iterator it, TYPENAME _list< T, A >::const_iterator first, TYPENAME _list< T, A >::const_iterator last)
 inserts the list of objects before provided iterator
void remove (const T &x)
 removes the specified element of list without memory deallocation must be defined compare operator for stored object
void remove (node_allocator< TYPENAME base_list< T >::_node > &allocator_, const T &x)
 removes the specified element of list with memory deallocation must be defined compare operator for stored object
TYPENAME _list< T, A >::iterator erase (TYPENAME _list< T, A >::iterator iter)
 removes list object by iterator no memory deallocation
TYPENAME _list< T, A >::iterator erase (node_allocator< TYPENAME base_list< T >::_node > &allocator_, TYPENAME _list< T, A >::iterator iter)
 removes list object by iterator with memory deallocation
TYPENAME _list< T, A >::iterator erase (TYPENAME _list< T, A >::iterator first, TYPENAME _list< T, A >::iterator last)
 removes list objects by iterator interval no memory deallocation
TYPENAME _list< T, A >::iterator erase (node_allocator< TYPENAME base_list< T >::_node > &allocator_, TYPENAME _list< T, A >::iterator first, TYPENAME _list< T, A >::iterator last)
 removes list objects by iterator interval with memory deallocation

Private Member Functions

TYPENAME _list< T, A >::iterator remove (TYPENAME _list< T, A >::iterator iter)
 removes object by iterator interval no memory deallocation
TYPENAME _list< T, A >::iterator remove (node_allocator< TYPENAME base_list< T >::_node > &allocator_, TYPENAME _list< T, A >::iterator iter)
 removes object by iterator interval with memory deallocation
TYPENAME _list< T, A >::_node_buynode (byte_allocator &allocator_, const T &x)
 allocates node object on byte_allocator
TYPENAME _list< T, A >::_node_buynode (node_allocator< TYPENAME base_list< T >::_node > &allocator_, const T &x)
 allocates node object on node_allocator
void _freenode (node_allocator< TYPENAME base_list< T >::_node > &allocator_, TYPENAME _list< T, A >::_node *p)
 deallocates node object on node_allocator


Detailed Description

template<class T, class A = byte_allocator>
class _list< T, A >

class _list uses external allocator class for ALL memory allocations only 4 byte size for empty list object only forward and backward iterators are supported

Definition at line 343 of file list.h.


Constructor & Destructor Documentation

template<class T, class A>
_list< T, A >::_list (  )  [inline]

constructor

Definition at line 161 of file list.hpp.

template<class T, class A>
_list< T, A >::~_list (  )  [inline]

destructor

Definition at line 168 of file list.hpp.

References base_list< T >::clear().

template<class T, class A>
_list< T, A >::_list ( const _list< T, A > &  x  )  [inline]

copy constructor copies only pointers to head and to elements NO memory reallocation or copy

Definition at line 175 of file list.hpp.


Member Function Documentation

template<class T, class A>
_list< T, A > & _list< T, A >::operator= ( const _list< T, A > &  x  )  [inline]

assign operator copies only pointers to head and to elements NO memory reallocation or copy

Definition at line 186 of file list.hpp.

References base_list< T >::_head, base_list< T >::_node_::_next, base_list< T >::_node_::_prev, base_list< T >::clear(), base_list< T >::empty(), and base_list< T >::head().

template<class T, class A>
void _list< T, A >::assign ( A &  allocator_,
const _list< T, A > &  x 
) [inline]

make a full copy

Parameters:
allocator_  external allocator
x  input

Definition at line 205 of file list.hpp.

References base_list< T >::begin(), and base_list< T >::end().

template<class T, class A>
void _list< T, A >::assign ( A &  allocator_,
TYPENAME _list< T, A >::const_iterator  first,
TYPENAME _list< T, A >::const_iterator  last 
) [inline]

makes a full copy

Parameters:
allocator_  external allocator
first  first iterator
last  last iterator

Definition at line 213 of file list.hpp.

References base_list< T >::clear(), and _list< T, A >::push_back().

template<class T, class A>
void _list< T, A >::assign ( A &  allocator_,
size_t  n,
const T &  x = T() 
) [inline]

adds n elements to list

Parameters:
allocator_  external allocator
n  number of elements
x  object

Definition at line 223 of file list.hpp.

References base_list< T >::clear(), and _list< T, A >::push_back().

template<class T, class A>
size_t _list< T, A >::size (  )  const [inline]

template<class T, class A>
TYPENAME _list< T, A >::iterator _list< T, A >::push_front ( A &  allocator_,
const T &  x 
) [inline]

inserts new object to the front of list

Parameters:
allocator_  external allocator
x  object

Definition at line 261 of file list.hpp.

References _list< T, A >::_buynode(), base_list< T >::_head, base_list< T >::_node_::_next, base_list< T >::_node_::_prev, base_list< T >::end(), base_list< T >::head(), and TYPENAME.

Referenced by xml_designer_impl::get_xpath(), byte_source::go_shopping(), and byte_source::push().

template<class T, class A>
bool _list< T, A >::pop_front (  )  [inline]

template<class T, class A>
bool _list< T, A >::pop_front ( node_allocator< TYPENAME base_list< T >::_node > &  allocator_  )  [inline]

removes first element from list

Parameters:
allocator_  external allocator

Definition at line 292 of file list.hpp.

References _list< T, A >::_freenode(), base_list< T >::_head, base_list< T >::_node_::_next, base_list< T >::_node_::_prev, base_list< T >::empty(), base_list< T >::head(), and TYPENAME.

template<class T, class A>
bool _list< T, A >::pop_back (  )  [inline]

template<class T, class A>
bool _list< T, A >::pop_back ( node_allocator< TYPENAME base_list< T >::_node > &  allocator_  )  [inline]

removes last element from list

Parameters:
allocator_  external allocator

Definition at line 321 of file list.hpp.

References _list< T, A >::_freenode(), base_list< T >::_head, base_list< T >::_node_::_next, base_list< T >::_node_::_prev, base_list< T >::empty(), base_list< T >::head(), and TYPENAME.

template<class T, class A>
TYPENAME _list< T, A >::iterator _list< T, A >::insert ( A &  allocator_,
TYPENAME _list< T, A >::iterator  it,
const T &  x = T() 
) [inline]

inserts object before provided iterator

Parameters:
allocator_  external allocator
it  before iterator
x  object

Definition at line 337 of file list.hpp.

References _list< T, A >::_buynode(), base_list< T >::end(), and TYPENAME.

Referenced by _list< T, A >::insert().

template<class T, class A>
void _list< T, A >::insert ( A &  allocator_,
TYPENAME _list< T, A >::iterator  it,
size_t  n,
const T &  x 
) [inline]

inserts n objects before provided iterator

Parameters:
allocator_  external allocator
it  before iterator
n  number of objects
x  object

Definition at line 356 of file list.hpp.

References _list< T, A >::insert().

template<class T, class A>
void _list< T, A >::insert ( A &  allocator_,
TYPENAME _list< T, A >::iterator  it,
TYPENAME _list< T, A >::const_iterator  first,
TYPENAME _list< T, A >::const_iterator  last 
) [inline]

inserts the list of objects before provided iterator

Parameters:
allocator_  external allocator
it  before iterator
first  begin iterator
last  end iterator

Definition at line 365 of file list.hpp.

References _list< T, A >::insert().

template<class T, class A>
void _list< T, A >::remove ( const T &  x  )  [inline]

removes the specified element of list without memory deallocation must be defined compare operator for stored object

Parameters:
x  object

Definition at line 376 of file list.hpp.

References base_list< T >::begin(), base_list< T >::end(), and TYPENAME.

template<class T, class A>
void _list< T, A >::remove ( node_allocator< TYPENAME base_list< T >::_node > &  allocator_,
const T &  x 
) [inline]

removes the specified element of list with memory deallocation must be defined compare operator for stored object

Parameters:
allocator_  external allocator
x  object to remove

Definition at line 388 of file list.hpp.

References base_list< T >::begin(), base_list< T >::end(), and TYPENAME.

template<class T, class A>
TYPENAME _list< T, A >::iterator _list< T, A >::erase ( TYPENAME _list< T, A >::iterator  iter  )  [inline]

removes list object by iterator no memory deallocation

Parameters:
iter  erase iterator

Definition at line 402 of file list.hpp.

Referenced by fuzzy_matcher_impl::_match(), tokenizer::do_abbr(), tokenizer::do_hyphen(), and tokenizer::do_regex().

template<class T, class A>
TYPENAME _list< T, A >::iterator _list< T, A >::erase ( node_allocator< TYPENAME base_list< T >::_node > &  allocator_,
TYPENAME _list< T, A >::iterator  iter 
) [inline]

removes list object by iterator with memory deallocation

Parameters:
allocator_  external allocator
iter  erase iterator

Definition at line 410 of file list.hpp.

template<class T, class A>
TYPENAME _list< T, A >::iterator _list< T, A >::erase ( TYPENAME _list< T, A >::iterator  first,
TYPENAME _list< T, A >::iterator  last 
) [inline]

removes list objects by iterator interval no memory deallocation

Parameters:
first  first iterator
last  last iterator

Definition at line 418 of file list.hpp.

template<class T, class A>
TYPENAME _list< T, A >::iterator _list< T, A >::erase ( node_allocator< TYPENAME base_list< T >::_node > &  allocator_,
TYPENAME _list< T, A >::iterator  first,
TYPENAME _list< T, A >::iterator  last 
) [inline]

removes list objects by iterator interval with memory deallocation

Parameters:
allocator_  external allocator
first  first iterator
last  last iterator

Definition at line 428 of file list.hpp.

template<class T, class A>
TYPENAME _list< T, A >::iterator _list< T, A >::remove ( TYPENAME _list< T, A >::iterator  iter  )  [inline, private]

removes object by iterator interval no memory deallocation

Parameters:
iter  remove iterator

Definition at line 438 of file list.hpp.

References TYPENAME.

template<class T, class A>
TYPENAME _list< T, A >::iterator _list< T, A >::remove ( node_allocator< TYPENAME base_list< T >::_node > &  allocator_,
TYPENAME _list< T, A >::iterator  iter 
) [inline, private]

removes object by iterator interval with memory deallocation

Parameters:
allocator_  external allocator
iter  remove iterator

Definition at line 450 of file list.hpp.

References _list< T, A >::_freenode(), and TYPENAME.

template<class T, class A>
TYPENAME _list< T, A >::_node * _list< T, A >::_buynode ( byte_allocator allocator_,
const T &  x 
) [inline, private]

allocates node object on byte_allocator

Parameters:
allocator_  external allocator
x  object

Definition at line 463 of file list.hpp.

References byte_allocator::allocate(), and TYPENAME.

Referenced by _list< T, A >::insert(), _list< T, A >::push_back(), and _list< T, A >::push_front().

template<class T, class A>
TYPENAME _list< T, A >::_node * _list< T, A >::_buynode ( node_allocator< TYPENAME base_list< T >::_node > &  allocator_,
const T &  x 
) [inline, private]

allocates node object on node_allocator

Parameters:
allocator_  external allocator
x  object

Definition at line 474 of file list.hpp.

References TYPENAME.

template<class T, class A>
void _list< T, A >::_freenode ( node_allocator< TYPENAME base_list< T >::_node > &  allocator_,
TYPENAME _list< T, A >::_node p 
) [inline, private]

deallocates node object on node_allocator

Parameters:
allocator_  external allocator
p  pointer to node

Definition at line 485 of file list.hpp.

Referenced by _list< T, A >::pop_back(), _list< T, A >::pop_front(), and _list< T, A >::remove().


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


© Copyright Terimber 2003-.