34 template<
class IteratorType>
41 template<
class IteratorType>
48 return IteratorType(list, const_cast<SLListBase::link*>(last_->next_));
52 return IteratorType(list,
nullptr);
56 template<
class IteratorType>
63 return IteratorType(list, const_cast<SLListBase::link*>(last_));
67 return IteratorType(list,
nullptr);
139 std::swap(last_, lst.last_);
140 std::swap(size_, lst.size_);
163 return remove(iter.node_);
179 if (node_ !=
nullptr)
195 return (node_ !=
nullptr);
203 if (node_ == list_->last_ || list_->last_ ==
nullptr)
226 return node_ == iter.node_;
232 return node_ != iter.node_;
241 return iterator_first<iterator>();
251 return iterator_end<SLListBase::iterator>();
258 return iterator_end<SLListBase::const_iterator>();
294 return (node_ !=
nullptr);
302 if (node_ == list_->last_)
308 node_ = node_->next_;
314 inline bool Foam::SLListBase::const_iterator::operator==
319 return node_ == iter.node_;
323 inline bool Foam::SLListBase::const_iterator::operator!=
328 return node_ != iter.node_;
337 return iterator_first<const_iterator>();
link * get_node() const noexcept
The storage node.
void swap(SLListBase &lst)
Swap the contents of list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Base for singly-linked lists.
void clear()
Clear the list.
A primitive const node iterator.
bool operator==(const iterator &iter) const
void operator=(const iterator &iter)
Copy assignment.
const_iterator cbegin() const
Iterator to first item in list with const access.
link * back()
Return last entry.
The structure for a singly-linked storage node.
iterator(const iterator &)=default
Copy construct.
const const_iterator & cend() const
End of list for iterators.
bool good() const noexcept
Pointing at a valid storage node.
label size() const noexcept
The number of elements in list.
link * front()
Return first entry.
bool good() const noexcept
Pointing at a valid storage node.
errorManip< error > abort(error &err)
void next()
Move forward through list.
const NullObject * nullObjectPtr
Pointer to the unique nullObject.
const iterator & end()
End of list for iterators.
IteratorType iterator_last() const
Return iterator to last item or end-iterator if list is empty.
iterator begin()
Iterator to first item in list with non-const access.
const link * get_node() const noexcept
The storage node.
const_iterator(const const_iterator &)=default
Copy construct.
bool operator!=(const iterator &iter) const
void transfer(SLListBase &lst)
Transfer the contents of the argument into this list and annul the argument list. ...
link * remove(link *item)
A primitive non-const node iterator.
friend class const_iterator
IteratorType iterator_first() const
Return iterator to first item or end-iterator if list is empty.
static const IteratorType & iterator_end()
Factory method to return an iterator end.
void next()
Move forward through list.