IDS peak genericC++ v1.16.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)
31struct peak_common_size;
34
35// NOLINTEND(readability-identifier-naming)
36
38
39namespace peak
40{
41namespace common
42{
43
44class Version;
45
46namespace detail
47{
48
49template <typename PointType, typename SizeType>
50class RectangleT;
51template <typename T>
52class PointT;
53template <typename T>
54class SizeT;
55
56template <typename T>
57class IntervalT;
58
59template <typename T>
60class RangeT;
61
62template <typename T>
63class SizeT;
64
65template <typename T>
66struct c_type_of_;
67
68template <>
69struct c_type_of_<IntervalT<uint32_t>>
70{
71 using type = peak_common_interval_u;
72};
73
74template <>
75struct c_type_of_<IntervalT<int32_t>>
76{
77 using type = peak_common_interval;
78};
79
80template <>
81struct c_type_of_<IntervalT<float>>
82{
83 using type = peak_common_interval_f;
84};
85
86template <>
87struct c_type_of_<RangeT<uint32_t>>
88{
89 using type = peak_common_range_u;
90};
91
92template <>
93struct c_type_of_<RangeT<int32_t>>
94{
95 using type = peak_common_range;
96};
97
98template <>
99struct c_type_of_<RangeT<float>>
100{
101 using type = peak_common_range_f;
102};
103
104template <>
105struct c_type_of_<RectangleT<int32_t, uint32_t>>
106{
107 using type = peak_common_rectangle;
108};
109
110template <>
111struct c_type_of_<RectangleT<float, float>>
112{
113 using type = peak_common_rectangle_f;
114};
115
116template <>
117struct c_type_of_<RectangleT<uint32_t, uint32_t>>
118{
119 using type = peak_common_rectangle_u;
120};
121
122template <>
123struct c_type_of_<PointT<int32_t>>
124{
125 using type = peak_common_point;
126};
127
128template <>
129struct c_type_of_<PointT<uint32_t>>
130{
131 using type = peak_common_point_u;
132};
133
134template <>
135struct c_type_of_<PointT<float>>
136{
137 using type = peak_common_point_f;
138};
139
140template <>
141struct c_type_of_<SizeT<uint32_t>>
142{
143 using type = peak_common_size;
144};
145
146template <>
147struct c_type_of_<SizeT<float>>
148{
149 using type = peak_common_size_f;
150};
151
152template <>
153struct c_type_of_<Version>
154{
155 using type = peak_common_version;
156};
157
158template <typename...>
159using void_t = void;
160
161template <typename T>
162using c_type_of_t = typename c_type_of_<T>::type;
163
164template <typename T>
165using handle_of_t = c_type_of_t<T>*;
166
167template <typename, typename = void>
168struct has_c_type_of : std::false_type
169{};
170
171template <typename T>
172struct has_c_type_of<T, void_t<typename c_type_of_<T>::type>> : std::true_type
173{};
174
175} // namespace detail
176} // namespace common
177} // namespace peak
178
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
Represents a numeric range with defined boundaries and a fixed increment.
Definition peak_common_range.hpp:44
A generic rectangle defined by a point and a size.
Definition peak_common_rectangle.hpp:42
Represents a two-dimensional size with non-negative width and height.
Definition peak_common_size.hpp:42
@ Version
Definition peak_device_descriptor.hpp:64
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
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:35
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:187
Represents a 2D point with unsigned integer coordinates.
Definition peak_common_simple_types.h:170
Represents a 2D point with signed integer coordinates.
Definition peak_common_simple_types.h:153
Represents a floating-point range with inclusive minimum and maximum bounds and an increment step.
Definition peak_common_simple_types.h:105
Represents an unsigned integer range with inclusive minimum and maximum bounds and an increment step.
Definition peak_common_simple_types.h:88
Represents an integer range with inclusive minimum and maximum bounds and an increment step.
Definition peak_common_simple_types.h:71
Represents a rectangle defined by a floating-point position and size.
Definition peak_common_simple_types.h:257
Represents a rectangle defined by an unsigned integer position and unsigned integer size.
Definition peak_common_simple_types.h:234
Represents a rectangle defined by a position and unsigned integer size.
Definition peak_common_simple_types.h:211
Represents a 2D size with floating-point dimensions.
Definition peak_common_simple_types.h:136
Represents a 2D size with unsigned integer dimensions.
Definition peak_common_simple_types.h:122
Represents a version number.
Definition peak_common_simple_types.h:279