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 > Class Template Reference

#include <list.h>

Inheritance diagram for list< T >:

base_list< T >

List of all members.

Public Member Functions

 list (size_t size=os_def_size)
 constructor
 ~list ()
 destructor
 list (const list< T > &x)
 copy constructor
list< T > & operator= (const list< T > &x)
 assign operator copy all objects
void clear ()
 clear list call destructors of objects
void assign (const list< T > &x)
 assigns new list calling copy constructors
void assign (TYPENAME list< T >::const_iterator first, TYPENAME list< T >::const_iterator last)
 assigns new list (from : to) calling copy constructors
void assign (size_t n, const T &x=T())
 assigns new list (n elements) calling copy constructor
size_t size () const
 returns size of list
TYPENAME list< T >::iterator push_back (const T &x)
 inserts new object to the end of list
TYPENAME list< T >::iterator push_front (const T &x)
 inserts new object to the front of list
bool pop_front ()
 removes first element from list calling object destructor
bool pop_back ()
 removes last element from list calling object destructor
TYPENAME list< T >::iterator insert (TYPENAME list< T >::iterator it, const T &x=T())
 inserts new element before specified iterator calling copy constructor
void insert (TYPENAME list< T >::iterator it, size_t n, const T &x)
 assigns n new elements before specified iterator
