IDS peak ICV v1.3.0
Loading...
Searching...
No Matches
TypeTraits.cs
Go to the documentation of this file.
3
5
6internal static class TypeTraits
7{
8 public static Type GetCTypeOfInterval<T>()
9 {
10 if (typeof(T) == typeof(IntervalT<int>))
11 {
12 return typeof(Types.peak_icv_interval);
13 }
14
15 if (typeof(T) == typeof(IntervalT<float>))
16 {
17 return typeof(Types.peak_icv_interval_f);
18 }
19
20 return typeof(void); // Default case
21 }
22
23 public static Type GetCTypeOfPoint<T>()
24 {
25 if (typeof(T) == typeof(PointT<int>))
26 {
27 return typeof(Types.peak_icv_point);
28 }
29
30 if (typeof(T) == typeof(PointT<float>))
31 {
32 return typeof(Types.peak_icv_point_f);
33 }
34
35 return typeof(void); // Default case
36 }
37
38 public static Types.peak_icv_point_type GetCEnumOfPoint<T>()
39 {
40 if (typeof(T) == typeof(PointT<int>) || typeof(T) == typeof(PointT<float>))
41 {
42 return Types.peak_icv_point_type.PEAK_ICV_POINT_TYPE_XY;
43 }
44
45 throw new IcvNotSupportedException("Point type not supported."); // Default case
46 }
47}
Represents an interval consisting of a lower and upper boundary value.
Definition Interval.cs:21
Represents a 2D point with generic coordinates.
Definition Point.cs:14