Hasty Badger
Small UI library (a branch of Turbo Badger)
|
TBLinkListIterator - The backend class for a safe iteration of a TBLinkList. More...
#include <tb_linklist.h>
Public Member Functions | |
TBLinkListIterator (const TBLinkListIterator &iter) | |
TBLinkListIterator (TBLinkList *linklist, TBLink *current_link, bool forward) | |
void | Reset () |
Set the iterator to the first link in we iterate forward, or set it to the last link if we iterate backward. More... | |
TBLink * | Get () const |
Get the current link or nullptr if out of bounds. More... | |
TBLink * | GetAndStep () |
Get the current link and step the iterator to the next (forward or backward). More... | |
operator TBLink * () const | |
const TBLinkListIterator & | operator= (const TBLinkListIterator &iter) |
Friends | |
class | TBLinkList |
TBLinkListIterator - The backend class for a safe iteration of a TBLinkList.
You would normally recieve a typed iterator from a TBLinkListOf::IterateForward or TBLinkListOf::IterateBackward, instead of creating this object directly.
Safe iteration means that if a link is removed from a linked list, all iterators that currently point to that link will automatically step to the next link in the iterators direction.
|
inline |
Get the current link or nullptr if out of bounds.
TBLink * tb::TBLinkListIterator::GetAndStep | ( | ) |
Get the current link and step the iterator to the next (forward or backward).
void tb::TBLinkListIterator::Reset | ( | ) |
Set the iterator to the first link in we iterate forward, or set it to the last link if we iterate backward.