LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::smallObjectList< T > Class Template Reference

smallObjectList template class. More...

#include <ltiSmallObjectList.h>

Inheritance diagram for lti::smallObjectList< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::smallObjectList< T >:
Collaboration graph
[legend]

List of all members.

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)

Detailed Description

template<typename T>
class lti::smallObjectList< T >

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.


Member Typedef Documentation

template<typename T>
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).

template<typename T>
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).

template<typename T>
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).

template<typename T>
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).

template<typename T>
typedef unsigned int lti::smallObjectList< T >::size_type

The type used to store the size of this list.


Constructor & Destructor Documentation

template<typename T>
lti::smallObjectList< T >::smallObjectList (  )  [inline]

Default constructor.

Creates an empty smallObjectList.

template<typename T>
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=().

template<typename T>
lti::smallObjectList< T >::~smallObjectList (  )  [inline]

Destructor.

References lti::smallObjectList< T >::clear().


Member Function Documentation

template<typename T>
const_reference lti::smallObjectList< T >::back (  )  const [inline]

Returns a const_reference to the last element of the list.

References lti::smallObjectList< T >::end().

template<typename T>
reference lti::smallObjectList< T >::back (  )  [inline]

Returns a reference to the last element of the list.

References lti::smallObjectList< T >::end().

template<typename T>
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).

template<typename T>
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().

template<typename T>
void lti::smallObjectList< T >::clear ( void   )  [inline]
template<typename T>
bool lti::smallObjectList< T >::empty (  )  const [inline]

Returns true if the list has no elements, false otherwise.

template<typename T>
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).

template<typename T>
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().

template<typename T>
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.

template<typename T>
iterator lti::smallObjectList< T >::erase ( iterator  pos  ) 

Erases the element at position pos, and returns an iterator pointing to the next element after pos.

template<typename T>
const_reference lti::smallObjectList< T >::front (  )  const [inline]

Returns a const_reference to the first element of the list.

References lti::smallObjectList< T >::begin().

template<typename T>
reference lti::smallObjectList< T >::front (  )  [inline]

Returns a reference to the first element of the list.

References lti::smallObjectList< T >::begin().

template<typename T>
iterator lti::smallObjectList< T >::insert ( iterator  pos,
const T &  x 
)

Inserts x before pos, and returns an iterator pointing after the inserted element.

template<typename T>
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.

template<typename T>
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.

template<typename T>
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().

template<typename T>
void lti::smallObjectList< T >::pop_back (  ) 

Removes the last element from the list.

Referenced by lti::smallObjectList< T >::clear().

template<typename T>
void lti::smallObjectList< T >::pop_front (  ) 

Removes the first element from the list.

template<typename T>
void lti::smallObjectList< T >::push_back ( const T &  x  ) 

Inserts x at the end of the list.

template<typename T>
void lti::smallObjectList< T >::push_front ( const T &  x  ) 

Inserts x at the beginning of the list.

template<typename T>
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.

Parameters:
x value to be removed from the list
template<typename T>
size_type lti::smallObjectList< T >::size (  )  const [inline]

Returns the number of elements in the list.

template<typename T>
void lti::smallObjectList< T >::sort (  ) 

Sorts this list according to the < operator.

template<typename T>
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.

template<typename T>
void lti::smallObjectList< T >::swap ( smallObjectList< T > &  l  )  [inline]

Swaps the contents of this list with the given list.


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

Generated on Sat Apr 10 15:28:44 2010 for LTI-Lib by Doxygen 1.6.1