PLCnext API Documentation 23.6.0.37
IRscWriteEnumerator.hxx
1
2//
3// Copyright PHOENIX CONTACT Electronics GmbH
4//
6#pragma once
8#include "Arp/System/Rsc/Services/RscType.hpp"
9
10namespace Arp { namespace System { namespace Rsc { namespace Services
11{
12
13// forwards
14class RscArrayWriter;
15
16
21template<class T>
23{
24public: // typedefs
25 typedef std::shared_ptr<IRscWriteEnumerator> Ptr;
26
27protected: // construction/destruction
29 IRscWriteEnumerator(void) = default;
31 virtual ~IRscWriteEnumerator(void) = default;
32
33public: // abstract operations
36 virtual void BeginWrite(size_t size = UndefinedArrayLength) = 0;
37
40 virtual void WriteNext(const T& current) = 0;
41
46 virtual RscArrayWriter WriteNext(size_t arraySize, RscType elementType) = 0;
47
49 virtual void EndWrite(void) = 0;
50
51protected: // deleted methods
52 IRscWriteEnumerator(const IRscWriteEnumerator& arg) = default;
53 IRscWriteEnumerator& operator=(const IRscWriteEnumerator& arg) = default;
54
55public:
56 static constexpr size_t UndefinedArrayLength = std::numeric_limits<size_t>::max();
57};
58
59}}}} // end of namespace Arp::System::Rsc::Services
Interface for writing an array or an enumerator. For regular enumerators UndefinedArrayLength is used...
Definition: IRscWriteEnumerator.hxx:23
virtual void EndWrite(void)=0
Ends the enumerator. With an array enumerator all enumerator elements had to be written
virtual void BeginWrite(size_t size=UndefinedArrayLength)=0
Begins the operation to write the enumerator.
virtual RscArrayWriter WriteNext(size_t arraySize, RscType elementType)=0
Writes the next enumerator element if the element contains an array object.
virtual void WriteNext(const T &current)=0
Writes the next enumerator element.
IRscWriteEnumerator(void)=default
Constructs an IRscArrayWriteEnumerator instance.
virtual ~IRscWriteEnumerator(void)=default
Destructs this instance and frees all resources.
Helper class to read an array of primtive types from an RscVariant. This class uses the array informa...
Definition: RscArrayWriter.hpp:22
@ System
System components used by the System, Device, Plc or Io domains.
RscType
Data types supported by RSC.
Definition: RscType.hpp:36
Root namespace for the PLCnext API