EdgePairTemplate< T, INITVALUE > Class Template Reference

#include <generic_components.h>

Detailed Description

template<typename T, T INITVALUE>
class maxon::EdgePairTemplate< T, INITVALUE >

Class to represent an undirected edge by specifying two vertices. The vertices are sorted, so upon query it is guaranteed that vertexA <= vertexB. Can also store an invalid state if one of the vertices is set to INITVALUE.

Public Member Functions

 ~EdgePairTemplate ()=default
 
 EdgePairTemplate ()=default
 
MAXON_IMPLICIT EdgePairTemplate (T vA, T vB=INITVALUE)
 
 EdgePairTemplate (EdgePairTemplate< T, INITVALUE > &&src)
 
 MAXON_OPERATOR_COPY_ASSIGNMENT (EdgePairTemplate)
 
 EdgePairTemplate (const EdgePairTemplate< T, INITVALUE > &src)
 
HashInt GetHashCode () const
 
UniqueHash GetUniqueHashCode () const
 
String ToString (const FormatStatement *formatStatement=nullptr) const
 
Bool operator== (const EdgePairTemplate< T, INITVALUE > &b) const
 
Bool operator< (const EdgePairTemplate< T, INITVALUE > &b) const
 
Bool IsValid () const
 
Bool IsCollapsed () const
 
 MAXON_OPERATOR_COMPARISON (EdgePairTemplate)
 

Static Public Member Functions

static constexpr Bool TriviallyHashable ()
 

Public Attributes

union {
   T   _vA
 
   T   _vertexA
 
}; 
 
union {
   T   _vB
 
   T   _vertexB
 
}; 
 

Constructor & Destructor Documentation

◆ ~EdgePairTemplate()

~EdgePairTemplate ( )
default

◆ EdgePairTemplate() [1/4]

EdgePairTemplate ( )
default

◆ EdgePairTemplate() [2/4]

MAXON_IMPLICIT EdgePairTemplate ( vA,
vB = INITVALUE 
)

◆ EdgePairTemplate() [3/4]

EdgePairTemplate ( EdgePairTemplate< T, INITVALUE > &&  src)

◆ EdgePairTemplate() [4/4]

EdgePairTemplate ( const EdgePairTemplate< T, INITVALUE > &  src)

Member Function Documentation

◆ MAXON_OPERATOR_COPY_ASSIGNMENT()

MAXON_OPERATOR_COPY_ASSIGNMENT ( EdgePairTemplate< T, INITVALUE >  )

◆ TriviallyHashable()

static constexpr Bool TriviallyHashable ( )
staticconstexpr

◆ GetHashCode()

HashInt GetHashCode ( ) const

◆ GetUniqueHashCode()

UniqueHash GetUniqueHashCode ( ) const

◆ ToString()

String ToString ( const FormatStatement formatStatement = nullptr) const

◆ operator==()

Bool operator== ( const EdgePairTemplate< T, INITVALUE > &  b) const

◆ operator<()

Bool operator< ( const EdgePairTemplate< T, INITVALUE > &  b) const

◆ IsValid()

Bool IsValid ( ) const

Returns true if both vertices have a value != NOTOK.

Returns
True if the edge is valid.

◆ IsCollapsed()

Bool IsCollapsed ( ) const

Returns true if the edge is actually a vertex (_vA == _vB).

Returns
True if the edge is a vertex.

◆ MAXON_OPERATOR_COMPARISON()

MAXON_OPERATOR_COMPARISON ( EdgePairTemplate< T, INITVALUE >  )

Member Data Documentation

◆ _vA

T _vA

◆ _vertexA

T _vertexA

◆ 

union { ... }

First edge vertex, always <= _vB.

◆ _vB

T _vB

◆ _vertexB

T _vertexB

◆ 

union { ... }

Second edge vertex.