PLCnext API Documentation 25.0.2.69
RscTypeInfo.hpp
1
2//
3// Copyright Phoenix Contact GmbH & Co. KG
4//
6#pragma once
8#include "Arp/Base/Rsc/Commons/Rsc.hpp"
9#include "Arp/Base/Rsc/Commons/RscType.hpp"
10#include "Arp/Base/Rsc/Commons/RscTypeDeduction.hpp"
11
12namespace Arp::Base::Rsc::Commons
13{
14
17class ARP_EXPORT RscTypeInfo
18{
19public: // construction
20 RscTypeInfo(void) = delete; // makes this class pure static
21
22public: // static fields
23 static const size_t InvalidSize = static_cast<size_t>(-1);
24 static const size_t MaxStringSize = 1024 * 1024;
25
26public: // static size operations
27 template<class T>
28 static size_t GetDataSizeFrom(const T& value);
29 static size_t GetDataSizeOf(RscType type);
30
31public: // static kind operations
32 static bool IsPrimitiveType(RscType type);
33 static bool IsElementaryType(RscType type);
34 static bool IsSimpleType(RscType type);
35 static bool IsComplexType(RscType type);
36 static bool IsStringType(RscType type);
37 static bool IsConcreteType(RscType type);
38
39public: // static properties operations
40 static bool HasEndianness(RscType type);
41};
42
44// inline methods of class RscTypeInfo
45
50template<class T>
51inline size_t RscTypeInfo::GetDataSizeFrom(const T& value)
52{
54}
55
56} // end of namespace Arp::Base::Rsc::Commons
static constexpr RscType GetFrom(const T &)
Gets the RscType of the as argument passed parameter.
Definition: RscTypeDeduction.hpp:77
This pure static class provides some information of RSC types.
Definition: RscTypeInfo.hpp:18
static size_t GetDataSizeFrom(const T &value)
Gets the size of the as argument passed value.
Definition: RscTypeInfo.hpp:51
static size_t GetDataSizeOf(RscType type)
Gets the data size of the supplied RscType.
Definition: RscTypeInfo.cpp:14