PLCnext API Documentation 24.0.0.71
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | List of all members
Arp::System::Rsc::Services::RscArrayWriter Class Reference

Helper class to read an array of primtive types from an RscVariant. This class uses the array information stored in RscVariant. More...

#include <RscArrayWriter.hpp>

Public Types

using WriteElementFunction = RscVariant<>::WriteElementFunction
 

Public Member Functions

template<int N>
 RscArrayWriter (const RscVariant< N > &value)
 Constructs an RscArray instance. More...
 
 RscArrayWriter (size_t size, RscType elementType, WriteElementFunction writeFunction)
 Constructs an RscArrayWriter instance.
 
 RscArrayWriter (size_t size, RscType elementType, RemotingWriter &writer, size_t dimensions=1)
 Constructs an RscArrayWriter instance.
 
 RscArrayWriter (const RscArrayWriter &arg)=default
 Copy constructor.
 
RscArrayWriteroperator= (const RscArrayWriter &arg)=default
 Assignment operator.
 
 ~RscArrayWriter (void)=default
 Destructs this instance and frees all resources.
 
size_t GetSize (void) const
 Returns number of Elements contained in array More...
 
RscType GetElementType (void) const
 Returns the element type More...
 
size_t GetPosition (void) const
 Returns current writing position in array More...
 
template<class T >
void WriteNext (const T &current)
 Writes the next single array element using the callback function given by ArrayInformation of RscVariant. This method can only be used for primtive types. More...
 
template<int N>
void WriteNext (const RscString< N > &current)
 Writes the next single array string element using the callback function given by ArrayInformation of RscVariant. More...
 
template<int N>
void WriteNext (const RscVariant< N > &current)
 
void WriteNext (const byte *pCurrent)
 Writes the next single array element using the callback function given by ArrayInformation of RscVariant. This method can only be used for primtive types. More...
 
RscArrayWriter WriteNextArray (size_t size)
 Writes the next subarray for arrays with more than one dimension. The next subarray is written with a new instance of RscArrayWriter. More...
 
template<int MaxStringSize>
RscVariant< MaxStringSize > WriteNextStruct ()
 
template<>
void WriteNext (const DateTime &current)
 

Detailed Description

Helper class to read an array of primtive types from an RscVariant. This class uses the array information stored in RscVariant.

Constructor & Destructor Documentation

◆ RscArrayWriter()

template<int N>
Arp::System::Rsc::Services::RscArrayWriter::RscArrayWriter ( const RscVariant< N > &  value)
inline

Constructs an RscArray instance.

Parameters
valueReference to RscVariant with array information.
Template Parameters
NN determines the maximum string size of string array elements. If set to 0 strings will not be supported.

Member Function Documentation

◆ GetElementType()

RscType Arp::System::Rsc::Services::RscArrayWriter::GetElementType ( void  ) const
inline

Returns the element type

Returns
Element Type of array

◆ GetPosition()

size_t Arp::System::Rsc::Services::RscArrayWriter::GetPosition ( void  ) const
inline

Returns current writing position in array

Returns
Writing position in array

◆ GetSize()

size_t Arp::System::Rsc::Services::RscArrayWriter::GetSize ( void  ) const
inline

Returns number of Elements contained in array

Returns
Number of Elements contained in array

◆ WriteNext() [1/3]

void Arp::System::Rsc::Services::RscArrayWriter::WriteNext ( const byte pCurrent)

Writes the next single array element using the callback function given by ArrayInformation of RscVariant. This method can only be used for primtive types.

Parameters
currentReference to source

◆ WriteNext() [2/3]

template<int N>
void Arp::System::Rsc::Services::RscArrayWriter::WriteNext ( const RscString< N > &  current)
inline

Writes the next single array string element using the callback function given by ArrayInformation of RscVariant.

Parameters
currentReference to RscString.
Template Parameters
NMaximum string size of RscString. Have to be equal to internal maximum string size defined with the constructor.

◆ WriteNext() [3/3]

template<class T >
void Arp::System::Rsc::Services::RscArrayWriter::WriteNext ( const T &  current)
inline

Writes the next single array element using the callback function given by ArrayInformation of RscVariant. This method can only be used for primtive types.

Parameters
currentReference to source
Template Parameters
TType of array element

◆ WriteNextArray()

RscArrayWriter Arp::System::Rsc::Services::RscArrayWriter::WriteNextArray ( size_t  size)

Writes the next subarray for arrays with more than one dimension. The next subarray is written with a new instance of RscArrayWriter.

Parameters
sizeSize of next subarray
Returns
New instance of RscArrayWriter to write next array elements

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