7#ifndef GRAPHDOM_BASE_ADJ_LIST_IMPL_H
8#define GRAPHDOM_BASE_ADJ_LIST_IMPL_H
10#include "../../graph.h"
11#include "../base_adj_list.h"
12#include "../adj_list_base_iterator.h"
14template <
typename VertexType>
15template <
typename VertexContainerPo
interType>
16graphdom::graph<VertexType>::base_adj_list<VertexContainerPointerType>::base_adj_list(
17 const graph<VertexType>*
const adj_list_owner_graph_pointer,
18 const graph_edges_type adj_list_owner_graph_edges_type,
19 const VertexContainerPointerType adj_list_common_begin_point_vertex_container_pointer,
20 const graph<VertexType>::edges_type_selection_type adj_list_edges_type_selection
22adj_list_owner_graph_pointer(adj_list_owner_graph_pointer),
23adj_list_owner_graph_edges_type(adj_list_owner_graph_edges_type),
24adj_list_common_begin_point_vertex_container_pointer(adj_list_common_begin_point_vertex_container_pointer),
25adj_list_edges_type_selection(adj_list_edges_type_selection) {}
27template <
typename VertexType>
28template <
typename VertexContainerPo
interType>
31graphdom::graph<VertexType>::base_adj_list<VertexContainerPointerType>::internal_begin()
const {
33 std::is_same< K , graphdom::graph<VertexType>::vertex_container* >::value ||
34 std::is_same< K , const graphdom::graph<VertexType>::vertex_container* >::value
38 if ( ( undirected_adj_set ==
nullptr ) && ( directed_adj_set ==
nullptr ) ) {
40 adj_list_owner_graph_pointer,
41 adj_list_owner_graph_edges_type,
42 adj_list_common_begin_point_vertex_container_pointer,
43 adj_list_edges_type_selection,
47 if ( undirected_adj_set !=
nullptr ) {
48 if ( undirected_adj_set->empty() && directed_adj_set !=
nullptr ) {
49 if ( directed_adj_set->empty() ) {
51 adj_list_owner_graph_pointer,
52 adj_list_owner_graph_edges_type,
53 adj_list_common_begin_point_vertex_container_pointer,
54 adj_list_edges_type_selection,
56 undirected_adj_set->begin()
60 adj_list_owner_graph_pointer,
61 adj_list_owner_graph_edges_type,
62 adj_list_common_begin_point_vertex_container_pointer,
63 adj_list_edges_type_selection,
65 directed_adj_set->begin()
69 adj_list_owner_graph_pointer,
70 adj_list_owner_graph_edges_type,
71 adj_list_common_begin_point_vertex_container_pointer,
72 adj_list_edges_type_selection,
74 undirected_adj_set->begin()
78 adj_list_owner_graph_pointer,
79 adj_list_owner_graph_edges_type,
80 adj_list_common_begin_point_vertex_container_pointer,
81 adj_list_edges_type_selection,
83 directed_adj_set->begin()
87template <
typename VertexType>
88template <
typename VertexContainerPo
interType>
91graphdom::graph<VertexType>::base_adj_list<VertexContainerPointerType>::internal_end()
const {
93 std::is_same< K , graphdom::graph<VertexType>::vertex_container* >::value ||
94 std::is_same< K , const graphdom::graph<VertexType>::vertex_container* >::value
98 if ( ( undirected_adj_set ==
nullptr ) && ( directed_adj_set ==
nullptr ) ) {
100 adj_list_owner_graph_pointer,
101 adj_list_owner_graph_edges_type,
102 adj_list_common_begin_point_vertex_container_pointer,
103 adj_list_edges_type_selection,
107 if ( directed_adj_set !=
nullptr ) {
108 if ( directed_adj_set->empty() && undirected_adj_set !=
nullptr ) {
110 adj_list_owner_graph_pointer,
111 adj_list_owner_graph_edges_type,
112 adj_list_common_begin_point_vertex_container_pointer,
113 adj_list_edges_type_selection,
115 undirected_adj_set->end()
119 adj_list_owner_graph_pointer,
120 adj_list_owner_graph_edges_type,
121 adj_list_common_begin_point_vertex_container_pointer,
122 adj_list_edges_type_selection,
124 directed_adj_set->end()
128 adj_list_owner_graph_pointer,
129 adj_list_owner_graph_edges_type,
130 adj_list_common_begin_point_vertex_container_pointer,
131 adj_list_edges_type_selection,
133 undirected_adj_set->end()
137template <
typename VertexType>
138template <
typename VertexContainerPo
interType>
141graphdom::graph<VertexType>::base_adj_list<VertexContainerPointerType>::get_adj_set_if_accessible(
const graphdom::edge_type edge_type)
const {
143 std::is_same< K , graphdom::graph<VertexType>::vertex_container* >::value ||
144 std::is_same< K , const graphdom::graph<VertexType>::vertex_container* >::value
146 auto*
const undirected_adj =
147 ( adj_list_owner_graph_edges_type == mixed ) ?
148 &( (
static_cast< const typename graphdom::graph<VertexType>::mixed_graph_vertex_container<K
>* >( adj_list_common_begin_point_vertex_container_pointer ) )->undirected_adj )
151 ( adj_list_owner_graph_edges_type ==
undirected ) ?
152 &( (
static_cast< const typename graphdom::graph<VertexType>::non_mixed_graph_vertex_container<K
>* >( adj_list_common_begin_point_vertex_container_pointer ) )->adj )
156 auto*
const directed_adj =
157 ( adj_list_owner_graph_edges_type == mixed ) ?
158 &( (
static_cast< const typename graphdom::graph<VertexType>::mixed_graph_vertex_container<K
>* >( adj_list_common_begin_point_vertex_container_pointer ) )->directed_adj )
161 ( adj_list_owner_graph_edges_type ==
directed ) ?
162 &( (
static_cast< const typename graphdom::graph<VertexType>::non_mixed_graph_vertex_container<K
>* >( adj_list_common_begin_point_vertex_container_pointer ) )->adj )
166 if ( edge_type == edge_type::undirected ) {
167 if ( adj_list_edges_type_selection != directed_edges ) {
168 return undirected_adj;
172 if ( adj_list_edges_type_selection != undirected_edges ) {
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
@ undirected
This enum value means undirected edge.
Definition graph.h:22
@ directed
This enum value means directed edge.
Definition graph.h:23