IDS peak ICV v1.2.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_rectangle;
23struct peak_common_rectangle_f;
24struct peak_common_rectangle_u;
25struct peak_common_point;
26struct peak_common_point_f;
27struct peak_common_point_u;
28struct peak_common_size;
29struct peak_common_size_f;
30struct peak_common_version;
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>
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
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