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

Base for singly-linked lists. More...

Classes

class  const_iterator
 
class  iterator
 
struct  link
 

Public Member Functions

 SLListBase ()=default
 
 SLListBase (const SLListBase &)=delete
 
void operator= (const SLListBase &)=delete
 
 ~SLListBase ()=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)
 
linkremoveHead ()
 
linkremove (link *item)
 
linkremove (iterator &iter)
 
void clear ()
 
void swap (SLListBase &lst)
 
void transfer (SLListBase &lst)
 
iterator begin ()
 
const_iterator cbegin () const
 
const_iterator crbegin () const =delete
 
const iteratorend ()
 
const const_iteratorcend () const
 
const const_iteratorcrend () const =delete
 

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 ()=delete
 

Friends

class iterator
 
class const_iterator
 

Detailed Description

Base for singly-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 SLListBase.H.

Constructor & Destructor Documentation

◆ SLListBase() [1/2]

SLListBase ( )
default

◆ SLListBase() [2/2]

SLListBase ( const SLListBase )
delete

◆ ~SLListBase()

~SLListBase ( )
default

Member Function Documentation

◆ iterator_end()

const IteratorType & iterator_end
inlinestaticprotected

Definition at line 28 of file SLListBaseI.H.

References Foam::nullObjectPtr.

◆ iterator_rend()

static const IteratorType& iterator_rend ( )
staticprotecteddelete

◆ iterator_first()

IteratorType iterator_first
inlineprotected

Definition at line 35 of file SLListBaseI.H.

◆ iterator_last()

IteratorType iterator_last
inlineprotected

Definition at line 50 of file SLListBaseI.H.

◆ operator=()

void operator= ( const SLListBase )
delete

◆ size()

Foam::label size ( ) const
inlinenoexcept

Definition at line 66 of file SLListBaseI.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

Definition at line 72 of file SLListBaseI.H.

◆ first() [1/2]

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

Definition at line 79 of file SLListBaseI.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::SLListBase::link * last ( )
inline

Definition at line 105 of file SLListBaseI.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 ( SLListBase::link item)

Definition at line 27 of file SLListBase.C.

References SLListBase::link::next_.

◆ append()

void append ( SLListBase::link item)

Definition at line 49 of file SLListBase.C.

References SLListBase::link::next_.

◆ removeHead()

Foam::SLListBase::link * removeHead ( )

Definition at line 70 of file SLListBase.C.

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

Here is the call graph for this function:

◆ remove() [1/2]

Definition at line 96 of file SLListBase.C.

References stdFoam::begin(), stdFoam::end(), SLListBase::iterator::get_node(), SLListBase::iterator::next(), SLListBase::link::next_, and p.

Here is the call graph for this function:

◆ remove() [2/2]

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

Definition at line 164 of file SLListBaseI.H.

References SLListBase::remove().

Referenced by SLListBase::remove().

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

◆ clear()

void clear ( )
inline

Definition at line 130 of file SLListBaseI.H.

Referenced by SLListBase::transfer().

Here is the caller graph for this function:

◆ swap()

void swap ( SLListBase lst)
inline

Definition at line 137 of file SLListBaseI.H.

◆ transfer()

void transfer ( SLListBase lst)
inline

Definition at line 149 of file SLListBaseI.H.

References SLListBase::clear().

Here is the call graph for this function:

◆ begin()

Foam::SLListBase::iterator begin ( )
inline

Definition at line 242 of file SLListBaseI.H.

References stdFoam::end().

Here is the call graph for this function:

◆ cbegin()

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

Definition at line 338 of file SLListBaseI.H.

References stdFoam::cend().

Here is the call graph for this function:

◆ crbegin()

const_iterator crbegin ( ) const
delete

◆ end()

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

Definition at line 254 of file SLListBaseI.H.

◆ cend()

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

Definition at line 261 of file SLListBaseI.H.

◆ crend()

const const_iterator& crend ( ) const
delete

Friends And Related Function Documentation

◆ iterator

friend class iterator
friend

Definition at line 112 of file SLListBase.H.

◆ const_iterator

friend class const_iterator
friend

Definition at line 115 of file SLListBase.H.


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