GraphDom
Loading...
Searching...
No Matches
adj_list_const_iterator.h
1/*
2 * Copyright 2026 Michele Comparini
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef GRAPHDOM_ADJ_LIST_CONST_ITERATOR_IMPL_H
8#define GRAPHDOM_ADJ_LIST_CONST_ITERATOR_IMPL_H
9
10#include "../../graph.h"
11#include "../adj_list_base_iterator.h"
12#include "../adj_list_const_iterator.h"
13
14template<typename VertexType>
16graphdom::graph<VertexType>::adj_list_base_iterator< const graphdom::graph<VertexType>::vertex_container* >(){}
17
18template<typename VertexType>
19graphdom::graph<VertexType>::adj_list_const_iterator::adj_list_const_iterator(const adj_list_const_iterator& other_iterator) :
20graphdom::graph<VertexType>::adj_list_base_iterator< const graphdom::graph<VertexType>::vertex_container* >(
21 other_iterator
22){}
23
24template<typename VertexType>
25graphdom::graph<VertexType>::adj_list_const_iterator::adj_list_const_iterator(const typename graphdom::graph<VertexType>::adj_list_iterator& other_iterator) :
26graphdom::graph<VertexType>::adj_list_base_iterator< const graphdom::graph<VertexType>::vertex_container* >(
27 other_iterator
28){}
29
30template<typename VertexType>
31graphdom::graph<VertexType>::adj_list_const_iterator::adj_list_const_iterator(const typename graphdom::multiset_graph<VertexType>::adj_list_iterator& other_iterator) :
32graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >(
33 other_iterator.iterator_owner_graph,
34 other_iterator.iterator_owner_graph_edges_type,
35 other_iterator.edge_begin_point_vertex_container,
36 other_iterator.edges_type_restriction,
37 other_iterator.inner_iterator_edge_current_type
38) {
39 if ( std::holds_alternative< typename graph<VertexType>::adj_set<graph<VertexType>::vertex_container*>::iterator >( other_iterator.inner_iterator ) ) {
40 this->inner_iterator = std::get< typename graph<VertexType>::adj_set<graph<VertexType>::vertex_container*>::iterator >( other_iterator.inner_iterator );
41 }
42}
43
44template<typename VertexType>
46 return *this;
47}
48
49template<typename VertexType>
52 this->iterator_owner_graph,
53 this->iterator_owner_graph_edges_type,
54 ( std::holds_alternative< typename graphdom::graph<VertexType>::adj_set<graphdom::graph<VertexType>::vertex_container*>::iterator >( this->inner_iterator ) ) ?
55 ( ( *( std::get< typename graphdom::graph<VertexType>::adj_set<graphdom::graph<VertexType>::vertex_container*>::iterator >( this->inner_iterator ) ) )->vertex_container_ptr ) :
56 ( ( *( std::get< typename graphdom::graph<VertexType>::adj_set<const graphdom::graph<VertexType>::vertex_container*>::iterator >( this->inner_iterator ) ) )->vertex_container_ptr )
57 );
58}
59
60template<typename VertexType>
62 if ( this != &other ) {
63 this->iterator_owner_graph = other.iterator_owner_graph;
64 this->iterator_owner_graph_edges_type = other.iterator_owner_graph_edges_type;
65 this->edge_begin_point_vertex_container = other.edge_begin_point_vertex_container;
66 this->edges_type_restriction = other.edges_type_restriction;
67 this->inner_iterator = other.inner_iterator;
68 this->inner_iterator_edge_current_type = other.inner_iterator_edge_current_type;
69 }
70 return *this;
71}
72
73template<typename VertexType>
75 this->internal_single_increment();
76 return *this;
77}
78
79template<typename VertexType>
81 auto to_return = *this;
82 ++(*this);
83 return to_return;
84}
85
86template<typename VertexType>
87graphdom::graph<VertexType>::adj_list_const_iterator::adj_list_const_iterator(const typename graph<VertexType>::adj_list_base_iterator<const typename graph<VertexType>::vertex_container*>& other) :
88graphdom::graph<VertexType>::adj_list_base_iterator< const graphdom::graph<VertexType>::vertex_container* >( other ){}
89
90template<typename VertexType>
92 const graph<VertexType>* const iterator_owner_pointer,
93 const typename graph<VertexType>::graph_edges_type iterator_owner_graph_edges_type,
94 const typename graph<VertexType>::vertex_container* const edge_begin_point_vertex_container,
95 const typename graph<VertexType>::edges_type_selection_type edges_type_restriction,
96 const graphdom::edge_type inner_iterator_edge_current_type) :
97graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >(
98 iterator_owner_pointer,
99 iterator_owner_graph_edges_type,
100 edge_begin_point_vertex_container,
101 edges_type_restriction,
102 inner_iterator_edge_current_type
103){}
104
105template<typename VertexType>
107 const graph<VertexType>* const iterator_owner_pointer,
108 const typename graph<VertexType>::graph_edges_type iterator_owner_graph_edges_type,
109 const typename graph<VertexType>::vertex_container* const edge_begin_point_vertex_container,
110 const typename graph<VertexType>::edges_type_selection_type edges_type_restriction,
111 const graphdom::edge_type inner_iterator_edge_current_type,
112 const typename graph<VertexType>::adj_set<typename graph<VertexType>::vertex_container *>::iterator& inner_iterator) :
113graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >(
114 iterator_owner_pointer,
115 iterator_owner_graph_edges_type,
116 edge_begin_point_vertex_container,
117 edges_type_restriction,
118 inner_iterator_edge_current_type,
119 inner_iterator
120){}
121
122template<typename VertexType>
124 const graph<VertexType>* const iterator_owner_pointer,
125 const typename graph<VertexType>::graph_edges_type iterator_owner_graph_edges_type,
126 const typename graph<VertexType>::vertex_container* const edge_begin_point_vertex_container,
127 const typename graph<VertexType>::edges_type_selection_type edges_type_restriction,
128 const graphdom::edge_type inner_iterator_edge_current_type,
129 const typename graph<VertexType>::adj_set<const typename graph<VertexType>::vertex_container*>::iterator& inner_iterator) :
130graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >(
131 iterator_owner_pointer,
132 iterator_owner_graph_edges_type,
133 edge_begin_point_vertex_container,
134 edges_type_restriction,
135 inner_iterator_edge_current_type,
136 inner_iterator
137){}
138
139#endif //GRAPHDOM_ADJ_LIST_CONST_ITERATOR_IMPL_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
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