Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Graph_Arc< _Arc_Info > Struct Template Reference

Arc of graph implemented with double-linked adjacency lists. More...

#include <tpl_graph.H>

Inheritance diagram for Aleph::Graph_Arc< _Arc_Info >:
[legend]
Collaboration diagram for Aleph::Graph_Arc< _Arc_Info >:
[legend]

Public Types

using Base = GTArcCommon< _Arc_Info >
 
using Arc_Info = _Arc_Info
 
- Public Types inherited from GTArcCommon< ArcInfo >
using Item_Type = ArcInfo
 
using Arc_Type = ArcInfo
 

Public Member Functions

 Graph_Arc (const Arc_Info &info) noexcept
 Copy constructor.
 
 Graph_Arc (Arc_Info &&info=Arc_Info()) noexcept
 Move or rvalue constructor.
 
 Graph_Arc (const Graph_Arc &arc)
 
Graph_Arcoperator= (const Graph_Arc &arc)
 
- Public Member Functions inherited from GTArcCommon< ArcInfo >
 GTArcCommon () noexcept=default
 data contained in arc
 
 GTArcCommon (const ArcInfo &info)
 Construct from info value (copy)
 
 GTArcCommon (ArcInfo &&info)
 Construct from info value (move)
 
 GTArcCommon (void *src, void *tgt, const ArcInfo &data)
 Construct with endpoints and info (copy)
 
 GTArcCommon (void *src, void *tgt, ArcInfo &&data=ArcInfo())
 Construct with endpoints and info (move)
 
 GTArcCommon (const GTArcCommon &other)
 Copy constructor.
 
 GTArcCommon (GTArcCommon &&other) noexcept
 Move constructor.
 
GTArcCommonoperator= (const GTArcCommon &other)
 Copy assignment operator.
 
GTArcCommonoperator= (GTArcCommon &&other) noexcept
 Move assignment operator.
 
unsigned int state () const noexcept
 Return the state of arc.
 
void set_state (unsigned int s) noexcept
 Set the state of arc to value s
 
ArcInfoget_info () noexcept
 Return a modifiable reference to the arc data.
 
const ArcInfoget_info () const noexcept
 Return a constant reference to the arc data.
 
void * get_connected_node (void *node) noexcept
 
void * get_img_node (void *node) noexcept
 

Public Attributes

Arc_Nodesrc_arc_node = nullptr
 The type of data stored in the arc.
 
Arc_Nodetgt_arc_node = nullptr
 
- Public Attributes inherited from GTArcCommon< ArcInfo >
void * src_node = nullptr
 
void * tgt_node = nullptr
 Please don't use.
 
Graph_Attr attrs
 Please don't use.
 
ArcInfo arc_info
 

Friends

class GTArcCommon< _Arc_Info >
 

Additional Inherited Members

Detailed Description

template<typename _Arc_Info = Empty_Class>
struct Aleph::Graph_Arc< _Arc_Info >

Arc of graph implemented with double-linked adjacency lists.

This class defines an arc of a graph implemented with double-linked adjacency lists.

Basically, there are three ways for defining the information to be stored in an arc:

  1. Specifying the data as a template parameter of this class.
  2. By inheriting from this class and in the derived class to define the data
  3. Combination of two above
Note
The purpose of this class is only for specifying the arc of a graph. It is not intended for declaration. Use the internal node subclass instead. Although you could access data and function members of this class, at the exception to get_info() it is not advisable to use them. They are accessible for implementation purposes.
An arc has three additional attributes: the control bits, the counter and the cookie.
See also
List_Graph List_Digraph Graph_Node Bit_Fields

Definition at line 219 of file tpl_graph.H.

Member Typedef Documentation

◆ Arc_Info

template<typename _Arc_Info = Empty_Class>
using Aleph::Graph_Arc< _Arc_Info >::Arc_Info = _Arc_Info

Definition at line 227 of file tpl_graph.H.

◆ Base

Definition at line 225 of file tpl_graph.H.

Constructor & Destructor Documentation

◆ Graph_Arc() [1/3]

template<typename _Arc_Info = Empty_Class>
Aleph::Graph_Arc< _Arc_Info >::Graph_Arc ( const Arc_Info info)
inlinenoexcept

Copy constructor.

Construct an arc whose data is copied from info. The control attributes are reset.

Parameters
[in]infodata to copy to the arc
Note
The copy constructor of Arc_Info must be defined

Definition at line 241 of file tpl_graph.H.

◆ Graph_Arc() [2/3]

template<typename _Arc_Info = Empty_Class>
Aleph::Graph_Arc< _Arc_Info >::Graph_Arc ( Arc_Info &&  info = Arc_Info())
inlinenoexcept

Move or rvalue constructor.

Construct an arc whose data is moved from info. The control attributes are reset.

Parameters
[in]infodata to move to the arc
Note
The move constructor of Arc_Info must be defined

Definition at line 256 of file tpl_graph.H.

◆ Graph_Arc() [3/3]

template<typename _Arc_Info = Empty_Class>
Aleph::Graph_Arc< _Arc_Info >::Graph_Arc ( const Graph_Arc< _Arc_Info > &  arc)
inline

Definition at line 262 of file tpl_graph.H.

Member Function Documentation

◆ operator=()

template<typename _Arc_Info = Empty_Class>
Graph_Arc & Aleph::Graph_Arc< _Arc_Info >::operator= ( const Graph_Arc< _Arc_Info > &  arc)
inline

Definition at line 268 of file tpl_graph.H.

References GTArcCommon< ArcInfo >::arc_info.

Friends And Related Symbol Documentation

◆ GTArcCommon< _Arc_Info >

template<typename _Arc_Info = Empty_Class>
friend class GTArcCommon< _Arc_Info >
friend

Definition at line 190 of file tpl_graph.H.

Member Data Documentation

◆ src_arc_node

template<typename _Arc_Info = Empty_Class>
Arc_Node* Aleph::Graph_Arc< _Arc_Info >::src_arc_node = nullptr

The type of data stored in the arc.

Definition at line 229 of file tpl_graph.H.

◆ tgt_arc_node

template<typename _Arc_Info = Empty_Class>
Arc_Node* Aleph::Graph_Arc< _Arc_Info >::tgt_arc_node = nullptr

Definition at line 230 of file tpl_graph.H.


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