Regina Calculation Engine
Public Member Functions | List of all members
regina::CensusHitIterator Class Reference


A forward iterator that walks through all hits stored by a single CensusHits object. More...

#include <census/census.h>

Public Member Functions

 CensusHitIterator ()
 Creates a past-the-end iterator. More...
 
 CensusHitIterator (const CensusHitIterator &)=default
 Default copy constructor. More...
 
 CensusHitIterator (const CensusHit *current)
 Creates a new iterator pointing to the given census hit. More...
 
CensusHitIteratoroperator= (const CensusHitIterator &)=default
 Default copy assignment operator. More...
 
bool operator== (const CensusHitIterator &rhs) const
 Tests whether this and the given iterator are equal. More...
 
bool operator!= (const CensusHitIterator &rhs) const
 Tests whether this and the given iterator are different. More...
 
CensusHitIteratoroperator++ ()
 
Preincrement operator. More...
 
CensusHitIterator operator++ (int)
 
Postincrement operator. More...
 
const CensusHitoperator* () const
 
Returns the census hit that this iterator is currently pointing to, or null if this iterator is past-the-end. More...
 

Detailed Description


A forward iterator that walks through all hits stored by a single CensusHits object.

This header also specialises std::iterator_traits for this iterator class.

Python
Instead of the C++ interface described here, in Python the classes CensusHits and CensusHitIterator together implement the Python iterable/iterator interface. The class CensusHits has just the single function __iter__(), which returns a CensusHitIterator; then CensusHitIterator implements next(), which either returns the next hit in the census or else throws a StopException if there are no more hits to return.

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

Copyright © 1999-2021, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).