Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
GTNodeCommon< NodeInfo > Class Template Reference

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

#include <graph-dry.H>

Inheritance diagram for GTNodeCommon< NodeInfo >:
[legend]

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=default
 another alias for set type
 
 GTNodeCommon (const NodeInfo &info)
 Copy constructor from info value.
 
 GTNodeCommon (NodeInfo &&info)
 Move constructor from info value.
 
 GTNodeCommon (const GTNodeCommon &other)
 Copy constructor.
 
 GTNodeCommon (GTNodeCommon &&other) noexcept
 Move constructor.
 
GTNodeCommonoperator= (const GTNodeCommon &other)
 Copy assignment operator.
 
GTNodeCommonoperator= (GTNodeCommon &&other) noexcept
 Move assignment operator.
 
NodeInfoget_info () noexcept
 Return a modifiable reference to the data contained in the node.
 
const NodeInfoget_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
 Attributes of node.
 
NodeInfo node_info
 
size_t num_arcs = 0
 data associated to the node. Access it with get_info()
 

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.

Definition at line 434 of file graph-dry.H.

Member Typedef Documentation

◆ Item_Type

template<typename NodeInfo >
using GTNodeCommon< NodeInfo >::Item_Type = NodeInfo

Definition at line 456 of file graph-dry.H.

◆ Node

template<typename NodeInfo >
using GTNodeCommon< NodeInfo >::Node = GTNodeCommon

Common alias for set types.

Definition at line 458 of file graph-dry.H.

◆ Node_Type

template<typename NodeInfo >
using GTNodeCommon< NodeInfo >::Node_Type = NodeInfo

The node.

Definition at line 460 of file graph-dry.H.

Constructor & Destructor Documentation

◆ GTNodeCommon() [1/5]

template<typename NodeInfo >
GTNodeCommon< NodeInfo >::GTNodeCommon ( )
defaultnoexcept

another alias for set type

Default constructor

◆ GTNodeCommon() [2/5]

template<typename NodeInfo >
GTNodeCommon< NodeInfo >::GTNodeCommon ( const NodeInfo info)
inline

Copy constructor from info value.

Definition at line 466 of file graph-dry.H.

◆ GTNodeCommon() [3/5]

template<typename NodeInfo >
GTNodeCommon< NodeInfo >::GTNodeCommon ( NodeInfo &&  info)
inline

Move constructor from info value.

Definition at line 469 of file graph-dry.H.

◆ GTNodeCommon() [4/5]

template<typename NodeInfo >
GTNodeCommon< NodeInfo >::GTNodeCommon ( const GTNodeCommon< NodeInfo > &  other)
inline

Copy constructor.

Definition at line 472 of file graph-dry.H.

◆ GTNodeCommon() [5/5]

template<typename NodeInfo >
GTNodeCommon< NodeInfo >::GTNodeCommon ( GTNodeCommon< NodeInfo > &&  other)
inlinenoexcept

Move constructor.

Definition at line 475 of file graph-dry.H.

Member Function Documentation

◆ get_info() [1/2]

template<typename NodeInfo >
const NodeInfo & GTNodeCommon< NodeInfo >::get_info ( ) const
inlinenoexcept

Return a constant reference to the data contained in the node.

Definition at line 497 of file graph-dry.H.

References GTNodeCommon< NodeInfo >::node_info.

◆ get_info() [2/2]

◆ operator=() [1/2]

template<typename NodeInfo >
GTNodeCommon & GTNodeCommon< NodeInfo >::operator= ( const GTNodeCommon< NodeInfo > &  other)
inline

Copy assignment operator.

Definition at line 478 of file graph-dry.H.

References GTNodeCommon< NodeInfo >::node_info.

◆ operator=() [2/2]

template<typename NodeInfo >
GTNodeCommon & GTNodeCommon< NodeInfo >::operator= ( GTNodeCommon< NodeInfo > &&  other)
inlinenoexcept

Move assignment operator.

Definition at line 486 of file graph-dry.H.

References GTNodeCommon< NodeInfo >::node_info.

◆ set_state()

template<typename NodeInfo >
void GTNodeCommon< NodeInfo >::set_state ( unsigned int  s)
inlinenoexcept

◆ state()

template<typename NodeInfo >
unsigned int GTNodeCommon< NodeInfo >::state ( ) const
inlinenoexcept

Member Data Documentation

◆ attrs

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

Attributes of node.

See also
Graph_Attr

Definition at line 441 of file graph-dry.H.

◆ node_info

◆ 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.

Definition at line 454 of file graph-dry.H.

Referenced by Aleph::Graph_Anode< Node_Info >::compress(), Aleph::Graph_Anode< Node_Info >::init(), Aleph::Graph_Anode< Node_Info >::insert_arc(), Aleph::Graph_Anode< Node_Info >::remove_arc(), Aleph::Graph_Anode< Node_Info >::remove_arc_ne(), Aleph::search_arc(), Aleph::search_spanning_tree_arc(), TEST(), TEST(), TEST(), TEST(), and TEST().


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