GraphDom
Toggle main menu visibility
Loading...
Searching...
No Matches
labeled_vertex_graph.h
1
/*
2
* Copyright 2026 Michele Comparini
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef GRAPHDOM_LABELED_VERTEX_GRAPH_H
8
#define GRAPHDOM_LABELED_VERTEX_GRAPH_H
9
10
#include "graph.h"
11
12
namespace
graphdom
{
14
20
template
<
typename
VertexType,
typename
VertexLabelType>
21
class
labeled_vertex_graph
:
virtual
public
graph
<VertexType> {
22
public
:
24
~labeled_vertex_graph
()
override
=
default
;
25
34
[[nodiscard]]
virtual
const
VertexLabelType&
get_vertex_label
(
const
typename
graph<VertexType>::vertex_const_handle
& vertex)
const
= 0;
35
44
[[nodiscard]]
virtual
VertexLabelType&
get_vertex_label
(
const
typename
graph<VertexType>::vertex_const_handle
& vertex) = 0;
45
};
46
}
47
48
namespace
graphdom
{
52
template
<
typename
VertexType,
typename
VertexLabelType>
53
class
default_vertex_labeller
final {
54
public
:
60
[[nodiscard]]
constexpr
VertexLabelType
operator()
(
const
VertexType&)
const
{
61
return
VertexLabelType();
62
}
63
};
64
}
65
66
#endif
//GRAPHDOM_LABELED_VERTEX_GRAPH_H
graphdom::default_vertex_labeller
This class template is the default vertex labeller used by all labeled-vertex graphs if no user-speci...
Definition
labeled_vertex_graph.h:53
graphdom::default_vertex_labeller::operator()
constexpr VertexLabelType operator()(const VertexType &) const
Definition
labeled_vertex_graph.h:60
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_vertex_graph
Every labeled-vertex graph created using this library is an instance of a concrete class publicly der...
Definition
labeled_vertex_graph.h:21
graphdom::labeled_vertex_graph::~labeled_vertex_graph
~labeled_vertex_graph() override=default
To be polymorphic, this class has a virtual destructor.
graphdom::labeled_vertex_graph::get_vertex_label
virtual VertexLabelType & get_vertex_label(const typename graph< VertexType >::vertex_const_handle &vertex)=0
graphdom::labeled_vertex_graph::get_vertex_label
virtual const VertexLabelType & get_vertex_label(const typename graph< VertexType >::vertex_const_handle &vertex) const =0
graphdom
Definition
adj_list.h:16
include
graphdom
labeled_vertex_graph.h
Generated by
1.17.0