Regina Calculation Engine
Public Member Functions | Protected Attributes
regina::NDiscSpecIterator Class Reference

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

#include <surfaces/ndisc.h>

List of all members.

Public Member Functions

 NDiscSpecIterator ()
 Creates a new uninitialised iterator.
 NDiscSpecIterator (const NDiscSetSurface &discSet)
 Creates a new iterator pointing to the first disc in the given disc set.
void init (const NDiscSetSurface &discSet)
 Points this iterator to the first disc in the given disc set.
void operator++ ()
 Points this iterator to the next disc, or makes it past-the-end if there is no next disc.
void operator++ (int)
 Points this iterator to the next disc, or makes it past-the-end if there is no next disc.
const NDiscSpecoperator* () const
 Returns a reference to the disc pointed to by this iterator.
bool done () const
 Determines if this iterator is past-the-end.

Protected Attributes

const NDiscSetSurfaceinternalDiscSet
 The disc set through which we are iterating.
NDiscSpec current
 The disc currently pointed to.

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 NLargeInteger 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

regina::NDiscSpecIterator::NDiscSpecIterator ( ) [inline]

Creates a new uninitialised iterator.

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

regina::NDiscSpecIterator::NDiscSpecIterator ( const NDiscSetSurface 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

bool regina::NDiscSpecIterator::done ( ) const [inline]

Determines if this iterator is past-the-end.

Returns:
true if and only if this iterator is past-the-end.
void regina::NDiscSpecIterator::init ( const NDiscSetSurface discSet) [inline]

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

Parameters:
discSetthe disc set used to reinitialise this iterator.
const NDiscSpec & regina::NDiscSpecIterator::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.
void regina::NDiscSpecIterator::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.
void regina::NDiscSpecIterator::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.

Member Data Documentation

The disc currently pointed to.

The disc set through which we are iterating.


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

Copyright © 1999-2011, The Regina development team
This software is released under the GNU General Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).