Loading...
Searching...
No Matches
VisitorTags.hpp
1#pragma once
2#include <score/serialization/IsTemplate.hpp>
3
4#include <cinttypes>
5#include <limits>
6#include <type_traits>
7
9template <typename T>
10concept abstract_base = std::decay_t<T>::is_abstract_base_tag::value;
11
13template <typename T>
14concept identified_object = T::identified_object_tag;
15
17template <typename T>
18concept identified_entity = T::entity_tag;
19
21{
22};
24{
25};
26
27template <typename T, typename U = void>
29{
30 using type = has_no_base;
31 static constexpr bool value = false;
32};
33
34template <typename T>
35struct base_kind<T, std::enable_if_t<!std::is_same_v<T, typename T::score_base_type>>>
36{
37 using type = has_base;
38 static constexpr bool value = true;
39};
40
43{
44};
45
48{
49};
50
56
59{
60};
61
66
69{
70};
71
74{
75};
76
79{
80};
81
82template <typename T>
84{
86};
87
88template <typename T>
89 requires(!identified_object<T> && abstract_base<T> && !is_custom_serialized<T>::value)
94
95template <typename T>
96 requires(
98 && !is_custom_serialized<T>::value)
100{
101 using type = visitor_object_tag;
102};
103
104template <typename T>
105 requires(
107 && !is_custom_serialized<T>::value)
109{
110 using type = visitor_abstract_object_tag;
111};
112
113template <typename T>
114 requires(identified_entity<T> && !abstract_base<T> && !is_custom_serialized<T>::value)
116{
117 using type = visitor_entity_tag;
118};
119
120template <typename T>
121 requires(identified_entity<T> && abstract_base<T> && !is_custom_serialized<T>::value)
123{
124 using type = visitor_abstract_entity_tag;
125};
126
127template <typename T>
128 requires(
129 is_template<T>::value
130 && !abstract_base<T> && !identified_object<T> && !is_custom_serialized<T>::value)
132{
133 using type = visitor_template_tag;
134};
135
136template <typename T>
137 requires(is_custom_serialized<T>::value)
139{
140 using type = visitor_template_tag;
141};
142
143template <typename T>
144 requires(std::is_enum<T>::value)
146{
147 using type = visitor_enum_tag;
148};
149
150template <typename T>
152{
153 using type_limits = std::numeric_limits<std::underlying_type_t<T>>;
154 using int_limits = std::numeric_limits<int32_t>;
155 static constexpr bool value = type_limits::min() >= int_limits::min()
156 && type_limits::max() <= int_limits::max();
157};
Definition VisitorTags.hpp:10
Definition VisitorTags.hpp:18
Definition VisitorTags.hpp:14
STL namespace.
Definition VisitorTags.hpp:29
Definition VisitorTags.hpp:152
Definition VisitorTags.hpp:24
Definition VisitorTags.hpp:21
Definition VisitorTags.hpp:84
Classes that inherit from score::Entity and score::SerializableInterface.
Definition VisitorTags.hpp:64
Definition VisitorTags.hpp:54
Classes that only inherit from score::SerializableInterface.
Definition VisitorTags.hpp:43
All the other types.
Definition VisitorTags.hpp:79
Classes that only inherit from score::Entity.
Definition VisitorTags.hpp:59
Enums.
Definition VisitorTags.hpp:74
Classes that only inherit from score::IdentifiedObject.
Definition VisitorTags.hpp:48
Template classes.
Definition VisitorTags.hpp:69