GraphDom
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
12namespace 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
32namespace graphdom {
36 template <typename VertexType, typename EdgeLabelType>
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
This class template is the default vertex labeller used by all labeled-edge graphs if no user-specifi...
Definition labeled_edge_graph.h:37
constexpr EdgeLabelType operator()(const typename graph< VertexType >::vertex_const_handle &, const typename graph< VertexType >::vertex_const_handle &) const
Definition labeled_edge_graph.h:44
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
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
Every graph created using this library is an instance of a concrete class publicly derived,...
Definition graph.h:43
Every labeled-edge graph created using this library is an instance of a concrete class publicly deriv...
Definition labeled_edge_graph.h:21
~labeled_edge_graph() override=default
To be polymorphic, this class has a virtual destructor.
Definition adj_list.h:16
edge_type
The enumerated type whose values represent the two types of edges of a graph.
Definition graph.h:21