Tulip  4.10.0
Better Visualization Through Research
tlp::edge Struct Reference

#include <Edge.h>

Public Member Functions

 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 39 of file Edge.h.

Constructor & Destructor Documentation

tlp::edge::edge ( )
inline

edge creates an invalid edge.

Definition at line 48 of file Edge.h.

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 57 of file Edge.h.

Member Function Documentation

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 90 of file Edge.h.

+ Here is the caller graph for this function:

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

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

Definition at line 62 of file Edge.h.

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

operator != checks if two edges are differents.

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

Definition at line 80 of file Edge.h.

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 71 of file Edge.h.

Member Data Documentation

unsigned int tlp::edge::id

id The identifier of the edge.

Definition at line 43 of file Edge.h.