46#ifndef Foam_DLListBase_H
47#define Foam_DLListBase_H
91 link* first_ =
nullptr;
94 link* last_ =
nullptr;
106 template<class IteratorType>
111 template<class IteratorType>
116 template<class IteratorType>
121 template<class IteratorType>
250 inline
void operator=(const
iterator& iter);
252 inline
bool operator==(const
iterator&) const;
253 inline
bool operator!=(const
iterator&) const;
332#include "DLListBaseI.H"
A primitive const node iterator (bidirectional).
const_iterator(const const_iterator &)=default
Copy construct.
A primitive non-const node iterator.
iterator(const iterator &)=default
Copy construct.
Base for doubly-linked lists.
const const_iterator & cend() const
End of list for iterators.
link * first()
Return first entry.
const const_iterator & crend() const
End of list for reverse iterators.
void transfer(DLListBase &lst)
bool empty() const noexcept
True if the list is empty.
link * last()
Return last entry.
link * replace(link *oldLink, link *newLink)
Replace oldLink with newLink and return element.
IteratorType iterator_first() const
Return iterator to first item or end-iterator if list is empty.
void swap(DLListBase &lst)
Swap the contents of the list.
void prepend(link *item)
Add at front of list.
const iterator & end()
End of list for iterators.
static const IteratorType & iterator_end()
Factory method to return an iterator end.
bool swapDown(link *item)
Swap this element with the one below unless it is at the bottom.
label size() const noexcept
The number of elements in list.
iterator begin()
Iterator to first item in list with non-const access.
IteratorType iterator_last() const
Return iterator to last item or end-iterator if list is empty.
static const IteratorType & iterator_rend()
Factory method to return an iterator reverse end.
link * removeHead()
Remove and return first entry.
const_iterator cbegin() const
Iterator to first item in list with const access.
void append(link *item)
Add at back of list.
void clear()
Clear the list.
link * remove(link *item)
Remove and return element.
const_iterator crbegin() const
Iterator to last item in list with const access.
bool swapUp(link *item)
Swap this element with the one above unless it is at the top.
Includes some standard C++ headers, defines global macros and templates used in multiple places by Op...
The structure for a doubly-linked storage node.
link()=default
Default construct.
bool registered() const noexcept
Check if the node is registered with the list.
link * next_
Pointer to next entry in list.
link * prev_
Pointer to prev entry in list.
void deregister() noexcept
Deregister the node after removal.