LList< LListBase, T > Class Template Reference

Template class for non-intrusive linked lists. More...

Inheritance diagram for LList< LListBase, T >:
[legend]
Collaboration diagram for LList< LListBase, T >:
[legend]

Classes

class  const_iterator
 An STL-conforming const_iterator. More...
 
class  const_reverse_iterator
 
class  iterator
 An STL-conforming iterator. More...
 
struct  link
 The storage of T with linked nodes. More...
 
class  reverse_iterator
 

Public Types

typedef T value_type
 Type of values stored. More...
 
typedef Tpointer
 Pointer for value_type. More...
 
typedef const Tconst_pointer
 Const pointer for value_type. More...
 
typedef Treference
 Reference for value_type. More...
 
typedef const Tconst_reference
 Const reference for value_type. More...
 
typedef label size_type
 The type that can represent the container size. More...
 
typedef label difference_type
 The difference between iterators. More...
 
using base_iterator = typename LListBase::iterator
 
using const_base_iterator = typename LListBase::const_iterator
 

Public Member Functions

 LList ()=default
 Default construct. More...
 
 LList (const T &elem)
 Construct and copy add initial item. More...
 
 LList (T &&elem)
 Construct and move add initial item. More...
 
 LList (Istream &is)
 Construct from Istream. More...
 
 LList (const LList< LListBase, T > &lst)
 Copy construct. More...
 
 LList (LList< LListBase, T > &&lst)
 Move construct. More...
 
 LList (std::initializer_list< T > lst)
 Copy construct from an initializer list. More...
 
 ~LList ()
 Destructor. More...
 
reference first ()
 The first entry in the list. More...
 
const_reference first () const
 The first entry in the list (const access) More...
 
reference last ()
 The last entry in the list. More...
 
const_reference last () const
 The last entry in the list (const access) More...
 
void prepend (const T &elem)
 Add copy at front of list. More...
 
void prepend (T &&elem)
 Move construct at front of list. More...
 
void append (const T &elem)
 Add copy at back of list. More...
 
void append (T &&elem)
 Move construct at back of list. More...
 
bool eraseHead ()
 Erase the first entry. More...
 
T removeHead ()
 Remove and return first entry. More...
 
T remove (link *item)
 Remove and return element. More...
 
T remove (iterator &iter)
 Remove and return element specified by iterator. More...
 
void clear ()
 Delete contents of list. More...
 
void transfer (LList< LListBase, T > &lst)
 
void operator= (const LList< LListBase, T > &lst)
 Copy assignment. More...
 
void operator= (LList< LListBase, T > &&lst)
 Move assignment. More...
 
void operator= (std::initializer_list< T > lst)
 Copy assignment from an initializer list. More...
 
IstreamreadList (Istream &is)
 Read list from Istream. More...
 
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write LList with line-breaks when length exceeds shortLen. More...
 
iterator begin ()
 Iterator to first item in list with non-const access. More...
 
const_iterator cbegin () const
 Iterator to first item in list with const access. More...
 
reverse_iterator rbegin ()
 Iterator to last item in list with non-const access. More...
 
const_reverse_iterator crbegin () const
 Iterator to last item in list with const access. More...
 
const_iterator begin () const
 Iterator to first item in list with const access. More...
 
const_reverse_iterator rbegin () const
 Iterator to last item in list with const access. More...
 
const iteratorend ()
 End of list for forward iterators. More...
 
const const_iteratorcend () const
 End of list for forward iterators. More...
 
const reverse_iteratorrend ()
 End of list for reverse iterators. More...
 
const const_reverse_iteratorcrend () const
 End of list for reverse iterators. More...
 
const const_iteratorend () const
 End of list for forward iterators. More...
 
const const_reverse_iteratorrend () const
 End of list for reverse iterators. More...
 
void insert (const T &elem)
 Add copy at front of list. Same as prepend() More...
 
void insert (T &&elem)
 Move construct at front of list. Same as prepend() More...
 

Friends

Istreamoperator>> (Istream &, LList< LListBase, T > &lst)
 Read list from Istream. More...
 
Ostreamoperator (Ostream &os, const LList< LListBase, T > &lst)
 

Detailed Description

template<class LListBase, class T>
class Foam::LList< LListBase, T >

Template class for non-intrusive linked lists.

Source files

Definition at line 76 of file LList.H.

Member Typedef Documentation

◆ value_type

typedef T value_type

Type of values stored.

Definition at line 85 of file LList.H.

◆ pointer

typedef T* pointer

Pointer for value_type.

Definition at line 88 of file LList.H.

◆ const_pointer

typedef const T* const_pointer

Const pointer for value_type.

Definition at line 91 of file LList.H.

◆ reference

typedef T& reference

Reference for value_type.

Definition at line 94 of file LList.H.

◆ const_reference

typedef const T& const_reference

Const reference for value_type.

Definition at line 97 of file LList.H.

◆ size_type

typedef label size_type

The type that can represent the container size.

Definition at line 100 of file LList.H.

◆ difference_type

typedef label difference_type

The difference between iterators.

Definition at line 103 of file LList.H.

◆ base_iterator

