GraphDom
Loading...
Searching...
No Matches
vertex_handle.h
1/*
2 * Copyright 2026 Michele Comparini
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef GRAPHDOM_VERTEX_HANDLE_IMPL_H
8#define GRAPHDOM_VERTEX_HANDLE_IMPL_H
9
10#include "../../graph.h"
11#include "../vertex_base_handle.h"
12#include "../vertex_handle.h"
13#include "../../multiset_graph.h"
14#include "../multiset_graph_vertex_handle.h"
15
16template <typename VertexType>
18vertex_base_handle< const graphdom::graph<VertexType>::vertex_container* >( other ) {}
19
20template <typename VertexType>
22vertex_base_handle< const graphdom::graph<VertexType>::vertex_container* >(
23 other.vertex_container_owner_graph_pointer,
24 other.vertex_container_owner_graph_edges_type,
25 other.vertex_container_pointer
26) {}
27
28template<typename VertexType>
29graphdom::graph<VertexType>::vertex_handle::operator typename multiset_graph<VertexType>::vertex_handle() const {
31}
32
33template<typename VertexType>
34typename graphdom::graph<VertexType>::vertex_handle& graphdom::graph<VertexType>::vertex_handle::operator=(const vertex_handle& other) {
35 if ( this != &other ) {
36 this->vertex_container_owner_graph_pointer = other.vertex_container_owner_graph_pointer;
37 this->vertex_container_owner_graph_edges_type = other.vertex_container_owner_graph_edges_type;
38 this->vertex_container_pointer = other.vertex_container_pointer;
39 }
40 return (*this);
41}
42
43template<typename VertexType>
44typename graphdom::graph<VertexType>::adj_list graphdom::graph<VertexType>::vertex_handle::adj_list() const {
46 this->vertex_container_owner_graph_pointer,
47 this->vertex_container_owner_graph_edges_type,
48 this->vertex_container_pointer
49 );
50}
51
52template<typename VertexType>
53typename graphdom::graph<VertexType>::adj_list graphdom::graph<VertexType>::vertex_handle::adj_list(const edge_type edge_type) const {
54 return graphdom::graph<VertexType>::adj_list(
55 this->vertex_container_owner_graph_pointer,
56 this->vertex_container_owner_graph_edges_type,
57 this->vertex_container_pointer,
59 graphdom::graph<VertexType>::edges_type_selection_type::undirected_edges :
60 graphdom::graph<VertexType>::edges_type_selection_type::directed_edges
61 );
62}
63
64template<typename VertexType>
65typename graphdom::graph<VertexType>::const_adj_list graphdom::graph<VertexType>::vertex_handle::const_adj_list() const {
66 return graphdom::graph<VertexType>::const_adj_list(
67 this->vertex_container_owner_graph_pointer,
68 this->vertex_container_owner_graph_edges_type,
69 this->vertex_container_pointer
70 );
71}
72
73template<typename VertexType>
74typename graphdom::graph<VertexType>::const_adj_list graphdom::graph<VertexType>::vertex_handle::const_adj_list(const edge_type edge_type) const {
75 return graphdom::graph<VertexType>::const_adj_list(
76 this->vertex_container_owner_graph_pointer,
77 this->vertex_container_owner_graph_edges_type,
78 this->vertex_container_pointer,
80 graphdom::graph<VertexType>::edges_type_selection_type::undirected_edges :
81 graphdom::graph<VertexType>::edges_type_selection_type::directed_edges
82 );
83}
84
85template<typename VertexType>
87 const graph<VertexType>* const vertex_container_owner_ptr,
88 const graph<VertexType>::graph_edges_type vertex_container_owner_et,
89 const typename graph<VertexType>::vertex_container* const vertex_container_ptr) :
90vertex_base_handle< const graphdom::graph<VertexType>::vertex_container* >(
91 vertex_container_owner_ptr,
92 vertex_container_owner_et,
93 vertex_container_ptr
94) {}
95
96#endif //GRAPHDOM_VERTEX_HANDLE_IMPL_H
Every valid instance of this class is a "container-like and non-owning" handle to a subset of the set...
Definition adj_list.h:32
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
operator typename multiset_graph< VertexType >::vertex_handle() const
Definition vertex_handle.h:29
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 can be used to identify a specific vertex of a multiset graph and ...
Definition multiset_graph_vertex_handle.h:31
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
@ undirected
This enum value means undirected edge.
Definition graph.h:22