Tulip  5.3.1
Large graphs analysis and drawing
tlp::node Struct Reference

#include <Node.h>

Public Member Functions

 node ()
 
 node (unsigned int j)
 
bool isValid () const
 
 operator unsigned int () const
 
bool operator!= (const node n) const
 
bool operator== (const node n) const
 

Public Attributes

unsigned int id
 

Detailed Description

The node struct represents a node in a Graph object.

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

Most operations performed on a node (getting out edges etc) are available into the tlp::Graph object.

See also
tlp::edge
tlp::Graph
Examples:
graph_display/graph_display.cpp.

Definition at line 40 of file Node.h.

Constructor & Destructor Documentation

◆ node() [1/2]

tlp::node::node ( )
inline

node creates an invalid node.

Definition at line 49 of file Node.h.

◆ node() [2/2]

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

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

Parameters
jthe identifier this node will use.

Definition at line 59 of file Node.h.

Member Function Documentation

◆ isValid()

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

isValid checks if the node is valid. An invalid node is a node whose id is UINT_MAX.

Returns
whether the node is valid or not.

Definition at line 92 of file Node.h.

+ Here is the caller graph for this function:

◆ operator unsigned int()

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

operator unsigned int A convenience function to get the id of a node.

Definition at line 64 of file Node.h.

◆ operator!=()

bool tlp::node::operator!= ( const node  n) const
inline

operator != Compares two nodes, checking that they are different..

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

Definition at line 73 of file Node.h.

◆ operator==()

bool tlp::node::operator== ( const node  n) const
inline

operator != Compares two nodes, checking that they are identical.

Parameters
nThe other node to compare this one to.
Returns
Whether or not the two nodes are the same.

Definition at line 82 of file Node.h.

Member Data Documentation

◆ id

unsigned int tlp::node::id

id The identifier of the node.

Definition at line 44 of file Node.h.