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

A reference to one of the two strands of a link that pass each other at a crossing. More...

#include <link/link.h>

Public Member Functions

 StrandRef ()
 Initialises this to a null reference. More...
 
 StrandRef (Crossing *crossing, int strand)
 Initialises this to the given strand of the given crossing. More...
 
 StrandRef (const StrandRef &)=default
 Default copy constructor. More...
 
Crossingcrossing () const
 The crossing that this reference points to. More...
 
int strand () const
 Indicates whether this reference points to the upper or lower strand of the relevant crossing. More...
 
int id () const
 An integer that uniquely identifies this strand within the link. More...
 
bool operator== (const StrandRef &rhs) const
 Tests whether this and the given reference are identical. More...
 
bool operator!= (const StrandRef &rhs) const
 Tests whether this and the given reference are not identical. More...
 
StrandRefoperator= (const StrandRef &)=default
 Default assignment operator. More...
 
StrandRefoperator++ ()
 Moves this reference forward along the direction of the link until it reaches the next crossing. More...
 
StrandRef operator++ (int)
 Moves this reference forward along the direction of the link until it reaches the next crossing. More...
 
StrandRefoperator-- ()
 Moves this reference backward against the direction of the link until it reaches the previous crossing. More...
 
StrandRef operator-- (int)
 Moves this reference backward against the direction of the link until it reaches the previous crossing. More...
 
StrandRef next () const
 Returns the crossing reference that comes immediately after this when walking forward along the direction of the link. More...
 
StrandRef prev () const
 Returns the crossing reference that comes immediately before this when walking backward against the direction of the link. More...
 
void jump ()
 Jumps to the other strand at the same crossing. More...
 
 operator bool () const
 Tests whether this is a non-null reference. More...
 

Friends

class Link
 
class ModelLinkGraph
 
class Tangle
 

Detailed Description

A reference to one of the two strands of a link that pass each other at a crossing.

This class is a simple wrapper that stores (i) a pointer to the relevant crossing; and (ii) an integer to denote whether this refers to the upper strand (which passes over the crossing) or the lower strand (which passes under the crossing).

A "null reference" is one whose crossing is the null pointer.

These references are small enough to pass around by value.

This class can also be used to refer to an arc of a link; that is, a section of the link that runs from one crossing to the next. When used in this way:


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).