Regina Calculation Engine
Public Member Functions | Protected Attributes | Friends | List of all members
regina::DiscSpecIterator Class Reference

A forward iterator used for running through all normal discs in a normal surface. More...

#include <surfaces/disc.h>

Public Member Functions

 DiscSpecIterator ()
 Creates a new uninitialised iterator. More...
 
 DiscSpecIterator (const DiscSetSurface &discSet)
 Creates a new iterator pointing to the first disc in the given disc set. More...
 
 DiscSpecIterator (const DiscSpecIterator &)=default
 Default copy constructor. More...
 
void init (const DiscSetSurface &discSet)
 Points this iterator to the first disc in the given disc set. More...
 
DiscSpecIteratoroperator= (const DiscSpecIterator &)=default
 Default copy assignment operator. More...
 
DiscSpecIteratoroperator++ ()
 Preincrement operator. More...
 
DiscSpecIterator operator++ (int)
 Postincrement operator. More...
 
const DiscSpecoperator* () const
 Returns a reference to the disc pointed to by this iterator. More...
 
bool done () const
 Determines if this iterator is past-the-end. More...
 
bool operator== (const DiscSpecIterator &other) const
 Determines if this and the given iterator are equal. More...
 
bool operator!= (const DiscSpecIterator &other) const
 Determines if this and the given iterator are different. More...
 

Protected Attributes

const DiscSetSurfaceinternalDiscSet
 The disc set through which we are iterating. More...
 
DiscSpec current
 The disc currently pointed to. More...
 

Friends

class DiscSetSurface
 

Detailed Description

A forward iterator used for running through all normal discs in a normal surface.

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

Warning
This class converts the indices of normal discs of a given type from LargeInteger to unsigned long. See the precondition below.
Precondition
The number of normal discs of a particular type in a particular tetrahedron can be represented by a long integer.
Python:\n Instead of the C++ interface described here, in Python
DiscSetSurface and this class together implement the Python iterable/iterator interface. The DiscSetSurface class implements iter(), which returns a DiscSpecIterator; then DiscSpecIterator implements next(), which either returns the next normal disc in the set or else throws a StopException if there are no more discs to return.

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

Copyright © 1999-2020, 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).