IDS peak AFL v2.1.0
Loading...
Searching...
No Matches
peak_common_type_traits.hpp
Go to the documentation of this file.
1
5
6#pragma once
7
8#include <type_traits>
9#include <cstddef>
10#include <cstdint>
11
12
13// NOLINTBEGIN(readability-identifier-naming)
26struct peak_common_size;
29
30// NOLINTEND(readability-identifier-naming)
31
33
34namespace peak
35{
36namespace common
37{
38
39class Version;
40
41namespace detail
42{
43
44template <typename PointType, typename SizeType>
45class RectangleT;
46template <typename T>
47class PointT;
48template <typename T>
49class SizeT;
50
51template <typename T>
52class IntervalT;
53
54template <typename T>
55class RangeT;
56
57template <typename T>
58class SizeT;
59
60template <typename T>
61struct c_type_of_;
62
63template <>
64struct c_type_of_<IntervalT<uint32_t>>
65{
66 using type = peak_common_interval_u;
67};
68
69template <>
70struct c_type_of_<IntervalT<int32_t>>
71{
72 using type = peak_common_interval;
73};
74
75template <>
76struct c_type_of_<IntervalT<float>>
77{
78 using type = peak_common_interval_f;
79};
80
81template <>
82struct c_type_of_<RangeT<uint32_t>>
83{
84 using type = peak_common_range_u;
85};
86
87template <>
88struct c_type_of_<RangeT<int32_t>>
89{
90 using type = peak_common_range;
91};
92
93template <>
94struct c_type_of_<RangeT<float>>
95{
96 using type = peak_common_range_f;
97};
98
99template <>
100struct c_type_of_<RectangleT<int32_t, uint32_t>>
101{
102 using type = peak_common_rectangle;
103};
104
105template <>
106struct c_type_of_<RectangleT<float, float>>
107{
108 using type = peak_common_rectangle_f;
109};
110
111template <>
112struct c_type_of_<RectangleT<uint32_t, uint32_t>>
113{
114 using type = peak_common_rectangle_u;
115};
116
117template <>
118struct c_type_of_<PointT<int32_t>>
119{
120 using type = peak_common_point;
121};
122
123template <>
124struct c_type_of_<PointT<uint32_t>>
125{
126 using type = peak_common_point_u;
127};
128
129template <>
130struct c_type_of_<PointT<float>>
131{
132 using type = peak_common_point_f;
133};
134
135template <>
136struct c_type_of_<SizeT<uint32_t>>
137{
138 using type = peak_common_size;
139};
140
141template <>
142struct c_type_of_<SizeT<float>>
143{
144 using type = peak_common_size_f;
145};
146
147template <>
148struct c_type_of_<Version>
149{
150 using type = peak_common_version;
151};
152
153template <typename...>
154using void_t = void;
155
156template <typename T>
157using c_type_of_t = typename c_type_of_<T>::type;
158
159template <typename T>
160using handle_of_t = c_type_of_t<T>*;
161
162template <typename, typename = void>
163struct has_c_type_of : std::false_type
164{};
165
166template <typename T>
167struct has_c_type_of<T, void_t<typename c_type_of_<T>::type>> : std::true_type
168{};
169
170} // namespace detail
171} // namespace common
172} // namespace peak
173
Represents a structured version identifier following Semantic Versioning 2.0 (major....
Definition peak_common_version.hpp:30
Represents a continuous numeric interval with inclusive lower and upper bounds.
Definition peak_common_interval.hpp:39
2D point template type.
Definition peak_common_point.hpp:187
Represents a numeric range with defined boundaries and a fixed increment.
Definition peak_common_range.hpp:40
A generic rectangle defined by a point and a size.
Definition peak_common_rectangle.hpp:37
Represents a two-dimensional size with non-negative width and height.
Definition peak_common_size.hpp:37
Version_t Version()
Query the library version.
Definition peak_afl.hpp:2207
Namespace for internal implementation details and low-level types.
Definition peak_common_math.hpp:19
Root namespace for common types and interfaces shared across multiple libraries.
Definition peak_common_math.hpp:17
Represents a floating-point interval with inclusive minimum and maximum bounds.
Definition peak_common_simple_types.h:52
Represents an unsigned integer interval with inclusive minimum and maximum bounds.
Definition peak_common_simple_types.h:38
Represents an integer interval with inclusive minimum and maximum bounds.
Definition peak_common_simple_types.h:24
Represents a 2D point with floating-point coordinates.
Definition peak_common_simple_types.h:182
Represents a 2D point with unsigned integer coordinates.
Definition peak_common_simple_types.h:165
Represents a 2D point with signed integer coordinates.
Definition peak_common_simple_types.h:148
Represents a floating-point range with inclusive minimum and maximum bounds and an increment step.
Definition peak_common_simple_types.h:100
Represents an unsigned integer range with inclusive minimum and maximum bounds and an increment step.
Definition peak_common_simple_types.h:83
Represents an integer range with inclusive minimum and maximum bounds and an increment step.
Definition peak_common_simple_types.h:66
Represents a rectangle defined by a floating-point position and size.
Definition peak_common_simple_types.h:252
Represents a rectangle defined by an unsigned integer position and unsigned integer size.
Definition peak_common_simple_types.h:229
Represents a rectangle defined by a position and unsigned integer size.
Definition peak_common_simple_types.h:206
Represents a 2D size with floating-point dimensions.
Definition peak_common_simple_types.h:131
Represents a 2D size with unsigned integer dimensions.
Definition peak_common_simple_types.h:117
Represents a version number.
Definition peak_common_simple_types.h:274