Regina Calculation Engine
|
A forward iterator for iterating through all immediate children of a given packet. More...
#include <packet/packet.h>
Public Member Functions | |
ChildIterator () | |
Creates a past-the-end iterator. More... | |
ChildIterator (const ChildIterator &)=default | |
Default copy constructor. More... | |
ChildIterator (Packet *current) | |
Creates a new iterator pointing to the given child packet. More... | |
ChildIterator & | operator= (const ChildIterator &)=default |
Default copy assignment operator. More... | |
bool | operator== (const ChildIterator &rhs) const |
Tests whether this and the given iterator are equal. More... | |
bool | operator!= (const ChildIterator &rhs) const |
Tests whether this and the given iterator are different. More... | |
ChildIterator & | operator++ () |
Preincrement operator. More... | |
ChildIterator | 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 all immediate children of a given packet.
This header also specialises std::iterator_traits for this iterator class.
__iter__()
, which returns a ChildIterator; then ChildIterator implements next()
, which either returns the next child packet in the iteration or else throws a StopException
if there are no more children to return.