UILList< LListBase, T > Class Template Reference

Template class for intrusive linked lists. More...

Inheritance diagram for UILList< LListBase, T >:
Collaboration diagram for UILList< LListBase, T >:

Classes

class  const_iterator
 A const_iterator. More...
 
class  const_reverse_iterator
 A const_reverse_iterator, for LListBase classes that support reverse iteration. More...
 
class  iterator
 A non-const iterator. More...
 
class  reverse_iterator
 A reverse_iterator, for LListBase classes that support reverse iteration. More...
 

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 iterator objects. More...
 
using base_iterator = typename LListBase::iterator
 
using const_base_iterator = typename LListBase::const_iterator
 

Public Member Functions

 UILList ()=default
 Default construct. More...
 
 UILList (T *item)
 Construct and add initial item pointer. More...
 
 UILList (const UILList< LListBase, T > &list)
 Construct as copy. More...
 
Tfront ()
 The first entry in the list. More...
 
const Tfront () const
 The first entry in the list (const access) More...
 
Tback ()
 The last entry in the list. More...
 
const Tback () const
 The last entry in the list (const access) More...
 
TremoveHead ()
 Remove and return head. More...
 
Tremove (T *item)
 Remove and return element. More...
 
Tremove (iterator &iter)
 Remove and return item specified by iterator. More...
 
void operator= (const UILList< LListBase, T > &lst)
 Copy assignment. More...
 
bool operator== (const UILList< LListBase, T > &lst) const
 Equality. True both lists are element-wise equal. More...
 
bool operator!= (const UILList< LListBase, T > &lst) const
 The opposite of the equality operation. Takes linear time. More...
 
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write UILList 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...
 
Tfirst ()
 The first entry in the list. More...
 
const Tfirst () const
 The first entry in the list (const access) More...
 
Tlast ()
 The last entry in the list. More...
 
const Tlast () const
 The last entry in the list (const access) More...
 

Friends

Ostreamoperator (Ostream &os, const UILList< LListBase, T > &lst)
 Write UILList to Ostream with line breaks, as per writeList() with shortLen=-1. More...
 

Detailed Description

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

Template class for intrusive linked lists.

Source files

Definition at line 47 of file UILList.H.

Member Typedef Documentation

◆ value_type

typedef T value_type

Type of values stored.

Definition at line 73 of file UILList.H.

◆ pointer

typedef T* pointer

Pointer for value_type.

Definition at line 78 of file UILList.H.

◆ const_pointer

typedef const T* const_pointer

Const pointer for value_type.

Definition at line 83 of file UILList.H.

◆ reference

typedef T& reference

Reference for value_type.

Definition at line 88 of file UILList.H.

◆ const_reference

typedef const T& const_reference

Const reference for value_type.

Definition at line 93 of file UILList.H.

◆ size_type

typedef label size_type

The type that can represent the container size.

Definition at line 98 of file UILList.H.

◆ difference_type

typedef label difference_type

The difference between iterator objects.

Definition at line 103 of file UILList.H.

◆ base_iterator

using base_iterator = typename LListBase::iterator

Definition at line 111 of file UILList.H.

◆ const_base_iterator

using const_base_iterator = typename LListBase::const_iterator

Definition at line 112 of file UILList.H.

Constructor & Destructor Documentation

◆ UILList() [1/3]

UILList ( )
default

Default construct.

◆ UILList() [2/3]

UILList ( T item)
inlineexplicit

Construct and add initial item pointer.

Definition at line 125 of file UILList.H.

◆ UILList() [3/3]

UILList ( const UILList< LListBase, T > &  list)

Construct as copy.

Definition at line 27 of file UILList.C.

References UILList< LListBase, T >::cbegin(), and UILList< LListBase, T >::cend().

Here is the call graph for this function:

Member Function Documentation

◆ front() [1/2]

T* front ( )
inline

The first entry in the list.

Definition at line 141 of file UILList.H.

References Foam::T().

Referenced by boxToCell::boxToCell(), boxToFace::boxToFace(), boxToPoint::boxToPoint(), and UILList< LListBase, T >::first().

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

◆ front() [2/2]

const T* front ( ) const
inline

The first entry in the list (const access)

Definition at line 149 of file UILList.H.

References Foam::T().

Here is the call graph for this function:

◆ back() [1/2]

T* back ( )
inline

