PLCnext API Documentation 25.0.2.69
Public Types | Public Member Functions | Public Attributes | List of all members
Arp::Base::Rsc::Commons::Services::RscImplReadEnumerator< T > Class Template Reference

Implements IRscReadEnumerator to be used from within service implementations. More...

#include <RscImplReadEnumerator.hxx>

Inheritance diagram for Arp::Base::Rsc::Commons::Services::RscImplReadEnumerator< T >:
Inheritance graph

Public Types

using BeginFunction = std::function< size_t()>
 The prototype of the Begin function.
 
using NextFunction = std::function< bool(T &)>
 The prototype of the Next function.
 
using NextArrayFunction = std::function< bool(RscArrayReader &)>
 The prototype of the NextArray function.
 
using EndFunction = std::function< void()>
 The prototype of the End function.
 
- Public Types inherited from Arp::Base::Rsc::Commons::IRscReadEnumerator< T >
using Ptr = std::shared_ptr< IRscReadEnumerator >
 The pointer type of this type.
 

Public Member Functions

 RscImplReadEnumerator (void)
 Constructs an RscImplReadEnumerator instance. More...
 
size_t BeginRead (void) override
 This operation is called at the begin of reading the enumeration. More...
 
bool ReadNext (T &) override
 Reads the next element of the enumeration. More...
 
bool ReadNext (RscArrayReader &current) override
 Reads the next array element of the enumeration. More...
 
void EndRead (void) override
 This operation is called at the end of reading the enumeration to perform any cleanup code or similar. More...
 
- Public Member Functions inherited from Arp::Base::Rsc::Commons::IRscReadEnumerator< T >
 IRscReadEnumerator (void)=default
 The default constructor.
 
 IRscReadEnumerator (const IRscReadEnumerator &arg)=delete
 The deleted copy constructor. More...
 
 IRscReadEnumerator (IRscReadEnumerator &&arg) noexcept=default
 The default move constructor. More...
 
IRscReadEnumeratoroperator= (const IRscReadEnumerator &arg)=delete
 The deleted assignment operator. More...
 
IRscReadEnumeratoroperator= (IRscReadEnumerator &&arg) noexcept=default
 The default move-assignment operator. More...
 
virtual ~IRscReadEnumerator (void)=default
 Destructs this instance and frees all resources.
 
virtual size_t BeginRead (void)=0
 Begins to read the enumeration values. More...
 
virtual bool ReadNext (T &current)=0
 Reads the next enumeration value. More...
 
virtual bool ReadNext (RscArrayReader &current)=0
 Reads the next array object. Use this method only, if the current enumerated value contains an array object. More...
 
virtual void EndRead (void)=0
 Call this operation when all enumeration values has been read, to perform checks and cleanup. More...
 

Public Attributes

BeginFunction Begin
 Delegate to BeginRead method of service implementation.
 
NextFunction Next
 Delegate to ReadNext method of service implementation.
 
NextArrayFunction NextArray
 Delegate to ReadNext method for array elements of service implementation.
 
EndFunction End
 Delegate to EndRead method of service implementation.
 

Additional Inherited Members

- Static Public Attributes inherited from Arp::Base::Rsc::Commons::IRscReadEnumerator< T >
static constexpr size_t UndefinedArrayLength = std::numeric_limits<size_t>::max()
 This constant is used to determine that an enumeration is not an array enumeration and hence has an unknown length.
 

Detailed Description

template<class T>
class Arp::Base::Rsc::Commons::Services::RscImplReadEnumerator< T >

Implements IRscReadEnumerator to be used from within service implementations.

This class should only be used in service implementations. The read callbacks (lambdas) have to be implemented and set by the service.

Template Parameters
TThe enumerated type.

Constructor & Destructor Documentation

◆ RscImplReadEnumerator()

template<class T >
Arp::Base::Rsc::Commons::Services::RscImplReadEnumerator< T >::RscImplReadEnumerator ( void  )
inlinedefault

Constructs an RscImplReadEnumerator instance.

Template Parameters
TThe enumerated type.

Member Function Documentation

◆ BeginRead()

template<class T >
size_t Arp::Base::Rsc::Commons::Services::RscImplReadEnumerator< T >::BeginRead ( void  )
inlineoverridevirtual

This operation is called at the begin of reading the enumeration.

Returns
The number of elements of the enumeration to read.
Template Parameters
TThe enumerated type.

Implements Arp::Base::Rsc::Commons::IRscReadEnumerator< T >.

◆ EndRead()

template<class T >
void Arp::Base::Rsc::Commons::Services::RscImplReadEnumerator< T >::EndRead ( void  )
inlineoverridevirtual

This operation is called at the end of reading the enumeration to perform any cleanup code or similar.

Template Parameters
TThe enumerated type.

Implements Arp::Base::Rsc::Commons::IRscReadEnumerator< T >.

◆ ReadNext() [1/2]

template<class T >
bool Arp::Base::Rsc::Commons::Services::RscImplReadEnumerator< T >::ReadNext ( RscArrayReader current)
inlineoverridevirtual

Reads the next array element of the enumeration.

Parameters
currentThe array reader to read the current array element.
Returns
true if the next array element could be read, otherwise false to indicate the end of the enumeration.
Template Parameters
TThe enumerated type.

Implements Arp::Base::Rsc::Commons::IRscReadEnumerator< T >.

◆ ReadNext() [2/2]

template<class T >
bool Arp::Base::Rsc::Commons::Services::RscImplReadEnumerator< T >::ReadNext ( T &  current)
inlineoverridevirtual

Reads the next element of the enumeration.

Returns
true if the next element could be read, otherwise false to indicate the end of the enumeration.
Parameters
currentThe read element.
Template Parameters
TThe enumerated type.

Implements Arp::Base::Rsc::Commons::IRscReadEnumerator< T >.


The documentation for this class was generated from the following file: