Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
DLListBase Class Reference

Base for doubly-linked lists. More...

Classes

class  const_iterator
 
class  iterator
 
struct  link
 

Public Member Functions

 DLListBase ()=default
 
 DLListBase (const DLListBase &)=delete
 
void operator= (const DLListBase &)=delete
 
 ~DLListBase ()=default
 
label size () const noexcept
 
bool empty () const noexcept
 
linkfirst ()
 
const linkfirst () const
 
linklast ()
 
const linklast () const
 
void insert (link *item)
 
void append (link *item)
 
bool swapUp (link *item)
 
bool swapDown (link *item)
 
linkremoveHead ()
 
linkremove (link *item)
 
linkremove (iterator &iter)
 
linkreplace (link *oldLink, link *newLink)
 
linkreplace (iterator &oldIter, link *newitem)
 
void clear ()
 
void swap (DLListBase &lst)
 
void transfer (DLListBase &lst)
 
iterator begin ()
 
const_iterator cbegin () const
 
const_iterator crbegin () const
 
const iteratorend ()
 
const const_iteratorcend () const
 
const const_iteratorcrend () const
 

Protected Member Functions

template<class IteratorType >
IteratorType iterator_first () const
 
template<class IteratorType >
IteratorType iterator_last () const
 

Static Protected Member Functions

template<class IteratorType >
static const IteratorType & iterator_end ()
 
template<class IteratorType >
static const IteratorType & iterator_rend ()
 

Friends

class iterator
 
class const_iterator
 

Detailed Description

Base for doubly-linked lists.

The iterators associated with the list only have a core functionality for navigation, with additional functionality to be added by inheriting classes. The node iterators always have a node-pointer as the first member data, which allows reinterpret_cast from anything else with a nullptr as its first data member. The nullObject is such an item (with a nullptr data member).

Source files

Definition at line 57 of file DLListBase.H.

Constructor & Destructor Documentation

◆ DLListBase() [1/2]

DLListBase ( )
default

◆ DLListBase() [2/2]

DLListBase ( const DLListBase )
delete

◆ ~DLListBase()

~DLListBase ( )
default

Member Function Documentation

◆ iterator_end()

const IteratorType & iterator_end
inlinestaticprotected

Definition at line 28 of file DLListBaseI.H.

References Foam::nullObjectPtr.

◆ iterator_rend()

const IteratorType & iterator_rend
inlinestaticprotected

Definition at line 35 of file DLListBaseI.H.

References Foam::nullObjectPtr.

◆ iterator_first()

IteratorType iterator_first
inlineprotected

Definition at line 42 of file DLListBaseI.H.

◆ iterator_last()

IteratorType iterator_last
inlineprotected

Definition at line 57 of file DLListBaseI.H.

◆ operator=()

void operator= ( const DLListBase )
delete

◆ size()

Foam::label size ( ) const
inlinenoexcept

Definition at line 107 of file DLListBaseI.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

Definition at line 113 of file DLListBaseI.H.

◆ first() [1/2]

const Foam::DLListBase::link * first ( )
inline

Definition at line 120 of file DLListBaseI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ first() [2/2]

const link* first ( ) const
inline

◆ last() [1/2]

const Foam::DLListBase::link * last ( )
inline

Definition at line 146 of file DLListBaseI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ last() [2/2]

const link* last ( ) const
inline

◆ insert()

void insert ( DLListBase::link item)

Definition at line 27 of file DLListBase.C.

References DLListBase::link::next_, and DLListBase::link::prev_.

◆ append()

void append ( DLListBase::link item)

Definition at line 52 of file DLListBase.C.

References DLListBase::link::next_, and DLListBase::link::prev_.

◆ swapUp()

bool swapUp ( DLListBase::link a)

Definition at line 77 of file DLListBase.C.

References DLListBase::link::next_, and DLListBase::link::prev_.

◆ swapDown()

bool swapDown ( DLListBase::link a)

Definition at line 116 of file DLListBase.C.

References DLListBase::link::next_, and DLListBase::link::prev_.

◆ removeHead()

Foam::DLListBase::link * removeHead ( )

Definition at line 155 of file DLListBase.C.

References Foam::abort(), DLListBase::link::deregister(), Foam::FatalError, FatalErrorInFunction, and DLListBase::link::next_.

Here is the call graph for this function:

◆ remove() [1/2]

Definition at line 179 of file DLListBase.C.

References DLListBase::link::deregister(), DLListBase::link::next_, and DLListBase::link::prev_.

Here is the call graph for this function:

◆ remove() [2/2]

Foam::DLListBase::link * remove ( DLListBase::iterator iter)
inline

Definition at line 209 of file DLListBaseI.H.

◆ replace() [1/2]

Foam::DLListBase::link * replace ( DLListBase::link oldLink,
DLListBase::link newLink 
)

Definition at line 212 of file DLListBase.C.

References DLListBase::link::deregister(), DLListBase::link::next_, and DLListBase::link::prev_.

Here is the call graph for this function:

◆ replace() [2/2]

Foam::DLListBase::link * replace ( DLListBase::iterator oldIter,
DLListBase::link newItem 
)
inline

Definition at line 219 of file DLListBaseI.H.

◆ clear()

void clear ( )
inline

Definition at line 171 of file DLListBaseI.H.

Referenced by DLListBase::transfer().

Here is the caller graph for this function:

◆ swap()

void swap ( DLListBase lst)
inline

Definition at line 179 of file DLListBaseI.H.

◆ transfer()

void transfer ( DLListBase lst)
inline

Definition at line 192 of file DLListBaseI.H.

References DLListBase::clear().

Here is the call graph for this function:

◆ begin()

Foam::DLListBase::iterator begin ( )
inline

Definition at line 319 of file DLListBaseI.H.

References stdFoam::end().

Here is the call graph for this function:

◆ cbegin()

Foam::DLListBase::const_iterator cbegin ( ) const
inline

Definition at line 417 of file DLListBaseI.H.

References stdFoam::cend().

Here is the call graph for this function:

◆ crbegin()

Foam::DLListBase::const_iterator crbegin ( ) const
inline

Definition at line 429 of file DLListBaseI.H.

References stdFoam::crend().

Here is the call graph for this function:

◆ end()

const Foam::DLListBase::iterator & end ( )
inline

Definition at line 73 of file DLListBaseI.H.

◆ cend()

const Foam::DLListBase::const_iterator & cend ( ) const
inline

Definition at line 80 of file DLListBaseI.H.

◆ crend()

const Foam::DLListBase::const_iterator & crend ( ) const
inline

Definition at line 87 of file DLListBaseI.H.

Friends And Related Function Documentation

◆ iterator

friend class iterator
friend

Definition at line 124 of file DLListBase.H.

◆ const_iterator

friend class const_iterator
friend

Definition at line 127 of file DLListBase.H.


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