LList< LListBase, T > Class Template Reference

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

Inheritance 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 Treference
 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 iterator objects. 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 &item)
 Construct and copy insert the initial T item. More...
 
 LList (T &&item)
 Construct and move insert the initial T 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 insert (const T &item)
 Add copy at head of list. More...
 
void insert (T &&item)
 Move construct at head of list. More...
 
void append (const T &item)
 Add copy at tail of list. More...
 
void append (T &&item)
 Move construct at tail of list. More...
 
T removeHead ()
 Remove and return head. 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)
 Transfer the contents of the argument into this List. More...
 
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...
 

Public Attributes

const typedef Tconst_pointer
 Const pointer for value_type. More...
 
const typedef Tconst_reference
 Const reference for value_type. 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 54 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.

◆ reference

typedef T& reference

Reference for value_type.

Definition at line 94 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 iterator objects.

Definition at line 103 of file LList.H.

◆ base_iterator

using base_iterator = typename LListBase::iterator

Definition at line 111 of file LList.H.

◆ const_base_iterator

using const_base_iterator = typename LListBase::const_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 item)
inlineexplicit

Construct and copy insert the initial T item.

Definition at line 168 of file LList.H.

◆ LList() [3/7]

LList ( T &&  item)
inlineexplicit

Construct and move insert the initial T item.

Definition at line 174 of file LList.H.

◆ LList() [4/7]

LList ( Istream is)
explicit

Construct from Istream.

Definition at line 36 of file LListIO.C.

◆ LList() [5/7]

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

Copy construct.

Definition at line 33 of file LList.C.

◆ LList() [6/7]

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

Move construct.

Definition at line 45 of file LList.C.

◆ LList() [7/7]

LList ( std::initializer_list< T lst)

Copy construct from an initializer list.

Definition at line 54 of file LList.C.

◆ ~LList()

~LList ( )

Destructor.

Definition at line 68 of file LList.C.

Member Function Documentation

◆ first() [1/2]

reference first ( )
inline

The first entry in the list.

Definition at line 199 of file LList.H.

Referenced by FIFOStack< writeData * >::bottom(), LPtrList< LListBase, T >::first(), Foam::polyMeshZipUpCells(), and LIFOStack< T >::top().

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 205 of file LList.H.

◆ last() [1/2]

reference last ( )
inline

The last entry in the list.

Definition at line 211 of file LList.H.

Referenced by LIFOStack< T >::bottom(), LPtrList< LListBase, T >::last(), Foam::polyMeshZipUpCells(), and FIFOStack< writeData * >::top().

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 217 of file LList.H.

◆ insert() [1/2]

void insert ( const T item)
inline

Add copy at head of list.

Definition at line 224 of file LList.H.

Referenced by LList< Foam::chemPointISAT< CompType, ThermoType > * >::LList(), Foam::polyMeshZipUpCells(), and LIFOStack< T >::push().

Here is the caller graph for this function:

◆ insert() [2/2]

void insert ( T &&  item)
inline

Move construct at head of list.

Definition at line 230 of file LList.H.

◆ append() [1/2]

void append ( const T item)
inline

Add copy at tail of list.

Definition at line 237 of file LList.H.

Referenced by Foam::polyMeshZipUpCells(), FIFOStack< writeData * >::push(), Foam::blockMeshTools::read(), PtrList< transferModel >::readIstream(), and LList< Foam::chemPointISAT< CompType, ThermoType > * >::readList().

Here is the caller graph for this function:

◆ append() [2/2]

void append ( T &&  item)
inline

Move construct at tail of list.

Definition at line 243 of file LList.H.

◆ removeHead()

T removeHead ( )
inline

Remove and return head.

Definition at line 250 of file LList.H.

Referenced by Foam::polyMeshZipUpCells(), FIFOStack< writeData * >::pop(), LIFOStack< T >::pop(), and UList< Foam::wordRe >::readList().

Here is the caller graph for this function:

◆ remove() [1/2]

T remove ( link item)
inline

Remove and return element.

Definition at line 259 of file LList.H.

◆ remove() [2/2]

T remove ( iterator iter)
inline

Remove and return element specified by iterator.

Definition at line 268 of file LList.H.

◆ clear()

void clear ( )

Delete contents of list.

Definition at line 77 of file LList.C.

Referenced by LList< Foam::chemPointISAT< CompType, ThermoType > * >::readList().

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 90 of file LList.C.

◆ operator=() [1/3]

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

Copy assignment.

Definition at line 100 of file LList.C.

◆ operator=() [2/3]

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

Move assignment.

Definition at line 112 of file LList.C.

◆ operator=() [3/3]

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

Copy assignment from an initializer list.

Definition at line 121 of file LList.C.

◆ readList()

Foam::Istream & readList ( Istream is)

Read list from Istream.

Definition at line 45 of file LListIO.C.

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

◆ begin() [1/2]

iterator begin ( )
inline

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

Definition at line 497 of file LList.H.

Referenced by FixedList< Type, 3 >::FixedList(), and FixedList< Type, 3 >::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 503 of file LList.H.

Referenced by averageCondition::calc().

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 509 of file LList.H.

◆ crbegin()

const_reverse_iterator crbegin ( ) const
inline

Iterator to last item in list with const access.

Definition at line 515 of file LList.H.

Referenced by LList< Foam::chemPointISAT< CompType, ThermoType > * >::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 521 of file LList.H.

◆ rbegin() [2/2]

const_reverse_iterator rbegin ( ) const
inline

Iterator to last item in list with const access.

Definition at line 527 of file LList.H.

◆ end() [1/2]

const iterator& end ( )
inline

End of list for forward iterators.

Definition at line 534 of file LList.H.

Referenced by namesList< solutionEntry >::find(), and Foam::polyMeshZipUpCells().

Here is the caller graph for this function:

◆ cend()

const const_iterator& cend ( ) const
inline

End of list for forward iterators.

Definition at line 540 of file LList.H.

Referenced by LList< Foam::chemPointISAT< CompType, ThermoType > * >::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 546 of file LList.H.

◆ crend()

const const_reverse_iterator& crend ( ) const
inline

End of list for reverse iterators.

Definition at line 552 of file LList.H.

Referenced by LList< Foam::chemPointISAT< CompType, ThermoType > * >::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 558 of file LList.H.

◆ rend() [2/2]

const const_reverse_iterator& rend ( ) const
inline

End of list for reverse iterators.

Definition at line 564 of file LList.H.

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

Member Data Documentation

◆ const_pointer

const typedef T* const_pointer

Const pointer for value_type.

Definition at line 91 of file LList.H.

◆ const_reference

const typedef T& const_reference

Const reference for value_type.

Definition at line 97 of file LList.H.


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