latest version v1.9 - last update 10 Apr 2010 |
smallObjectList template class. More...
#include <ltiSmallObjectList.h>
Classes | |
class | const_iterator |
const_iterator class (allows read-only operations) The use of the iterator classes is similar to the iterators of the STL (Standard Template Library). More... | |
class | iterator |
iterator class (allows read and write operations) The use of the iterator classes is similar to the iterators of the STL (Standard Template Library). More... | |
Public Types | |
typedef unsigned int | size_type |
typedef T & | reference |
typedef const T & | const_reference |
typedef T * | pointer |
typedef const T * | const_pointer |
Public Member Functions | |
smallObjectList () | |
smallObjectList (const smallObjectList &l) | |
~smallObjectList () | |
size_type | size () const |
bool | empty () const |
void | clear () |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
iterator | erase (iterator pos) |
iterator | erase (iterator first, iterator last) |
iterator | insert (iterator pos, const_iterator first, const_iterator last) |
iterator | insert (iterator pos, size_type n, const T &x) |
iterator | insert (iterator pos, const T &x) |
void | remove (const T &x) |
void | push_front (const T &x) |
void | push_back (const T &x) |
void | pop_front () |
void | pop_back () |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
void | sort () |
void | swap (smallObjectList< T > &l) |
void | splice (iterator position, smallObjectList< T > &l) |
smallObjectList< T > & | operator= (const smallObjectList< T > &l) |
smallObjectList template class.
The ltismallObjectList is an efficient implementation of a (double) linked list for small data types. It maintains a common heap for all lists of the same contained type. It should serve, in many cases, as a drop-in replacement for std::list.
typedef const T* lti::smallObjectList< T >::const_pointer |
const_pointer type (allows read-only operations) The use of the pointer classes is similar to the references of the STL (Standard Template Library).
typedef const T& lti::smallObjectList< T >::const_reference |
const_reference type (allows read-only operations) The use of the reference classes is similar to the references of the STL (Standard Template Library).
typedef T* lti::smallObjectList< T >::pointer |
pointer type (allows read and write operations) The use of the pointer classes is similar to the references of the STL (Standard Template Library).
typedef T& lti::smallObjectList< T >::reference |
reference type (allows read and write operations) The use of the reference classes is similar to the references of the STL (Standard Template Library).
typedef unsigned int lti::smallObjectList< T >::size_type |
The type used to store the size of this list.
lti::smallObjectList< T >::smallObjectList | ( | ) | [inline] |
Default constructor.
Creates an empty smallObjectList.
lti::smallObjectList< T >::smallObjectList | ( | const smallObjectList< T > & | l | ) | [inline] |
Copy constructor.
Creates a smallObjectList with the same contents as the given list.
References lti::smallObjectList< T >::operator=().
lti::smallObjectList< T >::~smallObjectList | ( | ) | [inline] |
Destructor.
References lti::smallObjectList< T >::clear().
const_reference lti::smallObjectList< T >::back | ( | ) | const [inline] |
Returns a const_reference to the last element of the list.
References lti::smallObjectList< T >::end().
reference lti::smallObjectList< T >::back | ( | ) | [inline] |
Returns a reference to the last element of the list.
References lti::smallObjectList< T >::end().
const_iterator lti::smallObjectList< T >::begin | ( | ) | const [inline] |
Returns a const_iterator pointing to the first element of the list.
The use of the interators is similar to the iterators of the Standard Template Library (STL).
iterator lti::smallObjectList< T >::begin | ( | ) | [inline] |
Returns an iterator pointing to the first element of the list.
The use of the interators is similar to the iterators of the Standard Template Library (STL).
Referenced by lti::smallObjectList< T >::front().
void lti::smallObjectList< T >::clear | ( | void | ) | [inline] |
Empties the list.
References lti::smallObjectList< T >::pop_back().
Referenced by lti::smallObjectList< T >::~smallObjectList().
bool lti::smallObjectList< T >::empty | ( | ) | const [inline] |
Returns true if the list has no elements, false otherwise.
const_iterator lti::smallObjectList< T >::end | ( | ) | const [inline] |
Returns a const_iterator pointing after the last element of the list.
The use of the interators is similar to the iterators of the Standard Template Library (STL).
iterator lti::smallObjectList< T >::end | ( | ) | [inline] |
Returns an iterator pointing after the last element of the list.
The use of the interators is similar to the iterators of the Standard Template Library (STL).
Referenced by lti::smallObjectList< T >::back().
iterator lti::smallObjectList< T >::erase | ( | iterator | first, | |
iterator | last | |||
) |
Erases the elements between first and last, and returns an iterator pointing to the next element after last.
iterator lti::smallObjectList< T >::erase | ( | iterator | pos | ) |
Erases the element at position pos, and returns an iterator pointing to the next element after pos.
const_reference lti::smallObjectList< T >::front | ( | ) | const [inline] |
Returns a const_reference to the first element of the list.
References lti::smallObjectList< T >::begin().
reference lti::smallObjectList< T >::front | ( | ) | [inline] |
Returns a reference to the first element of the list.
References lti::smallObjectList< T >::begin().
iterator lti::smallObjectList< T >::insert | ( | iterator | pos, | |
const T & | x | |||
) |
Inserts x before pos, and returns an iterator pointing after the inserted element.
iterator lti::smallObjectList< T >::insert | ( | iterator | pos, | |
size_type | n, | |||
const T & | x | |||
) |
Inserts n copies of x before pos, and returns an iterator pointing after the last inserted element.
iterator lti::smallObjectList< T >::insert | ( | iterator | pos, | |
const_iterator | first, | |||
const_iterator | last | |||
) |
Inserts the range [first, last) before pos, and returns an iterator pointing after the last inserted element.
smallObjectList<T>& lti::smallObjectList< T >::operator= | ( | const smallObjectList< T > & | l | ) |
Assignment operator.
Clears this list, and copies the contents of the given list.
Reimplemented from lti::ioObject.
Referenced by lti::smallObjectList< T >::smallObjectList().
void lti::smallObjectList< T >::pop_back | ( | ) |
Removes the last element from the list.
Referenced by lti::smallObjectList< T >::clear().
void lti::smallObjectList< T >::pop_front | ( | ) |
Removes the first element from the list.
void lti::smallObjectList< T >::push_back | ( | const T & | x | ) |
Inserts x at the end of the list.
void lti::smallObjectList< T >::push_front | ( | const T & | x | ) |
Inserts x at the beginning of the list.
void lti::smallObjectList< T >::remove | ( | const T & | x | ) |
Removes the first instance of T found in the list.
If the value x is not in the list, the list remains unchanged.
x | value to be removed from the list |
size_type lti::smallObjectList< T >::size | ( | ) | const [inline] |
Returns the number of elements in the list.
void lti::smallObjectList< T >::sort | ( | ) |
Sorts this list according to the < operator.
void lti::smallObjectList< T >::splice | ( | iterator | position, | |
smallObjectList< T > & | l | |||
) |
Inserts all elements from the given list before the given position, and removes them from the given list.
This is a constant time operation.
void lti::smallObjectList< T >::swap | ( | smallObjectList< T > & | l | ) | [inline] |
Swaps the contents of this list with the given list.