PLCnext API Documentation  22.9.0.33
ReadItem.hpp
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 #include "Arp/Plc/Gds/Services/DataAccessError.hpp"
9 #include "Arp/System/Rsc/Services/IRscSerializable.hpp"
10 #include "Arp/System/Rsc/Services/RscReader.hpp"
11 #include "Arp/System/Rsc/Services/RscVariant.hxx"
12 #include "Arp/System/Rsc/Services/RscWriter.hpp"
13 
14 // DO NOT MODIFY THIS FILE, THIS FILE IS AUTOGENERATED
15 
16 namespace Arp { namespace Plc { namespace Gds { namespace Services
17 {
18 
19 using namespace Arp;
20 using namespace Arp::System::Rsc::Services;
21 
26 class ReadItem : public IRscSerializable
27 {
28 public:
32  DataAccessError Error = static_cast<DataAccessError>(0);
33 
38 
39  void Serialize(RscWriter& writer)const override
40  {
41  writer.Write(this->Error);
42  writer.Write(this->Value);
43  }
44 
45  void Deserialize(RscReader& reader)override
46  {
47  reader.Read(this->Error);
48  reader.Read(this->Value);
49  }
50 
51  static constexpr size_t GetFieldCount(void)
52  {
53  return 2;
54  }
55 };
56 
57 }}}} // end of namespace Arp::Plc::Gds::Services
Stores the data to be read, written by the controller and a possible data access error.
Definition: ReadItem.hpp:27
RscVariant< 512 > Value
Contains the data to be read, written by the controller.
Definition: ReadItem.hpp:37
void Deserialize(RscReader &reader) override
Deserializes the datatype. All fields of the datatype have to be deserialized in use of RscReader.
Definition: ReadItem.hpp:45
void Serialize(RscWriter &writer) const override
Serializes the datatype. All fields of the datatype have to be serialized in use of RscWriter.
Definition: ReadItem.hpp:39
Marshalls structure or class data types. Serialize and Deserialize have to marshal fields in the same...
Definition: IRscSerializable.hpp:19
Reads data from Rsc
Definition: RscReader.hpp:26
T Read(void)
Reads an element of T from Rsc. With data tagging enabled RscType of T is validated.
Definition: RscReader.hpp:165
Writes data to Rsc.
Definition: RscWriter.hpp:31
void Write(const T &value)
Writes an element of T from Rsc. Datatag and format is determined deducted by type of T.
Definition: RscWriter.hpp:177
DataAccessError
This enumeration contains the possible data access errors.
Definition: DataAccessError.hpp:19
Namespace for classes and interfaces for the Remote Service Call implementation
Definition: IRscReadEnumerator.hxx:10
Root namespace for the PLCnext API