Template class for non-intrusive linked lists. More...
#include <LList.H>


Classes | |
| struct | link |
| The storage of T with linked nodes. More... | |
| class | iterator |
| An STL-conforming iterator. More... | |
| class | const_iterator |
| An STL-conforming const_iterator. More... | |
| class | reverse_iterator |
| A reverse_iterator, for LListBase classes that support reverse iteration. More... | |
| class | const_reverse_iterator |
| A const_reverse_iterator, for LListBase classes that support reverse iteration. More... | |
Public Types | |
| typedef T | value_type |
| Type of values stored. | |
| typedef T * | pointer |
| Pointer for value_type. | |
| typedef const T * | const_pointer |
| Const pointer for value_type. | |
| typedef T & | reference |
| Reference for value_type. | |
| typedef const T & | const_reference |
| Const reference for value_type. | |
| typedef label | size_type |
| The type that can represent the container size. | |
| typedef label | difference_type |
| The difference between iterators. | |
| using | base_iterator = typename LListBase::iterator |
| using | const_base_iterator = typename LListBase::const_iterator |
Public Member Functions | |
| LList ()=default | |
| Default construct. | |
| LList (const T &elem) | |
| Construct and copy add initial item. | |
| LList (T &&elem) | |
| Construct and move add initial item. | |
| LList (Istream &is) | |
| Construct from Istream. | |
| LList (const LList< LListBase, T > &lst) | |
| Copy construct. | |
| LList (LList< LListBase, T > &&lst) | |
| Move construct. | |
| LList (std::initializer_list< T > lst) | |
| Copy construct from an initializer list. | |
| ~LList () | |
| Destructor. Calls clear(). | |
| reference | front () |
| The first entry in the list. | |
| const_reference | front () const |
| The first entry in the list (const access). | |
| reference | back () |
| The last entry in the list. | |
| const_reference | back () const |
| The last entry in the list (const access). | |
| void | push_front (const T &elem) |
| Add copy at front of list. | |
| void | push_front (T &&elem) |
| Move construct at front of list. | |
| void | push_back (const T &elem) |
| Add copy at back of list. | |
| void | push_back (T &&elem) |
| Move construct at back of list. | |
| void | clear () |
| Delete contents of list. | |
| void | pop_front (label n=1) |
| Remove first element(s) from the list (deletes pointers). | |
| T | removeHead () |
| Remove and return first entry. | |
| T | remove (link *item) |
| Remove and return element. | |
| T | remove (iterator &iter) |
| Remove and return element specified by iterator. | |
| void | transfer (LList< LListBase, T > &lst) |
| Transfer the contents of the argument into this List and annul the argument list. | |
| void | operator= (const LList< LListBase, T > &lst) |
| Copy assignment. | |
| void | operator= (LList< LListBase, T > &&lst) |
| Move assignment. | |
| void | operator= (std::initializer_list< T > lst) |
| Copy assignment from an initializer list. | |
| Istream & | readList (Istream &is) |
| Read list from Istream. | |
| Ostream & | writeList (Ostream &os, const label shortLen=0) const |
| Write LList with line-breaks when length exceeds shortLen. | |
| iterator | begin () |
| Iterator to first item in list with non-const access. | |
| const_iterator | cbegin () const |
| Iterator to first item in list with const access. | |
| reverse_iterator | rbegin () |
| Iterator to last item in list with non-const access. | |
| const_reverse_iterator | crbegin () const |
| Iterator to last item in list with const access. | |
| const_iterator | begin () const |
| Iterator to first item in list with const access. | |
| const_reverse_iterator | rbegin () const |
| Iterator to last item in list with const access. | |
| const iterator & | end () |
| End of list for forward iterators. | |
| const const_iterator & | cend () const |
| End of list for forward iterators. | |
| const reverse_iterator & | rend () |
| End of list for reverse iterators. | |
| const const_reverse_iterator & | crend () const |
| End of list for reverse iterators. | |
| const const_iterator & | end () const |
| End of list for forward iterators. | |
| const const_reverse_iterator & | rend () const |
| End of list for reverse iterators. | |
| reference | first () |
| The first entry in the list. | |
| const_reference | first () const |
| The first entry in the list (const access). | |
| reference | last () |
| The last entry in the list. | |
| const_reference | last () const |
| The last entry in the list (const access). | |
| void | prepend (const T &elem) |
| Add copy at front of list. | |
| void | prepend (T &&elem) |
| Move construct at front of list. | |
| void | append (const T &elem) |
| Add copy at back of list. | |
| void | append (T &&elem) |
| Move construct at back of list. | |
| void | insert (const T &elem) |
| Add copy at front of list. Same as push_front(). | |
| void | insert (T &&elem) |
| Move construct at front of list. Same as push_front(). | |
Friends | |
| Istream & | operator>> (Istream &is, LList< LListBase, T > &lst) |
| Read list from Istream. | |
| Ostream & | operator (Ostream &os, const LList< LListBase, T > &lst) |
| Write LList to Ostream with line breaks, as per writeList with shortLen=-1. | |
Template class for non-intrusive linked lists.
| typedef T value_type |
Pointer for value_type.
| typedef const T* const_pointer |
Const pointer for value_type.
Reference for value_type.
| typedef const T& const_reference |
Const reference for value_type.
| typedef label difference_type |
| using base_iterator = typename LListBase::iterator |
| using const_base_iterator = typename LListBase::const_iterator |
|
default |
Default construct.
Referenced by LList(), LList(), operator=(), operator=(), readList(), and transfer().