The last entry in the list.

Definition at line 157 of file UILList.H.

References Foam::T().

Referenced by UILList< LListBase, T >::last().

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

◆ back() [2/2]

const T* back ( ) const
inline

The last entry in the list (const access)

Definition at line 165 of file UILList.H.

References Foam::T().

Here is the call graph for this function:

◆ removeHead()

T* removeHead ( )
inline

Remove and return head.

Definition at line 174 of file UILList.H.

References Foam::T().

Here is the call graph for this function:

◆ remove() [1/2]

T* remove ( T item)
inline

Remove and return element.

Definition at line 182 of file UILList.H.

References Foam::T().

Here is the call graph for this function:

◆ remove() [2/2]

T* remove ( iterator iter)
inline

Remove and return item specified by iterator.

Definition at line 190 of file UILList.H.

References Foam::T().

Here is the call graph for this function:

◆ operator=()

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

Copy assignment.

Definition at line 39 of file UILList.C.

References UILList< LListBase, T >::cbegin(), UILList< LListBase, T >::cend(), and clear().

Here is the call graph for this function:

◆ operator==()

bool operator== ( const UILList< LListBase, T > &  lst) const

Equality. True both lists are element-wise equal.

(using value_type::operator==). Takes linear time.

Definition at line 52 of file UILList.C.

References stdFoam::cbegin(), UILList< LListBase, T >::cbegin(), and stdFoam::cend().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const UILList< LListBase, T > &  lst) const

The opposite of the equality operation. Takes linear time.

Definition at line 77 of file UILList.C.

References Foam::operator==().

Here is the call graph for this function:

◆ writeList()

Foam::Ostream & writeList ( Ostream os,
const label  shortLen = 0 
) const

Write UILList with line-breaks when length exceeds shortLen.

Using '0' suppresses line-breaks entirely.

Definition at line 30 of file UILListIO.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 440 of file UILList.H.

◆ cbegin()

const_iterator cbegin ( ) const
inline

Iterator to first item in list with const access.

Definition at line 448 of file UILList.H.

Referenced by UILList< LListBase, T >::operator=(), UILList< LListBase, T >::operator==(), and UILList< LListBase, T >::UILList().

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 456 of file UILList.H.

◆ crbegin()

const_reverse_iterator crbegin ( ) const
inline

Iterator to last item in list with const access.

Definition at line 464 of file UILList.H.

Referenced by UILList< 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 472 of file UILList.H.

References stdFoam::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 480 of file UILList.H.

References UILList< 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 489 of file UILList.H.

Referenced by KirchhoffShell::solveDisplacement().

Here is the caller graph for this function:

◆ cend()

const const_iterator& cend ( ) const
inline

End of list for forward iterators.

Definition at line 497 of file UILList.H.

Referenced by UILList< LListBase, T >::end(), UILList< LListBase, T >::operator=(), and UILList< LListBase, T >::UILList().

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 505 of file UILList.H.

◆ crend()

const const_reverse_iterator& crend ( ) const
inline

End of list for reverse iterators.

Definition at line 513 of file UILList.H.

Referenced by UILList< 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 521 of file UILList.H.

References UILList< 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 529 of file UILList.H.

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

Here is the call graph for this function:

◆ first() [1/2]

T* first ( )
inline

The first entry in the list.

FOAM_DEPRECATED_FOR(2022-10, "front()")

Definition at line 542 of file UILList.H.

References UILList< LListBase, T >::front().

Referenced by meshRefinement::lookup().

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

◆ first() [2/2]

const T* first ( ) const
inline

The first entry in the list (const access)

FOAM_DEPRECATED_FOR(2022-10, "front()")

Definition at line 549 of file UILList.H.

References UILList< LListBase, T >::front().

Here is the call graph for this function:

◆ last() [1/2]

T* last ( )
inline

The last entry in the list.

FOAM_DEPRECATED_FOR(2022-10, "back()")

Definition at line 556 of file UILList.H.

References UILList< LListBase, T >::back().

Here is the call graph for this function:

◆ last() [2/2]

const T* last ( ) const
inline

The last entry in the list (const access)

FOAM_DEPRECATED_FOR(2022-10, "back()")

Definition at line 563 of file UILList.H.

References UILList< LListBase, T >::back().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator

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

Write UILList to Ostream with line breaks, as per writeList() with shortLen=-1.


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