|
| List () |
| Constructs an empty doubly linked list. More...
|
|
| List (const List< E > &L) |
| Constructs a doubly linked list that is a copy of L . More...
|
|
| List (List< E > &&L) noexcept |
| Constructs a doubly linked list containing the elements of L (move semantics). More...
|
|
| List (std::initializer_list< E > init) |
| Constructs a doubly linked list containing the elements in init . More...
|
|
|
These methods provide simple access without changing the list.
|
int | size () const |
| Returns the number of elements in the list. More...
|
|
const ListPure< E > & | getListPure () const |
| Conversion to const ListPure. More...
|
|
|
The following operators are provided by lists.
|
List< E > & | operator= (const List< E > &L) |
| Assignment operator. More...
|
|
List< E > & | operator= (List< E > &&L) |
| Assignment operator (move semantics). More...
|
|
bool | operator== (const List< E > &L) const |
| Equality operator. More...
|
|
bool | operator!= (const List< E > &L) const |
| Inequality operator. More...
|
|
|
These method add elements to the list.
|
iterator | pushFront (const E &x) |
| Adds element x at the beginning of the list. More...
|
|
template<class... Args> |
iterator | emplaceFront (Args &&... args) |
| Adds a new element at the beginning of the list. More...
|
|
iterator | pushBack (const E &x) |
| Adds element x at the end of the list. More...
|
|
template<class... Args> |
iterator | emplaceBack (Args &&... args) |
| Adds a new element at the end of the list. More...
|
|
iterator | insert (const E &x, iterator it, Direction dir=Direction::after) |
| Inserts element x before or after it . More...
|
|
iterator | insertBefore (const E &x, iterator it) |
| Inserts element x before it . More...
|
|
iterator | insertAfter (const E &x, iterator it) |
| Inserts element x after it . More...
|
|
|
These method remove elements from the list.
|
void | popFront () |
| Removes the first element from the list. More...
|
|
E | popFrontRet () |
| Removes the first element from the list and returns it. More...
|
|
void | popBack () |
| Removes the last element from the list. More...
|
|
E | popBackRet () |
| Removes the last element from the list and returns it. More...
|
|
void | del (iterator it) |
| Removes it from the list. More...
|
|
bool | removeFirst (const E &x) |
| Removes the first occurrence of x (if any) from the list. More...
|
|
void | clear () |
| Removes all elements from the list. More...
|
|
|
The method allow to change the order of elements within the list, or to move elements to another list.
|
void | moveToFront (iterator it, List< E > &L2) |
| Moves it to the begin of the list. More...
|
|
void | moveToBack (iterator it, List< E > &L2) |
| Moves it to the end of the list. More...
|
|
void | moveToSucc (iterator it, List< E > &L2, iterator itBefore) |
| Moves it after itBefore . More...
|
|
void | moveToPrec (iterator it, List< E > &L2, iterator itAfter) |
| Moves it before itAfter . More...
|
|
void | conc (List< E > &L2) |
| Appends L2 to this list and makes L2 empty. More...
|
|
void | concFront (List< E > &L2) |
| Prepends L2 to this list and makes L2 empty. More...
|
|
void | swap (List< E > &other) |
| Exchanges the contents of this list and other in constant time. More...
|
|
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 . More...
|
|
template<class E>
class ogdf::List< E >
Doubly linked lists (maintaining the length of the list).
Use ogdf::ListConstIterator or ogdf::ListIterator in order to iterate over the list.
In contrast to ogdf::ListPure, instances of ogdf::List store the length of the list.
- Template Parameters
-
E | is the data type stored in list elements. |
Definition at line 40 of file DfsMakeBiconnected.h.
Splits the list at element it
into lists L1
and L2
.
If it
is not a null pointer and L = x1,...,x{k-1}, it
,x_{k+1},xn, then L1
= x1,...,x{k-1} and L2
= it
,x{k+1},...,xn if dir
= Direction::before. If it
is a null pointer, then L1
is made empty and L2
= L. Finally L is made empty if it is not identical to L1
or L2
.
- Precondition
it
points to an element in this list.
Definition at line 1687 of file List.h.