Regina Calculation Engine
Public Member Functions | List of all members
regina::graph::IncidentArcIterator< out > Class Template Reference

Iterates through the two directed arcs either entering or exiting a given crossing of a knot or link. More...

#include <link/graph.h>

Public Member Functions

 IncidentArcIterator ()
 Creates a singular iterator. More...
 
 IncidentArcIterator (Crossing *crossing, int strand=0)
 Creates a new iterator that runs through the two arcs entering or exiting the given crossing (depending on the template parameter out). More...
 
 IncidentArcIterator (const IncidentArcIterator &)=default
 Default copy constructor. More...
 
IncidentArcIteratoroperator++ ()
 Preincrement operator. More...
 
IncidentArcIterator operator++ (int)
 Postincrement operator. More...
 
StrandRef operator* () const
 Returns the directed arc to which this iterator points. More...
 
IncidentArcIteratoroperator= (const IncidentArcIterator &)=default
 Default assignment operator. More...
 
bool operator== (const IncidentArcIterator &rhs) const
 Tests whether this and the given iterator are equal. More...
 
bool operator!= (const IncidentArcIterator &rhs) const
 Tests whether this and the given iterator are different. More...
 

Detailed Description

template<bool out>
class regina::graph::IncidentArcIterator< out >

Iterates through the two directed arcs either entering or exiting a given crossing of a knot or link.

If the template argument out is true, then this will iterate through the two directed arcs exiting the given crossing: first the arc leaving from the lower strand, and then the arc leaving from the upper strand.

If the template argument out is false, then this will iterate through the two directed arcs entering the given crossing: first the arc entering into the lower strand, and then the arc entering into the upper strand.

This class implements the Boost multipass input iterator concept, which is similar to the standard C++ forward iterator except that the reference type may be the same as value_type (and so, in particular, the dereference operator may return by value). This header also specialises std::iterator_traits for this iterator type.

Template Parameters
outindicates whether to iterate through arcs exiting or entering the given crossing, as described above.

Constructor & Destructor Documentation

◆ IncidentArcIterator() [1/3]

template<bool out>
regina::graph::IncidentArcIterator< out >::IncidentArcIterator
inline

Creates a singular iterator.

◆ IncidentArcIterator() [2/3]

template<bool out>
regina::graph::IncidentArcIterator< out >::IncidentArcIterator ( Crossing crossing,
int  strand = 0 
)
inline

Creates a new iterator that runs through the two arcs entering or exiting the given crossing (depending on the template parameter out).

Parameters
crossingthe crossing whose incident arcs we are iterating through.
strand0 if we should begin at the arc entering or exiting the lower strand; 1 if we should begin at the arc entering or exiting the upper strand; or 2 if the iterator should be marked as past-the-end.

◆ IncidentArcIterator() [3/3]

template<bool out>
regina::graph::IncidentArcIterator< out >::IncidentArcIterator ( const IncidentArcIterator< out > &  )
default

Default copy constructor.

Member Function Documentation

◆ operator!=()

template<bool out>
bool regina::graph::IncidentArcIterator< out >::operator!= ( const IncidentArcIterator< out > &  rhs) const
inline

Tests whether this and the given iterator are different.

Note
This only tests the "current strand" for each iterator, which identifies the incident arcs that they are pointing to. It does not compare the original "source" crossings that were passed to each constructor.
Parameters
rhsthe iterator to compare with this.
Returns
true if and only if the two iterators are different.

◆ operator*()

template<bool out>
StrandRef regina::graph::IncidentArcIterator< out >::operator*
inline

Returns the directed arc to which this iterator points.

See the StrandRef documentation for details on how a StrandRef object identifies a directed arc of a knot or link.

Precondition
This iterator is not past-the-end.
Returns
the directed arc to which this iterator points.

◆ operator++() [1/2]

template<bool out>
IncidentArcIterator< out > & regina::graph::IncidentArcIterator< out >::operator++
inline

Preincrement operator.

Returns
a reference to this iterator.

◆ operator++() [2/2]

template<bool out>
IncidentArcIterator< out > regina::graph::IncidentArcIterator< out >::operator++ ( int  )
inline

Postincrement operator.

Returns
a copy of this iterator before it was incremented.

◆ operator=()

template<bool out>
IncidentArcIterator& regina::graph::IncidentArcIterator< out >::operator= ( const IncidentArcIterator< out > &  )
default

Default assignment operator.

Returns
a reference to this iterator.

◆ operator==()

template<bool out>
bool regina::graph::IncidentArcIterator< out >::operator== ( const IncidentArcIterator< out > &  rhs) const
inline

Tests whether this and the given iterator are equal.

Note
This only tests the "current strand" for each iterator, which identifies the incident arcs that they are pointing to. It does not compare the original "source" crossings that were passed to each constructor.
Parameters
rhsthe iterator to compare with this.
Returns
true if and only if the two iterators are equal.

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

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