Definition at line 111 of file LList.H.

◆ const_base_iterator

Definition at line 112 of file LList.H.

Constructor & Destructor Documentation

◆ LList() [1/7]

LList ( )
default

Default construct.

◆ LList() [2/7]

LList ( const T elem)
inlineexplicit

Construct and copy add initial item.

Definition at line 177 of file LList.H.

References LList< LListBase, T >::prepend().

Here is the call graph for this function:

◆ LList() [3/7]

LList ( T &&  elem)
inlineexplicit

Construct and move add initial item.

Definition at line 183 of file LList.H.

References LList< LListBase, T >::prepend().

Here is the call graph for this function:

◆ LList() [4/7]

LList ( Istream is)
explicit

Construct from Istream.

Definition at line 36 of file LListIO.C.

References Foam::operator>>().

Here is the call graph for this function:

◆ LList() [5/7]

LList ( const LList< LListBase, T > &  lst)

Copy construct.

Definition at line 34 of file LList.C.

References LList< LListBase, T >::append(), and T.

Here is the call graph for this function:

◆ LList() [6/7]

LList ( LList< LListBase, T > &&  lst)

Move construct.

Definition at line 46 of file LList.C.

References kinematicSingleLayer::transfer().

Here is the call graph for this function:

◆ LList() [7/7]

LList ( std::initializer_list< T lst)

Copy construct from an initializer list.

Definition at line 55 of file LList.C.

References LList< LListBase, T >::append(), and T.

Here is the call graph for this function:

◆ ~LList()

Destructor.

Definition at line 69 of file LList.C.

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ first() [1/2]

reference first ( )
inline

The first entry in the list.

Definition at line 208 of file LList.H.

References ODESolver::stepState::first, and dictionary::Searcher< Const >::ref().

Referenced by FIFOStack< T >::bottom(), valueAverageBase::calc(), fieldAverageItem::calculateMeanField(), Foam::polyMeshZipUpCells(), and LIFOStack< T >::top().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ first() [2/2]

const_reference first ( ) const
inline

The first entry in the list (const access)

Definition at line 214 of file LList.H.

References ODESolver::stepState::first, and dictionary::Searcher< Const >::ref().

Here is the call graph for this function:

◆ last() [1/2]

reference last ( )
inline

The last entry in the list.

Definition at line 220 of file LList.H.

References ODESolver::stepState::last, and dictionary::Searcher< Const >::ref().

Referenced by LIFOStack< T >::bottom(), Foam::polyMeshZipUpCells(), and FIFOStack< T >::top().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ last() [2/2]

const_reference last ( ) const
inline

The last entry in the list (const access)

Definition at line 226 of file LList.H.

References ODESolver::stepState::last, and dictionary::Searcher< Const >::ref().

Here is the call graph for this function:

◆ prepend() [1/2]

void prepend ( const T elem)
inline

Add copy at front of list.

Definition at line 233 of file LList.H.

References PDRblock::gridControl::prepend().

Referenced by LList< LListBase, T >::insert(), LList< LListBase, T >::LList(), and LIFOStack< T >::push().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepend() [2/2]

void prepend ( T &&  elem)
inline

Move construct at front of list.

Definition at line 239 of file LList.H.

References PDRblock::gridControl::prepend().

Here is the call graph for this function:

◆ append() [1/2]

void append ( const T elem)
inline

Add copy at back of list.

Definition at line 245 of file LList.H.

References outputOptions::append().

Referenced by LList< LListBase, T >::LList(), Foam::polyMeshZipUpCells(), FIFOStack< T >::push(), Foam::blockMeshTools::read(), and LList< LListBase, T >::readList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ append() [2/2]

void append ( T &&  elem)
inline

Move construct at back of list.

Definition at line 251 of file LList.H.

References outputOptions::append().

Here is the call graph for this function:

◆ eraseHead()

bool eraseHead ( )
inline

Erase the first entry.

Definition at line 257 of file LList.H.

References bool, p, and LList< LListBase, T >::removeHead().

Here is the call graph for this function:

◆ removeHead()

T removeHead ( )
inline

Remove and return first entry.

Definition at line 265 of file LList.H.

References PackedList< Width >::remove(), and LList< LListBase, T >::removeHead().

Referenced by LList< LListBase, T >::eraseHead(), Foam::polyMeshZipUpCells(), FIFOStack< T >::pop(), LIFOStack< T >::pop(), CircularBuffer< T >::readList(), UList< T >::readList(), LList< LListBase, T >::removeHead(), and UILList< LListBase, T >::removeHead().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove() [1/2]

T remove ( link item)
inline

Remove and return element.

Definition at line 271 of file LList.H.

References PackedList< Width >::remove().

Here is the call graph for this function:

◆ remove() [2/2]

T remove ( iterator iter)
inline

Remove and return element specified by iterator.

Definition at line 277 of file LList.H.

References PackedList< Width >::remove().

Here is the call graph for this function:

◆ clear()

void clear

Delete contents of list.

Definition at line 78 of file LList.C.

References interfaceDefinitions::clear().

Referenced by LList< LListBase, T >::readList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transfer()

