GraphDom
Loading...
Searching...
No Matches
multiset_graph.h
1/*
2 * Copyright 2026 Michele Comparini
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef GRAPHDOM_MULTISET_GRAPH_H
8#define GRAPHDOM_MULTISET_GRAPH_H
9
10#include "graph.h"
11#include "set_graph.h"
12
13namespace graphdom {
15
18 template <typename VertexType>
19 class multiset_graph : virtual public graph<VertexType> {
20 public:
21 class vertex_handle;
22 class adj_list;
23 class adj_list_iterator;
24
26 ~multiset_graph() override = default;
27
34 [[nodiscard]] virtual vertex_handle insert_vertex(const VertexType& v_core) = 0;
35
42 [[nodiscard]] virtual vertex_handle insert_vertex(VertexType&& v_core) = 0;
43
45 protected:
46 using VertexContainerPointerType = typename graphdom::graph<VertexType>::vertex_container*;
47 using edge_endpoint = typename graphdom::graph<VertexType>::template edge_endpoint< VertexContainerPointerType >;
48 template <typename EdgeLabelType>
49 using labeled_directed_edge_endpoint = typename graphdom::graph<VertexType>::template labeled_directed_edge_endpoint<VertexContainerPointerType,EdgeLabelType>;
50 template <typename EdgeLabelType>
51 using labeled_undirected_edge_endpoint = typename graphdom::graph<VertexType>::template labeled_undirected_edge_endpoint<VertexContainerPointerType,EdgeLabelType>;
52 using custom_edge_endpoint_less = typename graphdom::graph<VertexType>::template custom_edge_endpoint_less<VertexContainerPointerType>;
53 using adj_set = typename graphdom::graph<VertexType>::template adj_set<VertexContainerPointerType>;
54 using non_mixed_graph_vertex_container = typename graphdom::graph<VertexType>::template non_mixed_graph_vertex_container<VertexContainerPointerType>;
55 using mixed_graph_vertex_container = typename graphdom::graph<VertexType>::template mixed_graph_vertex_container<VertexContainerPointerType>;
56 template <typename EdgeLabelType>
57 using non_mixed_graph_labeled_vertex_container = typename graphdom::graph<VertexType>::template non_mixed_graph_labeled_vertex_container<VertexContainerPointerType,EdgeLabelType>;
58 template <typename EdgeLabelType>
59 using mixed_graph_labeled_vertex_container = typename graphdom::graph<VertexType>::template mixed_graph_labeled_vertex_container<VertexContainerPointerType,EdgeLabelType>;
60
61 static vertex_handle vertex_handle_factory(
63 typename graphdom::graph<VertexType>::template non_mixed_graph_vertex_container<VertexContainerPointerType>&,
64 graphdom::edge_type non_mixed_graph_type
65 );
66
67 static vertex_handle vertex_handle_factory(
69 typename graphdom::graph<VertexType>::template mixed_graph_vertex_container<VertexContainerPointerType>&
70 );
71
72 static typename graphdom::graph<VertexType>::vertex_const_handle const_vertex_handle_factory(
74 const typename graphdom::graph<VertexType>::template non_mixed_graph_vertex_container<VertexContainerPointerType>&,
75 graphdom::edge_type non_mixed_graph_type
76 );
77
78 static typename graphdom::graph<VertexType>::vertex_const_handle const_vertex_handle_factory(
80 const typename graphdom::graph<VertexType>::template mixed_graph_vertex_container<VertexContainerPointerType>&
81 );
82
83 static VertexContainerPointerType get_vertex_container(const graphdom::multiset_graph<VertexType>::vertex_handle&);
84
85 static typename adj_set::const_iterator get_inner_iterator(const typename graphdom::graph<VertexType>::adj_list_const_iterator&);
86
87 static typename graphdom::graph<VertexType>::adj_list_iterator adj_list_iterator_factory(
88 const graphdom::multiset_graph<VertexType>* edge_multiset_vertex_graph_owner_ptr,
89 non_mixed_graph_vertex_container* edge_begin_point_ptr,
90 graphdom::edge_type edge_multiset_vertex_graph_owner_edges_type,
91 typename adj_set::iterator inner_itr
92 );
93
94 static typename graphdom::graph<VertexType>::adj_list_iterator adj_list_iterator_factory(
95 const graphdom::set_graph<VertexType>* edge_multiset_vertex_graph_owner_ptr,
96 mixed_graph_vertex_container* edge_begin_point_ptr,
97 typename adj_set::iterator inner_itr,
98 graphdom::edge_type inner_itr_edge_type,
99 bool inner_itr_is_limited_by_edge_type = false
100 );
102 };
103}
104
105#include "detail/multiset_graph_vertex_handle.h"
106#include "detail/multiset_graph_adj_list.h"
107#include "detail/multiset_graph_adj_list_iterator.h"
108
109#include "impl/multiset_graph.h"
110
111#endif //GRAPHDOM_MULTISET_GRAPH_H
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 valid instance of this class is a "container-like and non-owning" handle to a subset of the set...
Definition multiset_graph_adj_list.h:31
Every valid instance of this class can be used to identify a specific vertex of a multiset graph and ...
Definition multiset_graph_vertex_handle.h:31
Every multiset graph created using this library is an instance of a concrete class publicly derived,...
Definition multiset_graph.h:19
virtual vertex_handle insert_vertex(VertexType &&v_core)=0
virtual vertex_handle insert_vertex(const VertexType &v_core)=0
~multiset_graph() override=default
To be polymorphic, this class has a virtual destructor.
Every set graph created using this library is an instance of a concrete class publicly derived,...
Definition set_graph.h:18
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