Hasty Badger
Small UI library (a branch of Turbo Badger)
 All Classes Namespaces Functions Variables Enumerations Enumerator Friends Groups Pages
tb::TBLinkListIterator Class Reference

TBLinkListIterator - The backend class for a safe iteration of a TBLinkList. More...

#include <tb_linklist.h>

Inheritance diagram for tb::TBLinkListIterator:
tb::TBLinkListOf< T >::Iterator

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...
 
TBLinkGet () const
 Get the current link or nullptr if out of bounds. More...
 
TBLinkGetAndStep ()
 Get the current link and step the iterator to the next (forward or backward). More...
 
 operator TBLink * () const
 
const TBLinkListIteratoroperator= (const TBLinkListIterator &iter)
 

Friends

class TBLinkList
 

Detailed Description

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.

Member Function Documentation

TBLink* tb::TBLinkListIterator::Get ( ) const
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.


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