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;
341 const link*
last()
const {
return back(); }
A primitive const node iterator (bidirectional).
void next()
Move forward through list.
bool good() const noexcept
Pointing at a valid storage node.
const_iterator(const const_iterator &)=default
Copy construct.
void prev()
Move backward through list.
A primitive non-const node iterator.
void next()
Move forward through list.
bool good() const noexcept
Pointing at a valid storage node.
friend class const_iterator
iterator(const iterator &)=default
Copy construct.
void prev()
Move backward through list.
link * get_node() const noexcept
The storage node.
Base for doubly-linked lists.
link * last()
Return last entry.
~DLListBase()=default
Destructor.
const const_iterator & cend() const
End of list for iterators.
link * front()
Return first entry.
link * first()
Return first entry.
const const_iterator & crend() const
End of list for reverse iterators.
void transfer(DLListBase &lst)
Transfer the contents of the argument into this list and annul the argument list.
link * back()
Return last entry.
bool empty() const noexcept
True if the list is empty.
void push_back(link *item)
Add at back of list.
const link * last() const
Return const access to last entry.
link * replace(link *oldLink, link *newLink)
Replace oldLink with newLink and return element.
const link * first() const
Return const access to first entry.
IteratorType iterator_first() const
Return iterator to first item or end-iterator if list is empty.
DLListBase(const DLListBase &)=delete
No copy construct.
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.
void operator=(const DLListBase &)=delete
No copy assignment.
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.
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.
DLListBase()=default
Default construct.
void append(link *item)
Add at back of list.
label size() const noexcept
The number of elements in list.
void clear()
Clear the list.
void push_front(link *item)
Add at front of 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 common C++ headers, defines global macros and templates used in multiple places by Open...
The structure for a doubly-linked storage node.
bool registered() const noexcept
Node registered (linked) in a list?
link() noexcept=default
Default construct.
link * next_
Pointer to next entry in list.
link * prev_
Pointer to prev entry in list.
void deregister() noexcept
Deregister the node (after removal).