Aleph-w  1.9
General library for algorithms and data structures
GTNodeCommon< NodeInfo > Class Template Reference

#include <graph-dry.H>

Public Types

using Item_Type = NodeInfo
 
using Node = GTNodeCommon
 Common alias for set types.
 
using Node_Type = NodeInfo
 The node.
 

Public Member Functions

 GTNodeCommon () noexcept
 another alias for set type
 
 GTNodeCommon (const NodeInfo &info)
 
 GTNodeCommon (NodeInfo &&info)
 
NodeInfo & get_info () noexcept
 Return a modifiable reference to the data contained in the node.
 
const NodeInfo & get_info () const noexcept
 Return a constant reference to the data contained in the node.
 
unsigned int state () const noexcept
 Return the state's value.
 
void set_state (unsigned int s) noexcept
 Set the state to value s
 

Public Attributes

Graph_Attr attrs
 
NodeInfo node_info
 
size_t num_arcs = 0
 data associated to the node. Access it with get_info() More...
 

Detailed Description

template<typename NodeInfo>
class GTNodeCommon< NodeInfo >

Common attributes and methods for nodes (vertexes) belonging to graphs.

This class defines common attributes and methods for graphs. All graph nodes inherit the data and function members of this class. Although this class exports data members, it is not recommended to directly access them. Instead use the macros NODE_BITS, NODE_COUNTER and NODE_COOKIE, which define access to the three attributes.

See also
NODE_BITS NODE_COUNTER NODE_COOKIE IS_NODE_VISITED NODE_COLOR
Warning
This class is not intended to be used explicitly by the user. Its use is internal to the graphs implementations.

Member Data Documentation

◆ attrs

template<typename NodeInfo>
Graph_Attr GTNodeCommon< NodeInfo >::attrs

Attributes of node

See also
Graph_Attr

◆ num_arcs

template<typename NodeInfo>
size_t GTNodeCommon< NodeInfo >::num_arcs = 0

data associated to the node. Access it with get_info()

Number of arcs.

If the graph is directed, then this field does not have much sense, since it counts the total of arcs (incoming and outcoming).

Warning
Don't modifiy this field (NEVER!). It is public in order to facilitate the implementation of some graph operations.

The documentation for this class was generated from the following file:

Leandro Rabindranath León