PLCnext API Documentation 25.0.2.69
DataTypeDeduction.hxx
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Plc/Commons/Meta/ArrayDimensions.hpp"
9#include "Arp/Plc/Commons/Meta/TypeSystem/DataTypeDeductionBase.hpp"
10
11namespace Arp { namespace Plc { namespace Commons { namespace Meta { namespace TypeSystem
12{
13
14template<class T>
16{
17public: // construction
18 DataTypeDeduction(void) : Base(GetDataType<typename std::remove_const<T>::type>()) {}
19};
20
22// template specialization DataTypeDeduction<T*>
23template<class T>
25{
26public: // construction
27 DataTypeDeduction(void) : Base(DataType::Pointer | DataTypeDeduction<T>()) {}
28};
29
31// template specialization DataTypeDeduction<T*const>
32template<class T>
34{
35public: // construction
36 DataTypeDeduction(void) : Base(DataType::Pointer | DataTypeDeduction<T>()) {}
37};
38
40// template specialization DataTypeDeduction<std::shared_ptr<T>>
41template<class T>
42class DataTypeDeduction<std::shared_ptr<T>> : public DataTypeDeductionBase
43{
44public: // construction
46};
47
49// template specialization DataTypeDeduction<const std::shared_ptr<T>>
50template<class T>
51class DataTypeDeduction<const std::shared_ptr<T>> : public DataTypeDeductionBase
52{
53public: // construction
55};
56
58// template specialization DataTypeDeduction<T[N]>
59template<class T, size_t N>
61{
62public: // construction
63 DataTypeDeduction(void) : Base(DataType::Array | DataTypeDeduction<T>()) {}
64};
65
67// template specialization DataTypeDeduction<T[N1][N2]>
68template<class T, size_t N1, size_t N2>
70{
71public: // construction
72 DataTypeDeduction(void) : Base(DataType::Array | DataTypeDeduction<T>()) {}
73};
74
76// template specialization DataTypeDeduction<T[N1][N2][N3]>
77template<class T, size_t N1, size_t N2, size_t N3>
78class DataTypeDeduction<T[N1][N2][N3]> : public DataTypeDeductionBase
79{
80public: // construction
81 DataTypeDeduction(void) : Base(DataType::Array | DataTypeDeduction<T>()) {}
82};
83
85// template specialization DataTypeDeduction<StaticString<N>>
86template<uint16 N>
88{
89public: // construction
90 DataTypeDeduction(void) : Base(DataType::StaticString) {}
91
92public: // fields
93 uint16 Length = N;
94};
95
97// template specialization DataTypeDeduction<const StaticString<N>>
98template<uint16 N>
100{
101public: // construction
102 DataTypeDeduction(void) : Base(DataType::StaticString) {}
103
104public: // fields
105 uint16 Length = N;
106};
107
109// template specialization DataTypeDeduction<StaticString<N, char 16>>
110template<uint16 N>
112{
113public: // construction
114 DataTypeDeduction(void) : Base(DataType::StaticWString) {}
115
116public: // fields
117 uint16 Length = N;
118};
119
121// template specialization DataTypeDeduction<const StaticString<N, char16>>
122template<uint16 N>
124{
125public: // construction
126 DataTypeDeduction(void) : Base(DataType::StaticWString) {}
127
128public: // fields
129 uint16 Length = N;
130};
131
132}}}}} // end of namespace Arp::Plc::Commons::Meta::TypeSystem
This class represents the counterpart to the data type 'IecString', 'IecWString'. It's the C++ data t...
Definition: StaticString.hxx:19
Definition: DataTypeDeductionBase.hpp:157
Definition: DataTypeDeduction.hxx:16
char char8
The Arp character type of 1 byte size.
Definition: PrimitiveTypes.hpp:45
std::uint16_t uint16
The Arp unsigned integer type of 2 byte size.
Definition: PrimitiveTypes.hpp:29
char16_t char16
The Arp character type of 2 byte size.
Definition: PrimitiveTypes.hpp:49
Root namespace for the PLCnext API
Namespace of the C++ standard library