void insert (TYPENAME list< T >::iterator it, TYPENAME list< T >::const_iterator first, TYPENAME list< T >::const_iterator last)
 assigns [from : to[ new elements before specified iterator calling copy constructor
void remove (const T &x)
 removes the specified element of list must be defined compare operator for stored object
TYPENAME list< T >::iterator erase (TYPENAME list< T >::iterator iter)
 removes specified element calling destructors returns the next iterator
TYPENAME list< T >::iterator erase (TYPENAME list< T >::iterator first, TYPENAME list< T >::iterator last)
 removes specified elements [from : to[ calling destructors returns the next iterator

Protected Member Functions

TYPENAME list< T >::_node_buynode (const T &x)
 allocates memory for new node and call copy constructor for element
void _freenode (TYPENAME list< T >::_node *p)
 deallocates memory calling destructor for element

Protected Attributes

size_t _length
 keeps the length of list
node_allocator< TYPENAME
base_list< T >::_node
_allocator
 internal allocator

Private Member Functions

TYPENAME list< T >::iterator remove (TYPENAME list< T >::iterator iter)
 removes the specified iterator


Detailed Description

template<class T>
class list< T >

class list uses internal allocator class for ALL internal memory allocations forward and backward iterators are supported

Definition at line 522 of file list.h.


Constructor & Destructor Documentation

template<class T>
list< T >::list ( size_t  size = os_def_size  )  [inline]

constructor

Parameters:
size  default element count - memory optimization for allocator pages

Definition at line 496 of file list.hpp.

template<class T>
list< T >::~list (  )  [inline]

destructor

Definition at line 504 of file list.hpp.

References list< T >::clear().

template<class T>
list< T >::list ( const list< T > &  x  )  [inline]

copy constructor

Definition at line 512 of file list.hpp.


Member Function Documentation

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

assign operator copy all objects

Definition at line 522 of file list.hpp.

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

template<class T>
void list< T >::clear (  )  [inline]

clear list call destructors of objects

Reimplemented from base_list< T >.

Definition at line 539 of file list.hpp.

References list< T >::_allocator, list< T >::_freenode(), list< T >::_length, base_list< T >::begin(), base_list< T >::clear(), rep_allocator::clear_all(), base_list< T >::end(), and TYPENAME.

Referenced by aiosock::_clear_block_lists(), aiofile::_clear_block_lists(), msg_communicator::_destroy_listeners(), list< T >::assign(), conf_unit::clear(), list< T >::operator=(), dbserver_impl::param_bulk_remove_all(), dbserver_impl::resize_params(), dbserver_impl::set_param_as_binary(), dbserver_impl::set_param_as_binary_ptr(), dbserver_impl::set_param_as_bool(), dbserver_impl::set_param_as_byte(), dbserver_impl::set_param_as_char(), dbserver_impl::set_param_as_date(), dbserver_impl::set_param_as_decimal(), dbserver_impl::set_param_as_double(), dbserver_impl::set_param_as_dword(), dbserver_impl::set_param_as_dword64(), dbserver_impl::set_param_as_float(), dbserver_impl::set_param_as_guid(), dbserver_impl::set_param_as_long(), dbserver_impl::set_param_as_long64(), dbserver_impl::set_param_as_null(), dbserver_impl::set_param_as_numeric(), dbserver_impl::set_param_as_short(), dbserver_impl::set_param_as_string(), dbserver_impl::set_param_as_string_ptr(), dbserver_impl::set_param_as_word(), dbserver_impl::set_param_as_wstring(), dbserver_impl::set_param_as_wstring_ptr(), memtable::uninit(), list< T >::~list(), memindex::~memindex(), and msg_user_connection::~msg_user_connection().

template<class T>
void list< T >::assign ( const list< T > &  x  )  [inline]

assigns new list calling copy constructors

Parameters:
x  input list

Definition at line 556 of file list.hpp.

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

template<class T>
void list< T >::assign ( TYPENAME list< T >::const_iterator  first,
TYPENAME list< T >::const_iterator  last 
) [inline]

assigns new list (from : to) calling copy constructors

Parameters:
first  first iterator
last  last iterator

Definition at line 564 of file list.hpp.

References list< T >::clear(), and list< T >::push_back().

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

assigns new list (n elements) calling copy constructor

Parameters:
n  number of elements
x  object

Definition at line 574 of file list.hpp.

References list< T >::clear(), and list< T >::push_back().

template<class T>
TYPENAME list< T >::iterator list< T >::push_front ( const T &  x  )  [inline]

template<class T>
bool list< T >::pop_back (  )  [inline]

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

inserts new element before specified iterator calling copy constructor

Parameters:
it  before iterator
x  object

Definition at line 670 of file list.hpp.

References list< T >::_buynode(), list< T >::_length, base_list< T >::end(), and TYPENAME.

Referenced by list< T >::insert().

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

assigns n new elements before specified iterator

Parameters:
it  before iterator
n  number of elements
x  object

Definition at line 691 of file list.hpp.

References list< T >::insert().

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

assigns [from : to[ new elements before specified iterator calling copy constructor

Parameters:
it  before iterator
first  first iterator
last  last iterator

Definition at line 700 of file list.hpp.

References list< T >::insert().

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

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

Parameters:
x  object

Definition at line 711 of file list.hpp.

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

template<class T>
TYPENAME list< T >::iterator list< T >::erase ( TYPENAME list< T >::iterator  iter  )  [inline]

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

removes specified elements [from : to[ calling destructors returns the next iterator

Parameters:
first  first iterator
last  last iterator

Definition at line 733 of file list.hpp.

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

removes the specified iterator

Parameters:
iter  removes iterator

Definition at line 744 of file list.hpp.

References list< T >::_freenode(), list< T >::_length, and TYPENAME.

template<class T>
TYPENAME list< T >::_node * list< T >::_buynode ( const T &  x  )  [inline, protected]

allocates memory for new node and call copy constructor for element

Parameters:
x  obect

Definition at line 758 of file list.hpp.

References list< T >::_allocator, node_allocator< T >::allocate(), and TYPENAME.

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

template<class T>
void list< T >::_freenode ( TYPENAME list< T >::_node p  )  [inline, protected]

deallocates memory calling destructor for element

Parameters:
p  pointer to node

Definition at line 769 of file list.hpp.

References list< T >::_allocator, and rep_allocator::deallocate().

Referenced by list< T >::clear(), list< T >::pop_back(), list< T >::pop_front(), and list< T >::remove().


Member Data Documentation

template<class T>
size_t list< T >::_length [protected]

template<class T>
node_allocator< TYPENAME base_list< T >::_node > list< T >::_allocator [protected]

internal allocator

Definition at line 640 of file list.h.

Referenced by list< T >::_buynode(), list< T >::_freenode(), and list< T >::clear().


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


© Copyright Terimber 2003-.