IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
peak_common_type_traits.hpp
Go to the documentation of this file.
1
11#pragma once
12
13#include <type_traits>
14#include <cstddef>
15#include <cstdint>
16
17
18// NOLINTBEGIN(readability-identifier-naming)
19struct peak_common_interval;
20struct peak_common_interval_u;
21struct peak_common_interval_f;
22struct peak_common_range;
23struct peak_common_range_u;
24struct peak_common_range_f;
25struct peak_common_rectangle;
26struct peak_common_rectangle_f;
27struct peak_common_rectangle_u;
28struct peak_common_point;
29struct peak_common_point_f;
30struct peak_common_point_u;
31struct peak_common_size;
32struct peak_common_size_f;
33struct peak_common_version;
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>
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
peak::common::Version Version()
Returns the version of the library.
typename c_type_of_< Type >::type c_type_of_t
peak::common::detail::c_type_of_t< Type > * handle_of_t