GraphDom
Loading...
Searching...
No Matches
adj_list.h
1/*
2 * Copyright 2026 Michele Comparini
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef GRAPHDOM_ADJ_LIST_IMPL_H
8#define GRAPHDOM_ADJ_LIST_IMPL_H
9
10#include "../../graph.h"
11#include "../vertex_container.h"
12#include "../base_adj_list.h"
13#include "../adj_list.h"
14#include "../../multiset_graph.h"
15#include "../multiset_graph_adj_list.h"
16#include "graphdom/detail/adj_list_iterator.h"
17
18template <typename VertexType>
19graphdom::graph<VertexType>::adj_list::adj_list(const adj_list& other) :
20graphdom::graph<VertexType>::base_adj_list< const graph<VertexType>::vertex_container* >( other ){}
21
22template <typename VertexType>
23graphdom::graph<VertexType>::adj_list::adj_list(const typename graphdom::multiset_graph<VertexType>::adj_list& other) :
24graphdom::graph<VertexType>::base_adj_list< const graph<VertexType>::vertex_container* >(
25 other.adj_list_owner_graph_pointer,
26 other.adj_list_owner_graph_edges_type,
27 other.adj_list_common_begin_point_vertex_container_pointer,
28 other.adj_list_edges_type_selection
29){}
30
31template<typename VertexType>
32graphdom::graph<VertexType>::adj_list::operator typename multiset_graph<VertexType>::adj_list() const {
34}
35
36template<typename VertexType>
37typename graphdom::graph<VertexType>::adj_list_iterator graphdom::graph<VertexType>::adj_list::begin() const {
38 if ( dynamic_cast< const graphdom::multiset_graph<VertexType>* >( this->adj_list_owner_graph_pointer ) != nullptr ) {
39 return graphdom::graph<VertexType>::adj_list_iterator( this->template internal_begin<graphdom::graph<VertexType>::vertex_container*>() );
40 }
41 return graphdom::graph<VertexType>::adj_list_iterator( this->template internal_begin<const graphdom::graph<VertexType>::vertex_container*>() );
42}
43
44template<typename VertexType>
45typename graphdom::graph<VertexType>::adj_list_iterator graphdom::graph<VertexType>::adj_list::end() const {
46 if ( dynamic_cast< const graphdom::multiset_graph<VertexType>* >( this->adj_list_owner_graph_pointer ) != nullptr ) {
47 return graphdom::graph<VertexType>::adj_list_iterator( this->template internal_end<graphdom::graph<VertexType>::vertex_container*>() );
48 }
49 return graphdom::graph<VertexType>::adj_list_iterator( this->template internal_end<const graphdom::graph<VertexType>::vertex_container*>() );
50}
51
52template<typename VertexType>
53typename graphdom::graph<VertexType>::adj_list_const_iterator graphdom::graph<VertexType>::adj_list::cbegin() const {
54 return begin();
55}
56
57template<typename VertexType>
58typename graphdom::graph<VertexType>::adj_list_const_iterator graphdom::graph<VertexType>::adj_list::cend() const {
59 return end();
60}
61
62template<typename VertexType>
63graphdom::graph<VertexType>::adj_list::adj_list(
64 const graphdom::graph<VertexType>* const adj_list_owner_graph_pointer,
65 const typename graphdom::graph<VertexType>::graph_edges_type adj_list_owner_graph_edges_type,
66 const typename graphdom::graph<VertexType>::vertex_container* const adj_list_common_begin_point_vertex_container_pointer,
67 const typename graphdom::graph<VertexType>::edges_type_selection_type adj_list_edges_type_selection) :
68graphdom::graph<VertexType>::base_adj_list< const graphdom::graph<VertexType>::vertex_container* >(
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
73){}
74
75#endif //GRAPHDOM_ADJ_LIST_IMPL_H
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 is a "container-like and non-owning" handle to a subset of the set...
Definition multiset_graph_adj_list.h:31
Definition adj_list.h:16