void transfer ( LList< LListBase, T > &  lst)

Transfer the contents of the argument into this List and annul the argument list.

Definition at line 92 of file LList.C.

References clear(), and kinematicSingleLayer::transfer().

Here is the call graph for this function:

◆ operator=() [1/3]

void operator= ( const LList< LListBase, T > &  lst)

Copy assignment.

Definition at line 102 of file LList.C.

References append(), clear(), and T.

Here is the call graph for this function:

◆ operator=() [2/3]

void operator= ( LList< LListBase, T > &&  lst)

Move assignment.

Definition at line 114 of file LList.C.

References clear(), and kinematicSingleLayer::transfer().

Here is the call graph for this function:

◆ operator=() [3/3]

void operator= ( std::initializer_list< T lst)

Copy assignment from an initializer list.

Definition at line 123 of file LList.C.

References append(), clear(), and T.

Here is the call graph for this function:

◆ readList()

Foam::Istream & readList ( Istream is)

Read list from Istream.

Definition at line 45 of file LListIO.C.

References LList< LListBase, T >::append(), LList< LListBase, T >::clear(), Foam::exit(), IOstream::fatalCheck(), Foam::FatalIOError, FatalIOErrorInFunction, FUNCTION_NAME, token::info(), token::isLabel(), token::isPunctuation(), token::labelToken(), Istream::putBack(), Istream::readBeginList(), Istream::readEndList(), and T.

Here is the call graph for this function:

◆ writeList()

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 124 of file LListIO.C.

References FUNCTION_NAME, Foam::nl, os(), and T.

Here is the call graph for this function:

◆ begin() [1/2]

iterator begin ( )
inline

Iterator to first item in list with non-const access.

Definition at line 503 of file LList.H.

Referenced by FixedList< T, N >::FixedList(), and FixedList< T, N >::operator=().

Here is the caller graph for this function:

◆ cbegin()

const_iterator cbegin ( ) const
inline

Iterator to first item in list with const access.

Definition at line 509 of file LList.H.

Referenced by valueAverageBase::calc(), fieldAverageItem::calculateMeanField(), multivariateScheme< Type, Scheme >::multivariateScheme(), and multivariateSelectionScheme< Type >::multivariateSelectionScheme().

Here is the caller graph for this function:

◆ rbegin() [1/2]

reverse_iterator rbegin ( )
inline

Iterator to last item in list with non-const access.

Definition at line 515 of file LList.H.

◆ crbegin()

const_reverse_iterator crbegin ( ) const
inline

Iterator to last item in list with const access.

Definition at line 521 of file LList.H.

Referenced by LList< LListBase, T >::rbegin().

Here is the caller graph for this function:

◆ begin() [2/2]

const_iterator begin ( ) const
inline

Iterator to first item in list with const access.

Definition at line 527 of file LList.H.

References edgeFaceCirculator::cbegin().

Here is the call graph for this function:

◆ rbegin() [2/2]

const_reverse_iterator rbegin ( ) const
inline

Iterator to last item in list with const access.

Definition at line 533 of file LList.H.

References LList< LListBase, T >::crbegin().

Here is the call graph for this function:

◆ end() [1/2]

const iterator & end ( )
inline

End of list for forward iterators.

Definition at line 540 of file LList.H.

Referenced by namesList< T >::find().

Here is the caller graph for this function:

◆ cend()

const const_iterator & cend ( ) const
inline

End of list for forward iterators.

Definition at line 546 of file LList.H.

Referenced by LList< LListBase, T >::end().

Here is the caller graph for this function:

◆ rend() [1/2]

const reverse_iterator & rend ( )
inline

End of list for reverse iterators.

Definition at line 552 of file LList.H.

◆ crend()

const const_reverse_iterator & crend ( ) const
inline

End of list for reverse iterators.

Definition at line 558 of file LList.H.

Referenced by LList< LListBase, T >::rend().

Here is the caller graph for this function:

◆ end() [2/2]

const const_iterator & end ( ) const
inline

End of list for forward iterators.

Definition at line 564 of file LList.H.

References LList< LListBase, T >::cend().

Here is the call graph for this function:

◆ rend() [2/2]

const const_reverse_iterator & rend ( ) const
inline

End of list for reverse iterators.

Definition at line 570 of file LList.H.

References LList< LListBase, T >::crend().

Here is the call graph for this function:

◆ insert() [1/2]

void insert ( const T elem)
inline

Add copy at front of list. Same as prepend()

Definition at line 579 of file LList.H.

References LList< LListBase, T >::prepend().

Referenced by Foam::polyMeshZipUpCells().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ insert() [2/2]

void insert ( T &&  elem)
inline

Move construct at front of list. Same as prepend()

Definition at line 582 of file LList.H.

References LList< LListBase, T >::prepend().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator>>

Istream & operator>> ( Istream ,
LList< LListBase, T > &  lst 
)
friend

Read list from Istream.

◆ operator

Ostream & operator ( Ostream os,
const LList< LListBase, T > &  lst 
)
friend

Write LList to Ostream with line breaks, as per writeList with shortLen=-1


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