PLCnext API Documentation 24.0.0.71
RscValue.hpp
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/System/Rsc/Services/RemotingReader.hpp"
9#include "Arp/System/Rsc/Services/RemotingWriter.hpp"
10
11namespace Arp { namespace System { namespace Rsc { namespace Services
12{
13
14
19class RscValue
20{
21public: // typedefs
22
23public: // construction/destruction
24
25public: // operators
26
27public: // static operations
28 static void Read(RemotingReader& reader, RscType valueType, byte* pResult, size_t maxStringSize = 0);
29 static void Write(RemotingWriter& writer, RscType valueType, const byte* pValue, size_t maxStringSize = 0);
30
31 template<class T>
32 static void Read(RemotingReader& reader, T& value);
33
34 template<class T>
35 static void Write(RemotingWriter& writer, const T& value);
36
37public: // setter/getter operations
38
39public: // operations
40
41protected: // operations
42
43private: // static methods
44
45private: // deleted methods
46 RscValue(void) = delete;
47 RscValue(const RscValue& arg) = delete;
48 RscValue& operator=(const RscValue& arg) = delete;
49 ~RscValue(void) = delete;
50
51private: // fields
52
53private: // static fields
54
55};
56
58// inline methods of class RscValue
59
60template<class T>
61inline void RscValue::Read(RemotingReader& reader, T& value)
62{
63 RscValue::Read(reader, GetRscTypeFrom(value), reinterpret_cast<byte*>(&value));
64}
65
66template<class T>
67inline void RscValue::Write(RemotingWriter& writer, const T& value)
68{
69 RscValue::Write(writer, GetRscTypeFrom(value), reinterpret_cast<const byte*>(&value));
70}
71
72}}}} // end of namespace Arp::System::Rsc::Services
@ System
System components used by the System, Device, Plc or Io domains.
@ Write
Specifies write access to the file. Data can be written to the file and the file pointer can be moved...
@ Read
Specifies read access to the file. Data can be read from the file and the file pointer can be moved....
RscType
Data types supported by RSC.
Definition: RscType.hpp:36
Root namespace for the PLCnext API