|
| SListPure () |
| Constructs an empty singly linked list. More...
|
|
| SListPure (const SListPure< E > &L) |
| Constructs a singly linked list that is a copy of L . More...
|
|
| SListPure (SListPure< E > &&L) noexcept |
| Constructs a singly linked list containing the elements of L (move semantics). More...
|
|
| SListPure (std::initializer_list< E > init) |
| Constructs a singly linked list containing the elements in init . More...
|
|
virtual | ~SListPure () |
| Destructor. More...
|
|
|
These methods provide simple access without changing the list.
|
bool | empty () const |
| Returns true iff the list is empty. More...
|
|
virtual int | size () const |
| Returns the number of elements in the list. More...
|
|
const_reference | front () const |
| Returns a reference to the first element. More...
|
|
reference | front () |
| Returns a reference to the first element. More...
|
|
const_reference | back () const |
| Returns a reference to the last element. More...
|
|
reference | back () |
| Returns a reference to the last element. More...
|
|
const_iterator | get (int pos) const |
| Returns an iterator pointing to the element at position pos . More...
|
|
iterator | get (int pos) |
| Returns an iterator pointing to the element at position pos . More...
|
|
int | pos (const_iterator it) const |
| Returns the position (starting with 0) of it in the list. More...
|
|
|
These methods return forward iterators to elements in the list and allow to iterate over the elements in linear or cyclic order.
|
iterator | begin () |
| Returns an iterator to the first element of the list. More...
|
|
const_iterator | begin () const |
| Returns a const iterator to the first element of the list. More...
|
|
const_iterator | cbegin () const |
| Returns a const iterator to the first element of the list. More...
|
|
iterator | end () |
| Returns an iterator to one-past-last element of the list. More...
|
|
const_iterator | end () const |
| Returns a const iterator to one-past-last element of the list. More...
|
|
const_iterator | cend () const |
| Returns a const iterator to one-past-last element of the list. More...
|
|
iterator | backIterator () |
| Returns an iterator to the last element of the list. More...
|
|
const_iterator | backIterator () const |
| Returns a const iterator to the last element of the list. More...
|
|
const_iterator | cyclicSucc (const_iterator it) const |
| Returns an iterator to the cyclic successor of it . More...
|
|
iterator | cyclicSucc (iterator it) |
| Returns an iterator to the cyclic successor of it . More...
|
|
|
The following operators are provided by lists.
|
SListPure< E > & | operator= (const SListPure< E > &L) |
| Assignment operator. More...
|
|
SListPure< E > & | operator= (SListPure< E > &&L) |
| Assignment operator (move semantics). More...
|
|
bool | operator== (const SListPure< E > &L) const |
| Equality operator. More...
|
|
bool | operator!= (const SListPure< 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 | insertAfter (const E &x, iterator itBefore) |
| Inserts element x after itBefore . 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 | delSucc (iterator itBefore) |
| Removes the succesor of itBefore . 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 | moveFrontToFront (SListPure< E > &L2) |
| Moves the first element of this list to the begin of list L2 . More...
|
|
void | moveFrontToBack (SListPure< E > &L2) |
| Moves the first element of this list to the end of list L2 . More...
|
|
void | moveFrontToSucc (SListPure< E > &L2, iterator itBefore) |
| Moves the first element of this list to list L2 inserted after itBefore . More...
|
|
void | conc (SListPure< E > &L2) |
| Appends L2 to this list and makes L2 empty. More...
|
|
void | reverse () |
| Reverses the order of the list elements. More...
|
|
|
These methods provide searching for values and sorting the list.
|
SListConstIterator< E > | search (const E &e) const |
| Scans the list for the specified element and returns an iterator to the first occurrence in the list, or an invalid iterator if not found. More...
|
|
SListIterator< E > | search (const E &e) |
| Scans the list for the specified element and returns an iterator to the first occurrence in the list, or an invalid iterator if not found. More...
|
|
template<class COMPARER > |
SListConstIterator< E > | search (const E &e, const COMPARER &comp) const |
| Scans the list for the specified element (using the user-defined comparer) and returns an iterator to the first occurrence in the list, or an invalid iterator if not found. More...
|
|
template<class COMPARER > |
SListIterator< E > | search (const E &e, const COMPARER &comp) |
| Scans the list for the specified element (using the user-defined comparer) and returns an iterator to the first occurrence in the list, or an invalid iterator if not found. More...
|
|
void | quicksort () |
| Sorts the list using Quicksort. More...
|
|
template<class COMPARER > |
void | quicksort (const COMPARER &comp) |
| Sorts the list using Quicksort and comparer comp . More...
|
|
void | bucketSort (int l, int h, BucketFunc< E > &f) |
| Sorts the list using bucket sort. More...
|
|
void | bucketSort (BucketFunc< E > &f) |
| Sorts the list using bucket sort. More...
|
|
|
These methods allow to select a random element in the list, or to randomly permute the list.
|
const_iterator | chooseIterator (std::function< bool(const E &)> includeElement=[](const E &) { return true;}, bool isFastTest=true) const |
|
iterator | chooseIterator (std::function< bool(const E &)> includeElement=[](const E &) { return true;}, bool isFastTest=true) |
|
const_reference | chooseElement (std::function< bool(const E &)> includeElement=[](const E &) { return true;}, bool isFastTest=true) const |
|
reference | chooseElement (std::function< bool(const E &)> includeElement=[](const E &) { return true;}, bool isFastTest=true) |
|
void | permute () |
| Randomly permutes the elements in the list. More...
|
|
template<class RNG > |
void | permute (RNG &rng) |
| Randomly permutes the elements in the list using random number generator rng . More...
|
|
template<class E>
class ogdf::SListPure< E >
Singly linked lists.
Use ogdf::SListConstIterator or ogdf::SListIterator in order to iterate over the list.
In contrast to ogdf::SList, instances of ogdf::SListPure do not store the length of the list.
- Template Parameters
-
E | is the data type stored in list elements. |
Definition at line 52 of file SList.h.