ScummVM API documentation
Common::List< t_T > Class Template Reference

#include <list.h>

Public Types

typedef ListInternal::Iterator< t_T > iterator
 
typedef ListInternal::ConstIterator< t_T > const_iterator
 
typedef t_T value_type
 
typedef uint size_type
 

Public Member Functions

constexpr List ()
 
 List (const List< t_T > &list)
 
iterator insert (iterator pos, const t_T &element)
 
template<typename iterator2 >
void insert (iterator pos, iterator2 first, iterator2 last)
 
iterator erase (iterator pos)
 
iterator reverse_erase (iterator pos)
 
iterator erase (iterator first, iterator last)
 
void remove (const t_T &val)
 
void push_front (const t_T &element)
 
void push_back (const t_T &element)
 
void pop_front ()
 
void pop_back ()
 
t_T & front ()
 
const t_T & front () const
 
t_T & back ()
 
const t_T & back () const
 
List< t_T > & operator= (const List< t_T > &list)
 
size_type size () const
 
void clear ()
 
bool empty () const
 
iterator begin ()
 
iterator reverse_begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator reverse_begin () const
 
const_iterator end () const
 

Protected Types

typedef ListInternal::NodeBase NodeBase
 
typedef ListInternal::Node< t_T > Node
 

Protected Member Functions

NodeBase erase (NodeBase *pos)
 
void insert (NodeBase *pos, const t_T &element)
 

Protected Attributes

NodeBase _anchor
 

Detailed Description

template<typename t_T>
class Common::List< t_T >

Simple doubly linked list, modeled after the list template of the standard C++ library.

Member Typedef Documentation

◆ NodeBase

template<typename t_T>
typedef ListInternal::NodeBase Common::List< t_T >::NodeBase
protected

◆ Node

template<typename t_T>
typedef ListInternal::Node<t_T> Common::List< t_T >::Node
protected

An element of the doubly linked list.

◆ iterator

template<typename t_T>
typedef ListInternal::Iterator<t_T> Common::List< t_T >::iterator

List iterator.

◆ const_iterator

template<typename t_T>
typedef ListInternal::ConstIterator<t_T> Common::List< t_T >::const_iterator

Const-qualified list iterator.

◆ value_type

template<typename t_T>
typedef t_T Common::List< t_T >::value_type

Value type of the list.

◆ size_type

template<typename t_T>
typedef uint Common::List< t_T >::size_type

Size type of the list.

Constructor & Destructor Documentation

◆ List() [1/2]

template<typename t_T>
constexpr Common::List< t_T >::List ( )
inline

Construct a new empty list.

◆ List() [2/2]

template<typename t_T>
Common::List< t_T >::List ( const List< t_T > &  list)
inline

< Construct a new list as a copy of the given list.

Member Function Documentation

◆ insert() [1/3]

template<typename t_T>
iterator Common::List< t_T >::insert ( iterator  pos,
const t_T &  element 
)
inline

Insert an element before pos.

◆ insert() [2/3]

template<typename t_T>
template<typename iterator2 >
void Common::List< t_T >::insert ( iterator  pos,
iterator2  first,
iterator2  last 
)
inline

Insert elements from first to last before pos.

◆ erase() [1/3]

template<typename t_T>
iterator Common::List< t_T >::erase ( iterator  pos)
inline

Delete the element at location pos and return an iterator pointing to the element after the one that was deleted.

◆ reverse_erase()

template<typename t_T>
iterator Common::List< t_T >::reverse_erase ( iterator  pos)
inline

Delete the element at location pos and return an iterator pointing to the element before the one that was deleted.

◆ erase() [2/3]

template<typename t_T>
iterator Common::List< t_T >::erase ( iterator  first,
iterator  last 
)
inline

Delete the elements between first and last (including first but not last). Return an iterator pointing to the element after the one that was deleted (that is, last).

◆ remove()

template<typename t_T>
void Common::List< t_T >::remove ( const t_T &  val)
inline

Remove all elements that are equal to val from the list.

◆ push_front()

template<typename t_T>
void Common::List< t_T >::push_front ( const t_T &  element)
inline

Insert an element at the start of the list.

◆ push_back()

template<typename t_T>
void Common::List< t_T >::push_back ( const t_T &  element)
inline

Append an element to the end of the list.

◆ pop_front()

template<typename t_T>
void Common::List< t_T >::pop_front ( )
inline

Remove the first element of the list.

◆ pop_back()

template<typename t_T>
void Common::List< t_T >::pop_back ( )
inline

Remove the last element of the list.

◆ front() [1/2]

template<typename t_T>
t_T& Common::List< t_T >::front ( )
inline

Return a reference to the first element of the list.

◆ front() [2/2]

template<typename t_T>
const t_T& Common::List< t_T >::front ( ) const
inline

Return a reference to the first element of the list.

◆ back() [1/2]

template<typename t_T>
t_T& Common::List< t_T >::back ( )
inline

Return a reference to the last element of the list.

◆ back() [2/2]

template<typename t_T>
const t_T& Common::List< t_T >::back ( ) const
inline

Return a reference to the last element of the list.

◆ operator=()

template<typename t_T>
List<t_T>& Common::List< t_T >::operator= ( const List< t_T > &  list)
inline

Assign a given list to this list.

◆ size()

template<typename t_T>
size_type Common::List< t_T >::size ( ) const
inline

Return the size of the list.

◆ clear()

template<typename t_T>
void Common::List< t_T >::clear ( )
inline

Remove all elements from the list.

◆ empty()

template<typename t_T>
bool Common::List< t_T >::empty ( ) const
inline

Check whether the list is empty.

◆ begin() [1/2]

template<typename t_T>
iterator Common::List< t_T >::begin ( )
inline

Return an iterator to the start of the list. This can be used, for example, to iterate from the first element of the list to the last element of the list.

◆ reverse_begin() [1/2]

template<typename t_T>
iterator Common::List< t_T >::reverse_begin ( )
inline

Return a reverse iterator to the start of the list. This can be used, for example, to iterate from the last element of the list to the first element of the list.

◆ end() [1/2]

template<typename t_T>
iterator Common::List< t_T >::end ( )
inline

Return an iterator to the end of the list.

◆ begin() [2/2]

template<typename t_T>
const_iterator Common::List< t_T >::begin ( ) const
inline

Return a const iterator to the start of the list. This can be used, for example, to iterate from the first element of the list to the last element of the list.

◆ reverse_begin() [2/2]

template<typename t_T>
const_iterator Common::List< t_T >::reverse_begin ( ) const
inline

Return a const reverse iterator to the start of the list. This can be used, for example, to iterate from the last element of the list to the first element of the list.

◆ end() [2/2]

template<typename t_T>
const_iterator Common::List< t_T >::end ( ) const
inline

Return a const iterator to the end of the list.

◆ erase() [3/3]

template<typename t_T>
NodeBase Common::List< t_T >::erase ( NodeBase pos)
inlineprotected

Erase an element at pos.

◆ insert() [3/3]

template<typename t_T>
void Common::List< t_T >::insert ( NodeBase pos,
const t_T &  element 
)
inlineprotected

Insert an element before pos.

Member Data Documentation

◆ _anchor

template<typename t_T>
NodeBase Common::List< t_T >::_anchor
protected

Pointer to the position of the element in the list.


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