GraphDom
Toggle main menu visibility
Loading...
Searching...
No Matches
graph.h
1
/*
2
* Copyright 2026 Michele Comparini
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef GRAPHDOM_GRAPH_IMPL_H
8
#define GRAPHDOM_GRAPH_IMPL_H
9
10
#include "../graph.h"
11
12
template
<
typename
VertexType>
13
typename
graphdom::graph<VertexType>::vertex_handle
graphdom::graph<VertexType>::vertex_handle_factory
(
14
const
graphdom::graph<VertexType>
*
const
graph_ptr,
15
const
graphdom::graph<VertexType>::non_mixed_graph_vertex_container<const vertex_container*>& vertex_container_reference,
16
const
graphdom::edge_type
non_mixed_graph_type) {
17
return
graphdom::graph<VertexType>::vertex_handle
(
18
graph_ptr,
19
( non_mixed_graph_type ==
graphdom::edge_type::undirected
) ?
graphdom::graph<VertexType>::graph_edges_type::undirected
:
graphdom::graph<VertexType>::graph_edges_type::directed
,
20
&vertex_container_reference
21
);
22
}
23
24
template
<
typename
VertexType>
25
typename
graphdom::graph<VertexType>::vertex_handle
graphdom::graph<VertexType>::vertex_handle_factory
(
26
const
graphdom::graph<VertexType>
*
const
graph_ptr,
27
const
graphdom::graph<VertexType>::mixed_graph_vertex_container<const vertex_container*>& vertex_container_reference) {
28
return
graphdom::graph<VertexType>::vertex_handle
(
29
graph_ptr,
30
graphdom::graph<VertexType>::graph_edges_type::mixed
,
31
&vertex_container_reference
32
);
33
}
34
35
template
<
typename
VertexType>
36
typename
graphdom::graph<VertexType>::vertex_const_handle
graphdom::graph<VertexType>::vertex_const_handle_factory
(
37
const
graphdom::graph<VertexType>
*
const
graph_ptr,
38
const
graphdom::graph<VertexType>::non_mixed_graph_vertex_container<const vertex_container*>& vertex_container_reference,
39
const
graphdom::edge_type
non_mixed_graph_type) {
40
return
graphdom::graph<VertexType>::vertex_const_handle
(
41
graph_ptr,
42
( non_mixed_graph_type ==
graphdom::edge_type::undirected
) ?
graphdom::graph<VertexType>::graph_edges_type::undirected
:
graphdom::graph<VertexType>::graph_edges_type::directed
,
43
&vertex_container_reference
44
);
45
}
46
47
template
<
typename
VertexType>
48
typename
graphdom::graph<VertexType>::vertex_const_handle
graphdom::graph<VertexType>::vertex_const_handle_factory
(
49
const
graphdom::graph<VertexType>
*
const
graph_ptr,
50
const
graphdom::graph<VertexType>::mixed_graph_vertex_container<const vertex_container*>& vertex_container_reference) {
51
return
graphdom::graph<VertexType>::vertex_const_handle
(
52
graph_ptr,
53
graphdom::graph<VertexType>::graph_edges_type::mixed
,
54
&vertex_container_reference
55
);
56
}
57
58
template
<
typename
VertexType>
59
const
graphdom::graph<VertexType>
*
graphdom::graph<VertexType>::get_owner_graph
(
60
const
graphdom::graph<VertexType>::vertex_const_handle
& ptr) {
61
return
ptr.vertex_container_owner_graph_pointer;
62
}
63
64
template
<
typename
VertexType>
65
const
typename
graphdom::graph<VertexType>::vertex_container*
graphdom::graph<VertexType>::get_vertex_container
(
66
const
graphdom::graph<VertexType>::vertex_const_handle
& ptr) {
67
return
ptr.vertex_container_pointer;
68
}
69
70
template
<
typename
VertexType>
71
const
graphdom::graph<VertexType>
*
graphdom::graph<VertexType>::get_owner_graph
(
72
const
graphdom::graph<VertexType>::adj_list_const_iterator
& const_edge_itr) {
73
return
const_edge_itr.iterator_owner_graph;
74
}
75
76
template
<
typename
VertexType>
77
const
typename
graphdom::graph<VertexType>::vertex_container*
graphdom::graph<VertexType>::get_begin_point
(
78
const
graphdom::graph<VertexType>::adj_list_const_iterator
& const_edge_itr) {
79
return
const_edge_itr.edge_begin_point_vertex_container;
80
}
81
82
#endif
//GRAPHDOM_GRAPH_IMPL_H
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::vertex_handle
Every valid instance of this class can be used to identify a specific vertex of a graph and to access...
Definition
vertex_handle.h:32
graphdom::graph
Every graph created using this library is an instance of a concrete class publicly derived,...
Definition
graph.h:43
graphdom::edge_type
edge_type
The enumerated type whose values represent the two types of edges of a graph.
Definition
graph.h:21
graphdom::undirected
@ undirected
This enum value means undirected edge.
Definition
graph.h:22
include
graphdom
impl
graph.h
Generated by
1.17.0