GraphDom
Loading...
Searching...
No Matches
vertex_base_handle.h
1/*
2 * Copyright 2026 Michele Comparini
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef GRAPHDOM_VERTEX_BASE_HANDLE_IMPL_H
8#define GRAPHDOM_VERTEX_BASE_HANDLE_IMPL_H
9
10#include "../../graph.h"
11#include "../vertex_container.h"
12#include "../vertex_base_handle.h"
13
14template<typename VertexType>
15template<typename VertexContainerPointerType>
16graphdom::graph<VertexType>::vertex_base_handle<VertexContainerPointerType>::vertex_base_handle(
17 const graph<VertexType>* vertex_container_owner_ptr,
18 const graph_edges_type vertex_container_owner_et,
19 const VertexContainerPointerType vertex_container_ptr ) :
20 vertex_container_owner_graph_pointer(vertex_container_owner_ptr),
21 vertex_container_owner_graph_edges_type(vertex_container_owner_et),
22 vertex_container_pointer(vertex_container_ptr) {}
23
24template<typename VertexType>
25template<typename VertexContainerPointerType>
26constexpr auto& graphdom::graph<VertexType>::vertex_base_handle<VertexContainerPointerType>::operator*() const {
27 return vertex_container_pointer->vertex;
28}
29
30template<typename VertexType>
31template<typename VertexContainerPointerType>
32constexpr auto* graphdom::graph<VertexType>::vertex_base_handle<VertexContainerPointerType>::operator->() const {
33 return &( vertex_container_pointer->vertex );
34}
35
36template<typename VertexType>
37template<typename VertexContainerPointerType>
38template<typename K>
39constexpr bool graphdom::graph<VertexType>::vertex_base_handle<VertexContainerPointerType>::operator==(
40 const vertex_base_handle<K>& other_handle) const {
41 return this->vertex_container_pointer == other_handle.vertex_container_pointer;
42}
43
44template<typename VertexType>
45template<typename VertexContainerPointerType>
46template<typename K>
47constexpr bool graphdom::graph<VertexType>::vertex_base_handle<VertexContainerPointerType>::operator!=(
48 const vertex_base_handle<K>& other_handle) const {
49 return this->vertex_container_pointer != other_handle.vertex_container_pointer;
50}
51
52#endif //GRAPHDOM_VERTEX_BASE_HANDLE_IMPL_H