GraphDom
Toggle main menu visibility
Loading...
Searching...
No Matches
labeled_edge_graph.h
1
/*
2
* Copyright 2026 Michele Comparini
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef GRAPHDOM_LABELED_EDGE_GRAPH_H
8
#define GRAPHDOM_LABELED_EDGE_GRAPH_H
9
10
#include "graph.h"
11
12
namespace
graphdom
{
14
20
template
<
typename
VertexType,
typename
EdgeLabelType>
21
class
labeled_edge_graph
:
virtual
public
graph
<VertexType> {
22
public
:
24
~labeled_edge_graph
()
override
=
default
;
25
26
[[nodiscard]]
virtual
const
EdgeLabelType& get_edge_label(
const
typename
graph<VertexType>::adj_list_const_iterator
&)
const
= 0;
27
28
[[nodiscard]]
virtual
EdgeLabelType& get_edge_label(
const
typename
graph<VertexType>::adj_list_const_iterator
&) = 0;
29
};
30
}
31
32
namespace
graphdom
{
36
template
<
typename
VertexType,
typename
EdgeLabelType>
37
class
default_edge_labeller
final {
38
public
:
44
[[nodiscard]]
constexpr
EdgeLabelType
operator()
(
const
typename
graph<VertexType>::vertex_const_handle
&,
const
typename
graph<VertexType>::vertex_const_handle
&)
const
{
45
return
EdgeLabelType();
46
}
47
53
[[nodiscard]]
constexpr
EdgeLabelType
operator()
(
const
typename
graph<VertexType>::vertex_const_handle
&,
const
typename
graph<VertexType>::vertex_const_handle
&,
edge_type
)
const
{
54
return
EdgeLabelType();
55
}
56
};
57
}
58
59
#endif
//GRAPHDOM_LABELED_EDGE_GRAPH_H
graphdom::default_edge_labeller
This class template is the default vertex labeller used by all labeled-edge graphs if no user-specifi...
Definition
labeled_edge_graph.h:37
graphdom::default_edge_labeller::operator()
constexpr EdgeLabelType operator()(const typename graph< VertexType >::vertex_const_handle &, const typename graph< VertexType >::vertex_const_handle &) const
Definition
labeled_edge_graph.h:44
graphdom::default_edge_labeller::operator()
constexpr EdgeLabelType operator()(const typename graph< VertexType >::vertex_const_handle &, const typename graph< VertexType >::vertex_const_handle &, edge_type) const
Definition
labeled_edge_graph.h:53
graphdom::graph::vertex_const_handle
Every valid instance of this class can be used to identify a specific vertex of a graph and to access...
Definition
vertex_const_handle.h:35
graphdom::graph
Every graph created using this library is an instance of a concrete class publicly derived,...
Definition
graph.h:43
graphdom::labeled_edge_graph
Every labeled-edge graph created using this library is an instance of a concrete class publicly deriv...
Definition
labeled_edge_graph.h:21
graphdom::labeled_edge_graph::~labeled_edge_graph
~labeled_edge_graph() override=default
To be polymorphic, this class has a virtual destructor.
graphdom
Definition
adj_list.h:16
graphdom::edge_type
edge_type
The enumerated type whose values represent the two types of edges of a graph.
Definition
graph.h:21
include
graphdom
labeled_edge_graph.h
Generated by
1.17.0