GraphDom
Loading...
Searching...
No Matches
vertex_const_handle.h
1/*
2 * Copyright 2026 Michele Comparini
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef GRAPHDOM_VERTEX_CONST_HANDLE_IMPL_H
8#define GRAPHDOM_VERTEX_CONST_HANDLE_IMPL_H
9
10#include "../../graph.h"
11#include "../vertex_base_handle.h"
12#include "../vertex_const_handle.h"
13
14template <typename VertexType>
15graphdom::graph<VertexType>::vertex_const_handle::vertex_const_handle(const typename graph<VertexType>::vertex_const_handle& other) :
16graphdom::graph<VertexType>::vertex_base_handle< const graphdom::graph<VertexType>::vertex_container* >( other ){}
17
18template<typename VertexType>
19graphdom::graph<VertexType>::vertex_const_handle::vertex_const_handle(const typename graph<VertexType>::vertex_handle& other) :
20graphdom::graph<VertexType>::vertex_base_handle< const graphdom::graph<VertexType>::vertex_container* >( other ){}
21
22template<typename VertexType>
23graphdom::graph<VertexType>::vertex_const_handle::vertex_const_handle(const typename graphdom::multiset_graph<VertexType>::vertex_handle& other) :
24graphdom::graph<VertexType>::vertex_base_handle< const graphdom::graph<VertexType>::vertex_container* >(
25 other.vertex_container_owner_graph_pointer,
26 other.vertex_container_owner_graph_edges_type,
27 other.vertex_container_pointer
28) {}
29
30template<typename VertexType>
31typename graphdom::graph<VertexType>::vertex_const_handle& graphdom::graph<VertexType>::vertex_const_handle::operator=(const vertex_const_handle& other) {
32 if ( this != &other ) {
33 this->vertex_container_owner_graph_pointer = other.vertex_container_owner_graph_pointer;
34 this->vertex_container_owner_graph_edges_type = other.vertex_container_owner_graph_edges_type;
35 this->vertex_container_pointer = other.vertex_container_pointer;
36 }
37 return (*this);
38}
39
40template<typename VertexType>
41typename graphdom::graph<VertexType>::const_adj_list graphdom::graph<VertexType>::vertex_const_handle::adj_list() const {
43 this->vertex_container_owner_graph_pointer,
44 this->vertex_container_owner_graph_edges_type,
45 this->vertex_container_pointer
46 );
47}
48
49template<typename VertexType>
50typename graphdom::graph<VertexType>::const_adj_list graphdom::graph<VertexType>::vertex_const_handle::adj_list(const edge_type edge_type) const {
51 return graphdom::graph<VertexType>::const_adj_list(
52 this->vertex_container_owner_graph_pointer,
53 this->vertex_container_owner_graph_edges_type,
54 this->vertex_container_pointer,
56 graphdom::graph<VertexType>::edges_type_selection_type::undirected_edges :
57 graphdom::graph<VertexType>::edges_type_selection_type::directed_edges
58 );
59}
60
61template<typename VertexType>
62typename graphdom::graph<VertexType>::const_adj_list graphdom::graph<VertexType>::vertex_const_handle::const_adj_list() const {
63 return adj_list();
64}
65
66template<typename VertexType>
67typename graphdom::graph<VertexType>::const_adj_list graphdom::graph<VertexType>::vertex_const_handle::const_adj_list(const edge_type edge_type) const {
68 return adj_list(edge_type);
69}
70
71template<typename VertexType>
72graphdom::graph<VertexType>::vertex_const_handle::vertex_const_handle(
73 const graph<VertexType>* const vertex_container_owner_ptr,
74 const graph<VertexType>::graph_edges_type vertex_container_owner_et,
75 const typename graph<VertexType>::vertex_container* const vertex_container_ptr) :
76graphdom::graph<VertexType>::vertex_base_handle< const graphdom::graph<VertexType>::vertex_container* >(
77 vertex_container_owner_ptr,
78 vertex_container_owner_et,
79 vertex_container_ptr
80) {}
81
82#endif //GRAPHDOM_VERTEX_CONST_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 is a "container-like and non-owning" handle to a subset of the set...
Definition const_adj_list.h:35
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 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