Tulip  6.0.0
Large graphs analysis and drawing
tlp::edge Struct Reference

#include <Edge.h>

Public Member Functions

constexpr edge ()
 
 edge (unsigned int j)
 
bool isValid () const
 
 operator unsigned int () const
 
bool operator!= (const edge e) const
 
bool operator== (const edge e) const
 

Public Attributes

unsigned int id
 

Detailed Description

The edge struct represents an edge in a Graph object.

This structure only contains an identifier, and a function to check if the edge is valid. A edge is considered invalid when its id has the UINT_MAX value.

Most operations performed on an edge (getting the source, target, etc) are available into the tlp::Graph object.

See also
tlp::node
tlp::Graph

Definition at line 40 of file Edge.h.

Constructor & Destructor Documentation

◆ edge() [1/2]

constexpr tlp::edge::edge ( )
inlineconstexpr

edge creates an invalid edge.

Definition at line 49 of file Edge.h.

◆ edge() [2/2]

tlp::edge::edge ( unsigned int  j)
inlineexplicit

edge Create an edge of given identifier. It is your responsibility to make sure an edge of this ID exists when you create the edge. If you want to make sure this edge exists, use Graph::isElement(), as isValid() will only tell is the edge was correctly initialized.

Parameters
jthe identifier this edge will use.

Definition at line 59 of file Edge.h.

Member Function Documentation

◆ isValid()

bool tlp::edge::isValid ( ) const
inline

isValid checks if the edge is valid. An invalid edge is an edge whose id is UINT_MAX.

Returns
whether the edge is valid or not.

Definition at line 92 of file Edge.h.

+ Here is the caller graph for this function:

◆ operator unsigned int()

tlp::edge::operator unsigned int ( ) const
inline

operator unsigned int A convenience function to get the id of an edge.

Definition at line 64 of file Edge.h.

◆ operator!=()

bool tlp::edge::operator!= ( const edge  e) const
inline

operator != checks if two edges are different.

Parameters
nThe other edge to compare this one to.
Returns
Whether or not the two edges are different.

Definition at line 82 of file Edge.h.

◆ operator==()

bool tlp::edge::operator== ( const edge  e) const
inline

operator == checks if two edges are equals.

Parameters
nThe other edge to compare this one to.
Returns
Whether or not the two edges are equal.

Definition at line 73 of file Edge.h.

Member Data Documentation

◆ id

unsigned int tlp::edge::id

id The identifier of the edge.

Definition at line 44 of file Edge.h.