Regina Calculation Engine
|
A lightweight object that gives access to all immediate children of a given packet. More...
#include <packet/packet.h>
Public Member Functions | |
PacketChildren (const PacketChildren &)=default | |
Default copy constructor. More... | |
PacketChildren (const Packet *parent) | |
Creates a new object for iterating through the immediate children of the given packet. More... | |
PacketChildren & | operator= (const PacketChildren &)=default |
Default copy assignment operator. More... | |
ChildIterator | begin () const |
Returns an iterator at the beginning of the range of children. More... | |
ChildIterator | end () const |
Returns an iterator at the end of the range of children. More... | |
A lightweight object that gives access to all immediate children of a given packet.
The purpose of this class is to support iteration through all children of a packet p using C++11 range-based for
loops:
In Python, PacketChildren is an iterable object:
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.