PLCnext API Documentation  20.6.0.30321
IRscReadEnumerator.hxx
1 //
3 // Copyright PHOENIX CONTACT Electronics GmbH
4 //
6 #pragma once
7 #include "Arp/System/Core/Arp.h"
8 
9 namespace Arp { namespace System { namespace Rsc { namespace Services
10 {
11 
12 // forwards
13 class RscArrayReader;
14 
19 template<class T>
21 {
22 public: // typedefs
23  typedef std::shared_ptr<IRscReadEnumerator> Ptr;
24 
25 protected: // construction/destruction
27  IRscReadEnumerator(void) = default;
28 
30  virtual ~IRscReadEnumerator(void) = default;
31 
32 public: // abstract operations
35  virtual size_t BeginRead(void) = 0;
36 
40  virtual bool ReadNext(T& current) = 0;
41 
45  virtual bool ReadNext(RscArrayReader& current) = 0;
46 
48  virtual void EndRead(void) = 0;
49 
50 protected: // deleted methods
51  IRscReadEnumerator(const IRscReadEnumerator& arg) = default;
52  IRscReadEnumerator& operator=(const IRscReadEnumerator& arg) = default;
53 
54 public:
55  static constexpr size_t UndefinedArrayLength = std::numeric_limits<size_t>::max();
56 };
57 
58 }}}} // end of namespace Arp::System::Rsc::Services
virtual void EndRead(void)=0
Ends the operation to read the enumerator. All enumerator elements had to be already been read...
virtual bool ReadNext(T &current)=0
Reads the next enumerator element.
virtual ~IRscReadEnumerator(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: RscArrayReader.hpp:22
Interface for reading an array or an enumerator. For regular enumerators UndefinedArrayLength is used...
Definition: IRscReadEnumerator.hxx:20
Root namespace for the PLCnext API
IRscReadEnumerator(void)=default
Constructs an IRscArrayWriteEnumerator instance.
System components used by the System, Device, Plc or Io domains.
virtual size_t BeginRead(void)=0
Begins the operation to read the enumerator.