Open Search
    EdgePairTeamplate< T, INITVALUE > Class Template Reference

    #include <generic_components.h>

    Detailed Description

    template<typename T, T INITVALUE>
    class maxon::EdgePairTeamplate< 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

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

    Static Public Member Functions

    static constexpr Bool TriviallyHashable ()
     

    Public Attributes

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

    Constructor & Destructor Documentation

    ◆ EdgePairTeamplate()

    MAXON_IMPLICIT EdgePairTeamplate ( vA = INITVALUE,
    vB = INITVALUE 
    )

    Member Function Documentation

    ◆ GetHashCode()

    HashInt GetHashCode ( ) const

    ◆ TriviallyHashable()

    static constexpr Bool TriviallyHashable ( )
    staticconstexpr

    ◆ GetUniqueHashCode()

    UniqueHash GetUniqueHashCode ( ) const

    ◆ ToString()

    String ToString ( const FormatStatement formatStatement = nullptr) const

    ◆ operator==()

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

    ◆ operator<()

    Bool operator< ( const EdgePairTeamplate< 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 ( EdgePairTeamplate< 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.