Regina 7.3.1 Calculation Engine
regina::DiscSpecIterator< TetData > Class Template Reference

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

#include <surface/disc.h>

Public Member Functions

 DiscSpecIterator ()
 Creates a new uninitialised iterator.
 
 DiscSpecIterator (const DiscSetSurfaceDataImpl< TetData > &discSet)
 Creates a new iterator pointing to the first disc in the given disc set.
 
 DiscSpecIterator (const DiscSpecIterator &)=default
 Creates a new copy of the given iterator.
 
void init (const DiscSetSurfaceDataImpl< TetData > &discSet)
 Points this iterator to the first disc in the given disc set.
 
DiscSpecIteratoroperator= (const DiscSpecIterator &)=default
 Sets this to be a copy of the given iterator.
 
DiscSpecIteratoroperator++ ()
 Preincrement operator.
 
DiscSpecIterator operator++ (int)
 Postincrement operator.
 
auto __next__ ()
 Returns the current DiscSpec and increments this iterator.
 
const DiscSpecoperator* () const
 Returns a reference to the disc pointed to by this iterator.
 
bool done () const
 Determines if this iterator is past-the-end.
 
bool operator== (const DiscSpecIterator &other) const
 Determines if this and the given iterator are equal.
 
bool operator!= (const DiscSpecIterator &other) const
 Determines if this and the given iterator are different.
 

Friends

class DiscSetSurfaceDataImpl< TetData >
 

Detailed Description

template<class TetData>
class regina::DiscSpecIterator< TetData >

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

This class is designed to work alongside DiscSetSurfaceDataImpl<TetData>. Typically you would not need to specify the template argument TetData; for copy initialisation you can use the auto type, and when constructing from a DiscSetSurfaceData<T> the template argument can be automatically deduced.

As of Regina 7.3.1, this class no longer provides the iterator type aliases value_type, iterator_category, difference_type, pointer and reference. Instead you can access these through std::iterator_traits.

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
The only instance of this class that is available through python is the iterator for DiscSetSurface (i.e., the "vanilla" case where TetData is the type DiscSetTet). Moreover, 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.

Constructor & Destructor Documentation

◆ DiscSpecIterator() [1/3]

template<class TetData >
regina::DiscSpecIterator< TetData >::DiscSpecIterator ( )
inline

Creates a new uninitialised iterator.

This iterator cannot be used or queried until either init() or the assignmemnt operator is called.

Python
Not present. The only way to create a DiscSpecIterator is to iterate over a DiscSetSurface.

◆ DiscSpecIterator() [2/3]

template<class TetData >
regina::DiscSpecIterator< TetData >::DiscSpecIterator ( const DiscSetSurfaceDataImpl< TetData > & discSet)
inline

Creates a new iterator pointing to the first disc in the given disc set.

Python
Not present. The only way to create a DiscSpecIterator is to iterate over a DiscSetSurface.
Parameters
discSetthe disc set used to initialise this iterator.

◆ DiscSpecIterator() [3/3]

template<class TetData >
regina::DiscSpecIterator< TetData >::DiscSpecIterator ( const DiscSpecIterator< TetData > & )
default

Creates a new copy of the given iterator.

Python
Not present. The only way to create a DiscSpecIterator is to iterate over a DiscSetSurface.

Member Function Documentation

◆ __next__()

template<class TetData >
auto regina::DiscSpecIterator< TetData >::__next__ ( )

Returns the current DiscSpec and increments this iterator.

C++
Not present. For C++ users, DiscSpecIterator provides the usual iterator preincrement, postincrement and dereferencing operators (++ and *) instead.
Exceptions
StopIterationThe iterator is already past-the-end when this function is called.
Returns
a reference to the disc that this iterator is pointing to, before the increment takes place.

◆ done()

template<class TetData >
bool regina::DiscSpecIterator< TetData >::done ( ) const
inline

Determines if this iterator is past-the-end.

Python
Not present. For Python users, DiscSpecIterator implements the Python iterator interface instead. See next() for details.
Returns
true if and only if this iterator is past-the-end.

◆ init()

template<class TetData >
void regina::DiscSpecIterator< TetData >::init ( const DiscSetSurfaceDataImpl< TetData > & discSet)
inline

Points this iterator to the first disc in the given disc set.

Python
Not present. For Python users, DiscSpecIterator implements the Python iterator interface instead. See next() for details.
Parameters
discSetthe disc set used to reinitialise this iterator.

◆ operator!=()

template<class TetData >
bool regina::DiscSpecIterator< TetData >::operator!= ( const DiscSpecIterator< TetData > & other) const
inline

Determines if this and the given iterator are different.

Two iterators are considered equal if (i) they were constructed from the same DiscSetSurface object (not two different DiscSetSurface objects with identical contents), and (ii) they point to the same disc of the same tetrahedron.

Parameters
otherthe iterator to compare with this.
Returns
true if and only if this and the given iterator are equal.

◆ operator*()

template<class TetData >
const DiscSpec & regina::DiscSpecIterator< TetData >::operator* ( ) const
inline

Returns a reference to the disc pointed to by this iterator.

Precondition
This iterator is not past-the-end.
Python
Not present. For Python users, DiscSpecIterator implements the Python iterator interface instead. See next() for details.
Returns
a reference to the disc pointed to by this iterator.

◆ operator++() [1/2]

template<class TetData >
DiscSpecIterator & regina::DiscSpecIterator< TetData >::operator++ ( )
inline

Preincrement operator.

Precondition
This iterator is not past-the-end.
Python
Not present. For Python users, DiscSpecIterator implements the Python iterator interface instead. See next() for details.
Returns
a reference to this iterator.

◆ operator++() [2/2]

template<class TetData >
DiscSpecIterator regina::DiscSpecIterator< TetData >::operator++ ( int )
inline

Postincrement operator.

Precondition
This iterator is not past-the-end.
Python
Not present. For Python users, DiscSpecIterator implements the Python iterator interface instead. See next() for details.
Returns
a copy of this iterator before it was incremented.

◆ operator=()

template<class TetData >
DiscSpecIterator & regina::DiscSpecIterator< TetData >::operator= ( const DiscSpecIterator< TetData > & )
default

Sets this to be a copy of the given iterator.

Returns
a reference to this iterator.

◆ operator==()

template<class TetData >
bool regina::DiscSpecIterator< TetData >::operator== ( const DiscSpecIterator< TetData > & other) const
inline

Determines if this and the given iterator are equal.

Two iterators are considered equal if (i) they were constructed from the same DiscSetSurface object (not two different DiscSetSurface objects with identical contents), and (ii) they point to the same disc of the same tetrahedron.

Parameters
otherthe iterator to compare with this.
Returns
true if and only if this and the given iterator are equal.

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

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