Graphle
1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
graphle
graph
constraint_debug_helper.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
graph/graph_concepts.hpp
>
4
#include <
meta/value.hpp
>
5
6
7
namespace
graphle::detail
{
12
struct
all_constraints_satisfied
{};
14
template
<
typename
T>
struct
invalid_is_directed_value
{};
16
template
<
typename
Vertex,
typename
Get>
struct
invalid_vertex_getter
{};
18
template
<
typename
Vertex,
typename
Get>
struct
invalid_edge_getter
{};
20
template
<
typename
Vertex,
typename
Get>
struct
invalid_in_edge_getter
{};
22
template
<
typename
Vertex,
typename
Get>
struct
invalid_out_edge_getter
{};
23
24
31
#ifdef GRAPHLE_DOXYGEN
32
#define GRAPHLE_NO_STATIC_ASSERT "Not Defined"
33
#endif
34
35
55
template
<
56
typename
Vertex,
57
typename
IsDirected,
58
typename
GetVertices,
59
typename
GetEdges,
60
typename
GetOutEdges,
61
typename
GetInEdges
62
>
consteval
auto
graph_constraints_check
(
void
) {
63
#ifndef GRAPHLE_NO_STATIC_ASSERT
64
static_assert
(
meta::value_wrapper_of<IsDirected, bool>
);
65
static_assert
(
maybe_vertex_getter<GetVertices, Vertex>
);
66
static_assert
(
maybe_edge_getter<GetEdges, Vertex>
);
67
static_assert
(
maybe_vertex_edge_getter<GetInEdges, Vertex>
);
68
static_assert
(
maybe_vertex_edge_getter<GetOutEdges, Vertex>
);
69
#endif
70
71
72
if
constexpr
(!
meta::value_wrapper_of<IsDirected, bool>
) {
73
return
invalid_is_directed_value<IsDirected>
{};
74
}
75
76
else
if
constexpr
(!
maybe_vertex_getter<GetVertices, Vertex>
) {
77
return
invalid_vertex_getter<Vertex, GetVertices>
{};
78
}
79
80
else
if
constexpr
(!
maybe_edge_getter<GetEdges, Vertex>
) {
81
return
invalid_edge_getter<Vertex, GetEdges>
{};
82
}
83
84
else
if
constexpr
(!
maybe_vertex_edge_getter<GetInEdges, Vertex>
) {
85
return
invalid_in_edge_getter<Vertex, GetInEdges>
{};
86
}
87
88
else
if
constexpr
(!
maybe_vertex_edge_getter<GetOutEdges, Vertex>
) {
89
return
invalid_out_edge_getter<Vertex, GetOutEdges>
{};
90
}
91
92
else
return
all_constraints_satisfied
{};
93
}
94
}
graphle::maybe_edge_getter
Definition:
graph_concepts.hpp:94
graphle::maybe_vertex_edge_getter
Definition:
graph_concepts.hpp:95
graphle::maybe_vertex_getter
Definition:
graph_concepts.hpp:93
graphle::meta::value_wrapper_of
Definition:
value.hpp:20
graph_concepts.hpp
graphle::detail::graph_constraints_check
consteval auto graph_constraints_check(void)
Definition:
constraint_debug_helper.hpp:62
graphle::detail
Definition:
doxygen.hpp:19
graphle::detail::all_constraints_satisfied
Definition:
constraint_debug_helper.hpp:12
graphle::detail::invalid_edge_getter
Definition:
constraint_debug_helper.hpp:18
graphle::detail::invalid_in_edge_getter
Definition:
constraint_debug_helper.hpp:20
graphle::detail::invalid_is_directed_value
Definition:
constraint_debug_helper.hpp:14
graphle::detail::invalid_out_edge_getter
Definition:
constraint_debug_helper.hpp:22
graphle::detail::invalid_vertex_getter
Definition:
constraint_debug_helper.hpp:16
value.hpp
Generated by
1.9.5