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

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

#include <RscImplWriteEnumerator.hxx>

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

Public Types

using BeginFunction = std::function< void(size_t)>
 The prototype of the Begin function.
 
using NextFunction = std::function< void(const T &)>
 The prototype of the Next function.
 
using NextArrayFunction = std::function< RscArrayWriter(size_t, RscType)>
 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::IRscWriteEnumerator< T >
using Ptr = std::shared_ptr< IRscWriteEnumerator >
 The pointer type of this class.
 

Public Member Functions

 RscImplWriteEnumerator (void)
 Constructs an RscImplWriteEnumerator instance. More...
 
void BeginWrite (size_t) override
 This operation is called at the begin of writing the enumeration. More...
 
void WriteNext (const T &) override
 Writes the next element of the enumeration. More...
 
RscArrayWriter WriteNext (size_t arraySize, RscType elementType) override
 Writes the next array element of the enumeration. More...
 
void EndWrite (void) override
 This operation is called at the end of writing the enumeration to perform any flushing code or similar. More...
 
- Public Member Functions inherited from Arp::Base::Rsc::Commons::IRscWriteEnumerator< T >
 IRscWriteEnumerator (void)=default
 The default constructor.
 
 IRscWriteEnumerator (const IRscWriteEnumerator &arg)=delete
 The deleted copy constructor. More...
 
 IRscWriteEnumerator (IRscWriteEnumerator &&arg) noexcept=default
 The default move constructor. More...
 
IRscWriteEnumeratoroperator= (const IRscWriteEnumerator &arg)=delete
 The deleted assignment operator. More...
 
IRscWriteEnumeratoroperator= (IRscWriteEnumerator &&arg) noexcept=default
 The default move-assignment operator. More...
 
virtual ~IRscWriteEnumerator (void)=default
 Destructs this instance and frees all resources.
 
virtual void BeginWrite (size_t size=UndefinedArrayLength)=0
 Begins the writing of the enumeration. More...
 
virtual void WriteNext (const T &current)=0
 Writes the next enumeration value. More...
 
virtual RscArrayWriter WriteNext (size_t arraySize, RscType elementType)=0
 Writes the next enumeration value if the value contains an array object. More...
 
virtual void EndWrite (void)=0
 Ends this enumerator while all values shall be written if this is an array enumeration. More...
 

Public Attributes

BeginFunction Begin
 Write delegate to BeginWrite implementation of service method.
 
NextFunction Next
 Write delegate to WriteNext implementation of service method.
 
NextArrayFunction NextArray
 Write delegate to WriteNext implementation for array elements of service method.
 
EndFunction End
 Write delegate to EndWrite implementation of service method.
 

Additional Inherited Members

- Static Public Attributes inherited from Arp::Base::Rsc::Commons::IRscWriteEnumerator< T >
static constexpr size_t UndefinedArrayLength = std::numeric_limits<size_t>::max()
 Determines an undefined array length.
 

Detailed Description

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

Implements IRscWriteEnumerator to be used from within service implementations.

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

Constructor & Destructor Documentation

◆ RscImplWriteEnumerator()

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

Constructs an RscImplWriteEnumerator instance.

Template Parameters
TThe enumerated type.

Member Function Documentation

◆ BeginWrite()

template<class T >
void Arp::Base::Rsc::Commons::Services::RscImplWriteEnumerator< T >::BeginWrite ( size_t  count)
inlineoverridevirtual

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

Parameters
countThe number of elements of the enumeration to write.
Template Parameters
TThe enumerated type.

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

◆ EndWrite()

template<class T >
void Arp::Base::Rsc::Commons::Services::RscImplWriteEnumerator< T >::EndWrite ( void  )
inlineoverridevirtual

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

Template Parameters
TThe enumerated type.

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

◆ WriteNext() [1/2]

template<class T >
void Arp::Base::Rsc::Commons::Services::RscImplWriteEnumerator< T >::WriteNext ( const T &  current)
inlineoverridevirtual

Writes the next element of the enumeration.

Parameters
currentThe element to write.
Template Parameters
TThe enumerated type.

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

◆ WriteNext() [2/2]

template<class T >
RscArrayWriter Arp::Base::Rsc::Commons::Services::RscImplWriteEnumerator< T >::WriteNext ( size_t  arraySize,
RscType  elementType 
)
inlineoverridevirtual

Writes the next array element of the enumeration.

Parameters
arraySizeThe size of the current array to write.
elementTypeThe element type of the current array to write.
Returns
A RscArrayWriter to write all array elements of the current array to write.
Template Parameters
TThe enumerated type.

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


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