Data Structures | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
DLListBase Class Reference

Base doubly-linked list. More...

Collaboration diagram for DLListBase:
Collaboration graph
[legend]

Data Structures

class  const_iterator
 An STL-conforming const_iterator. More...
 
class  const_reverse_iterator
 An STL-conforming const_reverse_iterator. More...
 
class  iterator
 An STL-conforming iterator. More...
 
struct  link
 Link structure. More...
 

Public Member Functions

 DLListBase ()
 Null construct. More...
 
 DLListBase (link *)
 Construct given initial entry. More...
 
 ~DLListBase ()
 Destructor. More...
 
label size () const
 Return number of elements in list. More...
 
bool empty () const
 Return true if the list is empty. More...
 
linkfirst ()
 Return first entry. More...
 
const linkfirst () const
 Return const access to first entry. More...
 
linklast ()
 Return last entry. More...
 
const linklast () const
 Return const access to last entry. More...
 
void insert (link *)
 Add at head of list. More...
 
void append (link *)
 Add at tail of list. More...
 
bool swapUp (link *)
 Swap this element with the one above unless it is at the top. More...
 
bool swapDown (link *)
 Swap this element with the one below unless it is at the bottom. More...
 
linkremoveHead ()
 Remove and return head. More...
 
linkremove (link *)
 Remove and return element. More...
 
linkremove (iterator &)
 
linkreplace (link *oldLink, link *newLink)
 Replace oldLink with newLink and return element. More...
 
linkreplace (iterator &oldIter, link *newLink)
 Replace oldIter with newLink and return element. More...
 
void clear ()
 Clear the list. More...
 
void transfer (DLListBase &)
 Transfer the contents of the argument into this List. More...
 
iterator begin ()
 
const iteratorend ()
 
const_iterator cbegin () const
 
const const_iteratorcend () const
 
const_iterator begin () const
 
const const_iteratorend () const
 
const_reverse_iterator crbegin () const
 
const const_reverse_iteratorcrend () const
 
const_reverse_iterator rbegin () const
 
const const_reverse_iteratorrend () const
 

Private Member Functions

 DLListBase (const DLListBase &)
 Disallow default bitwise copy construct. More...
 
void operator= (const DLListBase &)
 Disallow default bitwise assignment. More...
 

Private Attributes

linkfirst_
 first_ points to first element and last_ points to last element. More...
 
linklast_
 
label nElmts_
 Number of elements in in list. More...
 

Static Private Attributes

static iterator endIter_
 Iterator returned by end() More...
 
static const_iterator endConstIter_
 const_iterator returned by end() More...
 
static const_reverse_iterator endConstRevIter_
 const_reverse_iterator returned by end() More...
 

Friends

class iterator
 
class const_iterator
 
class const_reverse_iterator
 

Detailed Description

Base doubly-linked list.

Source files

Definition at line 50 of file DLListBase.H.

Constructor & Destructor Documentation

◆ DLListBase() [1/3]

DLListBase ( const DLListBase )
private

Disallow default bitwise copy construct.

◆ DLListBase() [2/3]

DLListBase ( )
inline

Null construct.

Definition at line 37 of file DLListBaseI.H.

◆ DLListBase() [3/3]

DLListBase ( link a)
inline

Construct given initial entry.

Definition at line 45 of file DLListBaseI.H.

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

◆ ~DLListBase()

~DLListBase ( )
inline

Destructor.

Definition at line 58 of file DLListBaseI.H.

Member Function Documentation

◆ operator=()

void operator= ( const DLListBase )
private

Disallow default bitwise assignment.

◆ size()

Foam::label size ( ) const
inline

Return number of elements in list.

Definition at line 77 of file DLListBaseI.H.

Referenced by DLListBase::begin(), DLListBase::cbegin(), and DLListBase::crbegin().

Here is the caller graph for this function:

◆ empty()

bool empty ( ) const
inline

Return true if the list is empty.

Definition at line 83 of file DLListBaseI.H.

◆ first() [1/2]

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

Return first entry.

Definition at line 90 of file DLListBaseI.H.

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

Referenced by DLListBase::begin(), and DLListBase::cbegin().

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

◆ first() [2/2]

const link* first ( ) const
inline

Return const access to first entry.

◆ last() [1/2]

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

Return last entry.

Definition at line 116 of file DLListBaseI.H.

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

Referenced by DLListBase::crbegin().

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

◆ last() [2/2]

const link* last ( ) const
inline

Return const access to last entry.

◆ insert()

void insert ( DLListBase::link a)

Add at head of list.

Definition at line 53 of file DLListBase.C.

References DLListBase::first_, DLListBase::last_, DLListBase::nElmts_, DLListBase::link::next_, and DLListBase::link::prev_.

◆ append()

void append ( DLListBase::link a)

Add at tail of list.

