7#ifndef GRAPHDOM_ADJ_LIST_ITERATOR_IMPL_H
8#define GRAPHDOM_ADJ_LIST_ITERATOR_IMPL_H
10#include "../../graph.h"
11#include "../adj_list_base_iterator.h"
12#include "../adj_list_iterator.h"
14template <
typename VertexType>
15graphdom::graph<VertexType>::adj_list_iterator::adj_list_iterator(
const adj_list_iterator& other_iterator) :
16graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >( other_iterator ){}
18template<
typename VertexType>
19graphdom::graph<VertexType>::adj_list_iterator::adj_list_iterator(
const typename multiset_graph<VertexType>::adj_list_iterator& other_iterator) :
20graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >(
21 other_iterator.iterator_owner_graph,
22 other_iterator.iterator_owner_graph_edges_type,
23 other_iterator.edge_begin_point_vertex_container,
24 other_iterator.edges_type_restriction,
25 other_iterator.inner_iterator_edge_current_type,
26 std::get< typename graph<VertexType>::adj_set<graph<VertexType>::vertex_container*>::iterator >( other_iterator.inner_iterator )
36template<
typename VertexType>
38 return graphdom::multiset_graph<VertexType>::adj_list_iterator(*
this);
41template<
typename VertexType>
46template<
typename VertexType>
47typename graphdom::graph<VertexType>::vertex_handle graphdom::graph<VertexType>::adj_list_iterator::operator*()
const {
48 return graphdom::graph<VertexType>::vertex_handle(
49 this->iterator_owner_graph,
50 this->iterator_owner_graph_edges_type,
51 ( std::holds_alternative<
typename graphdom::graph<VertexType>::adj_set<graphdom::graph<VertexType>::vertex_container*>::iterator >( this->inner_iterator ) ) ?
52 ( ( *( std::get<
typename graphdom::graph<VertexType>::adj_set<graphdom::graph<VertexType>::vertex_container*>::iterator >( this->inner_iterator ) ) )->vertex_container_ptr ) :
53 ( ( *( std::get<
typename graphdom::graph<VertexType>::adj_set<
const graphdom::graph<VertexType>::vertex_container*>::iterator >( this->inner_iterator ) ) )->vertex_container_ptr )
57template<
typename VertexType>
58typename graphdom::graph<VertexType>::adj_list_iterator& graphdom::graph<VertexType>::adj_list_iterator::operator=(
const adj_list_iterator& other) {
59 if (
this != &other ) {
60 this->iterator_owner_graph = other.iterator_owner_graph;
61 this->iterator_owner_graph_edges_type = other.iterator_owner_graph_edges_type;
62 this->edge_begin_point_vertex_container = other.edge_begin_point_vertex_container;
63 this->edges_type_restriction = other.edges_type_restriction;
64 this->inner_iterator_edge_current_type;
65 this->inner_iterator = other.inner_iterator;
70template<
typename VertexType>
71typename graphdom::graph<VertexType>::adj_list_iterator& graphdom::graph<VertexType>::adj_list_iterator::operator++() {
72 this->internal_single_increment();
76template<
typename VertexType>
77typename graphdom::graph<VertexType>::adj_list_iterator graphdom::graph<VertexType>::adj_list_iterator::operator++(
int) {
78 auto to_return = *
this;
83template<
typename VertexType>
84graphdom::graph<VertexType>::adj_list_iterator::adj_list_iterator(
const typename graph<VertexType>::adj_list_base_iterator<
const typename graph<VertexType>::vertex_container*>& other) :
85graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >( other ){}
87template<
typename VertexType>
88graphdom::graph<VertexType>::adj_list_iterator::adj_list_iterator(
89 const graph<VertexType>*
const iterator_owner_pointer,
90 const typename graph<VertexType>::graph_edges_type iterator_owner_graph_edges_type,
91 const typename graph<VertexType>::vertex_container*
const edge_begin_point_vertex_container,
92 const typename graph<VertexType>::edges_type_selection_type edges_type_restriction,
94graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >(
95 iterator_owner_pointer,
96 iterator_owner_graph_edges_type,
97 edge_begin_point_vertex_container,
98 edges_type_restriction,
99 inner_iterator_edge_current_type
102template<
typename VertexType>
103graphdom::graph<VertexType>::adj_list_iterator::adj_list_iterator(
104 const graph<VertexType>*
const iterator_owner_pointer,
105 const typename graph<VertexType>::graph_edges_type iterator_owner_graph_edges_type,
106 const typename graph<VertexType>::vertex_container*
const edge_begin_point_vertex_container,
107 const typename graph<VertexType>::edges_type_selection_type edges_type_restriction,
109 const typename graph<VertexType>::adj_set<
typename graph<VertexType>::vertex_container*>::iterator& inner_iterator) :
110graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >(
111 iterator_owner_pointer,
112 iterator_owner_graph_edges_type,
113 edge_begin_point_vertex_container,
114 edges_type_restriction,
115 inner_iterator_edge_current_type,
119template<
typename VertexType>
120graphdom::graph<VertexType>::adj_list_iterator::adj_list_iterator(
121 const graph<VertexType>*
const iterator_owner_pointer,
122 const typename graph<VertexType>::graph_edges_type iterator_owner_graph_edges_type,
123 const typename graph<VertexType>::vertex_container*
const edge_begin_point_vertex_container,
124 const typename graph<VertexType>::edges_type_selection_type edges_type_restriction,
126 const typename graph<VertexType>::adj_set<
const typename graph<VertexType>::vertex_container*>::iterator& inner_iterator) :
127graphdom::graph<VertexType>::adj_list_base_iterator< const graph<VertexType>::vertex_container* >(
128 iterator_owner_pointer,
129 iterator_owner_graph_edges_type,
130 edge_begin_point_vertex_container,
131 edges_type_restriction,
132 inner_iterator_edge_current_type,
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
Every graph created using this library is an instance of a concrete class publicly derived,...
Definition graph.h:43
edge_type
The enumerated type whose values represent the two types of edges of a graph.
Definition graph.h:21