IDS peak genericC++ v1.12.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)
27struct peak_common_size;
29
30// NOLINTEND(readability-identifier-naming)
31
33
34namespace peak
35{
36namespace common
37{
38
39namespace detail
40{
41
42template <typename PointType, typename SizeType>
43class RectangleT;
44template <typename T>
45class PointT;
46template <typename T>
47class SizeT;
48
49template <typename T>
50class IntervalT;
51
52template <typename T>
53class SizeT;
54
55template <typename T>
56struct c_type_of_;
57
58template <>
59struct c_type_of_<IntervalT<uint32_t>>
60{
61 using type = peak_common_interval_u;
62};
63
64template <>
65struct c_type_of_<IntervalT<int32_t>>
66{
67 using type = peak_common_interval;
68};
69
70template <>
71struct c_type_of_<IntervalT<float>>
72{
73 using type = peak_common_interval_f;
74};
75
76template <>
77struct c_type_of_<RectangleT<int32_t, uint32_t>>
78{
79 using type = peak_common_rectangle;
80};
81
82template <>
83struct c_type_of_<RectangleT<float, float>>
84{
85 using type = peak_common_rectangle_f;
86};
87
88template <>
89struct c_type_of_<PointT<int32_t>>
90{
91 using type = peak_common_point;
92};
93
94template <>
95struct c_type_of_<PointT<uint32_t>>
96{
97 using type = peak_common_point_u;
98};
99
100template <>
101struct c_type_of_<PointT<float>>
102{
103 using type = peak_common_point_f;
104};
105
106template <>
107struct c_type_of_<SizeT<uint32_t>>
108{
109 using type = peak_common_size;
110};
111
112template <>
113struct c_type_of_<SizeT<float>>
114{
115 using type = peak_common_size_f;
116};
117
118template <typename...>
119using void_t = void;
120
121template <typename T>
122using c_type_of_t = typename c_type_of_<T>::type;
123
124template <typename T>
125using handle_of_t = c_type_of_t<T>*;
126
127template <typename, typename = void>
128struct has_c_type_of : std::false_type
129{};
130
131template <typename T>
132struct has_c_type_of<T, void_t<typename c_type_of_<T>::type>> : std::true_type
133{};
134
135} // namespace detail
136} // namespace common
137} // namespace peak
138
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
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:33
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: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