Regina Calculation Engine
|
A forward iterator for iterating through the entire packet subtree rooted at a given packet.
More...
#include <packet/packet.h>
Public Member Functions | |
SubtreeIterator () | |
Creates a past-the-end iterator. More... | |
SubtreeIterator (const SubtreeIterator &)=default | |
Default copy constructor. More... | |
SubtreeIterator (Packet *subtree) | |
Creates a new iterator pointing to the first packet within the given subtree. More... | |
SubtreeIterator (const Packet *subtree, Packet *current) | |
Creates a new iterator pointing to the given packet within the given subtree. More... | |
SubtreeIterator & | operator= (const SubtreeIterator &)=default |
Default copy assignment operator. More... | |
bool | operator== (const SubtreeIterator &rhs) const |
Tests whether this and the given iterator are equal. More... | |
bool | operator!= (const SubtreeIterator &rhs) const |
Tests whether this and the given iterator are different. More... | |
SubtreeIterator & | operator++ () |
Preincrement operator. More... | |
SubtreeIterator | operator++ (int) |
Postincrement operator. More... | |
Packet *const & | operator* () const |
Returns the packet that this iterator is currently pointing to. More... | |
A forward iterator for iterating through the entire packet subtree rooted at a given packet.
The order of iteration is depth-first, where a parent packet is always processed before its descendants.
This header also specialises std::iterator_traits for this iterator class.
__iter__()
, which returns the iterator object itself; it also implements next()
, which either returns the next packet in the subtree iteration or else throws a StopException
if there are no more packets to return.