Definition at line 73 of file DLListBase.C.

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

◆ swapUp()

bool swapUp ( DLListBase::link a)

Swap this element with the one above unless it is at the top.

Definition at line 93 of file DLListBase.C.

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

◆ swapDown()

bool swapDown ( DLListBase::link a)

Swap this element with the one below unless it is at the bottom.

Definition at line 134 of file DLListBase.C.

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

◆ removeHead()

Foam::DLListBase::link * removeHead ( )

Remove and return head.

Definition at line 175 of file DLListBase.C.

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

Here is the call graph for this function:

◆ remove() [1/2]

Remove and return element.

Definition at line 199 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 it)
inline

Definition at line 161 of file DLListBaseI.H.

References DLListBase::iterator::curElmt_.

◆ replace() [1/2]

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

Replace oldLink with newLink and return element.

Definition at line 232 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 newLink 
)
inline

Replace oldIter with newLink and return element.

Definition at line 171 of file DLListBaseI.H.

References DLListBase::iterator::curElmt_.

◆ clear()

void clear ( )
inline

Clear the list.

Definition at line 141 of file DLListBaseI.H.

Referenced by DLListBase::transfer().

Here is the caller graph for this function:

◆ transfer()

void transfer ( DLListBase lst)
inline

Transfer the contents of the argument into this List.

and annul the argument list.

Definition at line 149 of file DLListBaseI.H.

References DLListBase::clear(), DLListBase::first_, DLListBase::last_, and DLListBase::nElmts_.

Here is the call graph for this function:

◆ begin() [1/2]

Definition at line 253 of file DLListBaseI.H.

References DLListBase::endIter_, DLListBase::first(), DLListBase::iterator, and DLListBase::size().

Here is the call graph for this function:

◆ end() [1/2]

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

Definition at line 266 of file DLListBaseI.H.

References DLListBase::endIter_.

◆ cbegin()

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

Definition at line 352 of file DLListBaseI.H.

References DLListBase::const_iterator, DLListBase::endConstIter_, DLListBase::first(), and DLListBase::size().

Here is the call graph for this function:

◆ cend()

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

Definition at line 366 of file DLListBaseI.H.

References DLListBase::endConstIter_.

◆ begin() [2/2]

const_iterator begin ( ) const
inline

◆ end() [2/2]

const const_iterator& end ( ) const
inline

◆ crbegin()

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

Definition at line 459 of file DLListBaseI.H.

References DLListBase::const_reverse_iterator, DLListBase::endConstRevIter_, DLListBase::last(), and DLListBase::size().

Referenced by DLListBase::rbegin().

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

◆ crend()

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

Definition at line 473 of file DLListBaseI.H.

References DLListBase::endConstRevIter_.

◆ rbegin()

Definition at line 480 of file DLListBaseI.H.

References DLListBase::crbegin().

Here is the call graph for this function:

◆ rend()

const Foam::DLListBase::const_reverse_iterator & rend ( ) const
inline

Definition at line 487 of file DLListBaseI.H.

References DLListBase::endConstRevIter_.

Friends And Related Function Documentation

◆ iterator

friend class iterator
friend

Definition at line 96 of file DLListBase.H.

Referenced by DLListBase::begin().

◆ const_iterator

friend class const_iterator
friend

Definition at line 99 of file DLListBase.H.

Referenced by DLListBase::cbegin().

◆ const_reverse_iterator

friend class const_reverse_iterator
friend

Definition at line 102 of file DLListBase.H.

Referenced by DLListBase::crbegin().

Field Documentation

◆ first_

link* first_
private

first_ points to first element and last_ points to last element.

Definition at line 77 of file DLListBase.H.

Referenced by DLListBase::insert(), and DLListBase::transfer().

◆ last_

link * last_
private

Definition at line 77 of file DLListBase.H.

Referenced by DLListBase::insert(), and DLListBase::transfer().

◆ nElmts_

label nElmts_
private

Number of elements in in list.

Definition at line 80 of file DLListBase.H.

Referenced by DLListBase::insert(), and DLListBase::transfer().

◆ endIter_

Foam::DLListBase::iterator endIter_
staticprivate

Iterator returned by end()

Definition at line 307 of file DLListBase.H.

Referenced by DLListBase::begin(), and DLListBase::end().

◆ endConstIter_

Foam::DLListBase::const_iterator endConstIter_
staticprivate

const_iterator returned by end()

Definition at line 310 of file DLListBase.H.

Referenced by DLListBase::cbegin(), and DLListBase::cend().

◆ endConstRevIter_

Foam::DLListBase::const_reverse_iterator endConstRevIter_
staticprivate

const_reverse_iterator returned by end()

Definition at line 313 of file DLListBase.H.

Referenced by DLListBase::crbegin(), DLListBase::crend(), and DLListBase::rend().


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