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

An 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...
 
void init (const DiscSetSurface &discSet)
 Points this iterator to the first disc in the given disc set. More...
 
void operator++ ()
 Points this iterator to the next disc, or makes it past-the-end if there is no next disc. More...
 
void operator++ (int)
 Points this iterator to the next disc, or makes it past-the-end if there is no next disc. 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...
 

Detailed Description

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

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.

Constructor & Destructor Documentation

◆ DiscSpecIterator() [1/2]

regina::DiscSpecIterator::DiscSpecIterator ( )
inline

Creates a new uninitialised iterator.

This iterator cannot be used or queried until init() is called.

◆ DiscSpecIterator() [2/2]

regina::DiscSpecIterator::DiscSpecIterator ( const DiscSetSurface discSet)
inline

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

Parameters
discSetthe disc set used to initialise this iterator.

Member Function Documentation

◆ done()

bool regina::DiscSpecIterator::done ( ) const
inline

Determines if this iterator is past-the-end.

Returns
true if and only if this iterator is past-the-end.

◆ init()

void regina::DiscSpecIterator::init ( const DiscSetSurface discSet)
inline

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

Parameters
discSetthe disc set used to reinitialise this iterator.

◆ operator!=()

bool regina::DiscSpecIterator::operator!= ( const DiscSpecIterator 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*()

const DiscSpec & regina::DiscSpecIterator::operator* ( ) const
inline

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

Precondition
This iterator is not past-the-end.
Python:
This routine is called deref(), since Python does not support the dereference operator.
Returns
a reference to the disc pointed to by this iterator.

◆ operator++() [1/2]

void regina::DiscSpecIterator::operator++ ( )
inline

Points this iterator to the next disc, or makes it past-the-end if there is no next disc.

Unlike most standard increment operators, this operator returns void. One consequence of this is that the preincrement and postincrement operators for this class are identical. This interface will need to be made more standard some day.

Precondition
This iterator is not past-the-end.
Python:
This routine is called inc(), since Python does not support the increment operator.

◆ operator++() [2/2]

void regina::DiscSpecIterator::operator++ ( int  )
inline

Points this iterator to the next disc, or makes it past-the-end if there is no next disc.

Unlike most standard increment operators, this operator returns void. One consequence of this is that the preincrement and postincrement operators for this class are identical. This interface will need to be made more standard some day.

Precondition
This iterator is not past-the-end.
Python:
This routine is called inc(), since Python does not support the increment operator.

◆ operator==()

bool regina::DiscSpecIterator::operator== ( const DiscSpecIterator 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.

Member Data Documentation

◆ current

DiscSpec regina::DiscSpecIterator::current
protected

The disc currently pointed to.

◆ internalDiscSet

const DiscSetSurface* regina::DiscSpecIterator::internalDiscSet
protected

The disc set through which we are iterating.


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

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