Construct from Istream.
Definition at line 29 of file LListIO.C.
References operator>>.

Copy construct.
Definition at line 27 of file LList.C.
References LList(), push_back(), and Foam::T().

Copy construct from an initializer list.
Definition at line 48 of file LList.C.
References push_back(), and Foam::T().

The first entry in the list.
Definition at line 250 of file LList.H.
Referenced by LList< LListBase, T * >::first(), and LList< LListBase, T * >::first().

|
inline |
The last entry in the list.
Definition at line 266 of file LList.H.
Referenced by LList< LListBase, T * >::last(), and LList< LListBase, T * >::last().

|
inline |
Add copy at front of list.
Definition at line 283 of file LList.H.
Referenced by LList< LListBase, T * >::insert(), LList< LListBase, T * >::insert(), LList< LListBase, T * >::LList(), LList< LListBase, T * >::LList(), LList< LListBase, T * >::prepend(), and LList< LListBase, T * >::prepend().

Add copy at back of list.
Definition at line 299 of file LList.H.
Referenced by LList< LListBase, T * >::append(), LList< LListBase, T * >::append(), LList(), LList(), operator=(), operator=(), and readList().

| void clear | ( | ) |
Delete contents of list.
Definition at line 88 of file LList.C.
References pop_front().
Referenced by LPtrList< LListBase, T >::clear(), and readList().


| void pop_front | ( | label | n = 1 | ) |
Copy assignment from an initializer list.
Definition at line 127 of file LList.C.
References clear(), push_back(), and Foam::T().

| Foam::Istream & readList | ( | Istream & | is | ) |
Read list from Istream.
Definition at line 38 of file LListIO.C.
References token::BEGIN_LIST, clear(), token::END_LIST, Foam::exit(), IOstream::fatalCheck(), Foam::FatalIOError, FatalIOErrorInFunction, FUNCTION_NAME, token::info(), token::isLabel(), token::isPunctuation(), token::labelToken(), LList(), push_back(), Istream::putBack(), Istream::readBeginList(), Istream::readEndList(), and Foam::T().

| Foam::Ostream & writeList | ( | Ostream & | os, |
| const label | shortLen = 0 ) const |
Write LList with line-breaks when length exceeds shortLen.
Using '0' suppresses line-breaks entirely.
Definition at line 117 of file LListIO.C.
References token::BEGIN_LIST, token::END_LIST, FUNCTION_NAME, Foam::nl, os(), token::SPACE, and Foam::T().

|
inline |
Iterator to first item in list with const access.
Definition at line 608 of file LList.H.
Referenced by valueAverageBase::calc().

|
inline |
|
inline |
Iterator to last item in list with const access.
Definition at line 624 of file LList.H.
Referenced by LList< LListBase, T * >::rbegin().

|
inline |
|
inline |
|
inline |
End of list for forward iterators.
Definition at line 657 of file LList.H.
Referenced by LList< LListBase, T * >::end().

|
inline |
|
inline |
End of list for reverse iterators.
Definition at line 673 of file LList.H.
Referenced by LList< LListBase, T * >::rend().

|
inline |
|
inline |
The first entry in the list.
FOAM_DEPRECATED_FOR(2022-10, "front()")
Definition at line 702 of file LList.H.
Referenced by valueAverageBase::calc().

|
inline |
|
inline |
Add copy at front of list. Same as push_front().
FOAM_DEPRECATED_FOR(2022-01, "push_front()")
Move construct at front of list. Same as push_front().
FOAM_DEPRECATED_FOR(2022-01, "push_front()")