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