# OpenGraph DrawingFramework

v. 2023.09 (Elderberry)

Loading...
Searching...
No Matches
ogdf::ListContainer< E, Master > Class Template Reference

#include <ogdf/basic/List.h>

Inheritance diagram for ogdf::ListContainer< E, Master >:

## Public Types

using iterator = typename List< E >::const_iterator
Provides a bidirectional iterator to an object in the container.

using reverse_iterator = typename List< E >::const_reverse_iterator
Provides a bidirectional reverse iterator to an object in the container.

## Public Member Functions

iterator begin () const
Returns an iterator to the first element in the container.

iterator end () const
Returns an iterator to the one-past-last element in the container.

reverse_iterator rbegin () const
Returns a reverse iterator to the last element in the container.

reverse_iterator rend () const
Returns a reverse iterator to the one-before-first element in the container.

int size () const
Returns the number of elements in the container.

Public Member Functions inherited from ogdf::List< E >
List ()
Constructs an empty doubly linked list.

List (const List< E > &L)
Constructs a doubly linked list that is a copy of L.

List (List< E > &&L)
Constructs a doubly linked list containing the elements of L (move semantics).

List (std::initializer_list< E > init)
Constructs a doubly linked list containing the elements in init.

const ListPure< E > & getListPure () const
Conversion to const ListPure.

List< E > & operator= (const List< E > &L)
Assignment operator.

List< E > & operator= (List< E > &&L)
Assignment operator (move semantics).

bool operator== (const List< E > &L) const
Equality operator.

bool operator!= (const List< E > &L) const
Inequality operator.

iterator pushFront (const E &x)
Adds element x at the beginning of the list.

template<class... Args>
iterator emplaceFront (Args &&... args)
Adds a new element at the beginning of the list.

iterator pushBack (const E &x)
Adds element x at the end of the list.

template<class... Args>
iterator emplaceBack (Args &&... args)
Adds a new element at the end of the list.

iterator insert (const E &x, iterator it, Direction dir=Direction::after)
Inserts element x before or after it.

iterator insertBefore (const E &x, iterator it)
Inserts element x before it.

iterator insertAfter (const E &x, iterator it)
Inserts element x after it.

void popFront ()
Removes the first element from the list.

popFrontRet ()
Removes the first element from the list and returns it.

void popBack ()
Removes the last element from the list.

popBackRet ()
Removes the last element from the list and returns it.

void del (iterator it)
Removes it from the list.

bool removeFirst (const E &x)
Removes the first occurrence of x (if any) from the list.

void clear ()
Removes all elements from the list.

void moveToFront (iterator it, List< E > &L2)
Moves it to the begin of the list.

void moveToBack (iterator it, List< E > &L2)
Moves it to the end of the list.

void moveToSucc (iterator it, List< E > &L2, iterator itBefore)
Moves it after itBefore.

void moveToPrec (iterator it, List< E > &L2, iterator itAfter)
Moves it before itAfter.

void conc (List< E > &L2)
Appends L2 to this list and makes L2 empty.

void concFront (List< E > &L2)
Prepends L2 to this list and makes L2 empty.

void swap (List< E > &other)
Exchanges the contents of this list and other in constant time.

void split (iterator it, List< E > &L1, List< E > &L2, Direction dir=Direction::before)
Splits the list at element it into lists L1 and L2.

friend Master

## Detailed Description

template<class E, class Master>
class ogdf::ListContainer< E, Master >

Definition at line 1812 of file List.h.

## ◆ iterator

template<class E , class Master >
 using ogdf::ListContainer< E, Master >::iterator = typename List::const_iterator

Provides a bidirectional iterator to an object in the container.

Definition at line 1817 of file List.h.

## ◆ reverse_iterator

template<class E , class Master >
 using ogdf::ListContainer< E, Master >::reverse_iterator = typename List::const_reverse_iterator

Provides a bidirectional reverse iterator to an object in the container.

Definition at line 1819 of file List.h.

## ◆ begin()

template<class E , class Master >
 iterator ogdf::ListContainer< E, Master >::begin ( ) const
inline

Returns an iterator to the first element in the container.

Definition at line 1822 of file List.h.

## ◆ end()

template<class E , class Master >
 iterator ogdf::ListContainer< E, Master >::end ( ) const
inline

Returns an iterator to the one-past-last element in the container.

Definition at line 1825 of file List.h.

## ◆ rbegin()

template<class E , class Master >
 reverse_iterator ogdf::ListContainer< E, Master >::rbegin ( ) const
inline

Returns a reverse iterator to the last element in the container.

Definition at line 1828 of file List.h.

## ◆ rend()

template<class E , class Master >
 reverse_iterator ogdf::ListContainer< E, Master >::rend ( ) const
inline

Returns a reverse iterator to the one-before-first element in the container.

Definition at line 1831 of file List.h.

## ◆ size()

template<class E , class Master >
 int ogdf::ListContainer< E, Master >::size ( ) const
inlinevirtual

Returns the number of elements in the container.

Reimplemented from ogdf::List< E >.

Definition at line 1834 of file List.h.

## ◆ Master

template<class E , class Master >
 friend ogdf::ListContainer< E, Master >::Master
private

Definition at line 1813 of file List.h.

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