PLCnext API Documentation  22.9.0.33
Public Types | Public Member Functions | List of all members
Arp::System::Rsc::Services::RscArrayReader 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 <RscArrayReader.hpp>

Public Types

using ReadElementFunction = RscVariant<>::ReadElementFunction
 

Public Member Functions

template<int N>
 RscArrayReader (const RscVariant< N > &value)
 Constructs an RscArray instance. More...
 
 RscArrayReader (size_t size, RscType elementType, ReadElementFunction readFunction)
 Constructs an RscArrayReader instance. More...
 
 RscArrayReader (size_t size, RscType elementType, RemotingReader &reader)
 /// More...
 
 RscArrayReader (const RscArrayReader &arg)=default
 /// More...
 
RscArrayReaderoperator= (const RscArrayReader &arg)=default
 Assignment operator. More...
 
 ~RscArrayReader (void)=default
 Destructs this instance and frees all resources. More...
 
size_t GetSize (void) const
 Returns number of Elements contained in array More...
 
RscType GetElementType (void) const
 Returns the element type More...
 
size_t GetDimensions (void) const
 Gets the count of array dimensions. More...
 
size_t GetPosition (void) const
 Returns current reading position in array More...
 
size_t GetFieldCount (void) const
 Returns field count if array contains struct elements More...
 
template<class T >
void ReadNext (T &current)
 Reads the next single array element using the callback function given by ArrayInformation of RscVariant. This method can only be used for primitive types. More...
 
template<int N>
void ReadNext (RscString< N > &current)
 Reads the next single array string element using the callback function given by ArrayInformation of RscVariant.. More...
 
template<int N>
void ReadNext (RscVariant< N > &current)
 Reads the next array element and stores it into current. More...
 
void ReadNext (byte *pCurrent)
 Reads the next single array element using the callback function given by ArrayInformation of RscVariant. This method can only be used for primitive types. More...
 
RscArrayReader ReadNextArray (void)
 Reads the next subarray for arrays with more than one dimension. The next subarray is read with a new instance of RscArrayReader. More...
 
template<int MaxStringSize>
RscStructReader< MaxStringSize > ReadNextStruct (void)
 Reads the next struct element. More...
 
template<>
void ReadNext (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

◆ RscArrayReader() [1/4]

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

Constructs an RscArray instance.

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

◆ RscArrayReader() [2/4]

Arp::System::Rsc::Services::RscArrayReader::RscArrayReader ( size_t  size,
RscType  elementType,
ReadElementFunction  readFunction 
)

Constructs an RscArrayReader instance.

◆ RscArrayReader() [3/4]

Arp::System::Rsc::Services::RscArrayReader::RscArrayReader ( size_t  size,
RscType  elementType,
RemotingReader &  reader 
)

///

Constructs an RscArrayReader instance.

◆ RscArrayReader() [4/4]

Arp::System::Rsc::Services::RscArrayReader::RscArrayReader ( const RscArrayReader arg)
default

///

Copy constructor.

◆ ~RscArrayReader()

Arp::System::Rsc::Services::RscArrayReader::~RscArrayReader ( void  )
default

Destructs this instance and frees all resources.

Member Function Documentation

◆ GetDimensions()

size_t Arp::System::Rsc::Services::RscArrayReader::GetDimensions ( void  ) const
inline

Gets the count of array dimensions.

Returns
Count of array dimensions (0 for elemental type, 1 for array type, 2 for array of array type etc)

◆ GetElementType()

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

Returns the element type

Returns
Element Type of array

◆ GetFieldCount()

size_t Arp::System::Rsc::Services::RscArrayReader::GetFieldCount ( void  ) const
inline

Returns field count if array contains struct elements

Returns
Field count of struct element

◆ GetPosition()

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

Returns current reading position in array

Returns
Reading position in array

◆ GetSize()

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

Returns number of Elements contained in array

Returns
Number of Elements contained in array

◆ operator=()

RscArrayReader& Arp::System::Rsc::Services::RscArrayReader::operator= ( const RscArrayReader arg)
default

Assignment operator.

◆ ReadNext() [1/4]

void Arp::System::Rsc::Services::RscArrayReader::ReadNext ( byte pCurrent)

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

Parameters
currentRaw pointer to destination

◆ ReadNext() [2/4]

template<int N>
void Arp::System::Rsc::Services::RscArrayReader::ReadNext ( RscString< N > &  current)
inline

Reads 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.

◆ ReadNext() [3/4]

template<int N>
void Arp::System::Rsc::Services::RscArrayReader::ReadNext ( RscVariant< N > &  current)
inline

Reads the next array element and stores it into current.

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

◆ ReadNext() [4/4]

template<class T >
void Arp::System::Rsc::Services::RscArrayReader::ReadNext ( T &  current)
inline

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

Parameters
currentReference to destination
Template Parameters
TType of array element

◆ ReadNextArray()

RscArrayReader Arp::System::Rsc::Services::RscArrayReader::ReadNextArray ( void  )

Reads the next subarray for arrays with more than one dimension. The next subarray is read with a new instance of RscArrayReader.

Returns
New instance of RscArrayReader to read next array elements

◆ ReadNextStruct()

template<int MaxStringSize>
RscStructReader< MaxStringSize > Arp::System::Rsc::Services::RscArrayReader::ReadNextStruct ( void  )
inline

Reads the next struct element.

Returns
New instance of RscStructReader to read element struct
Template Parameters
MaxstringSizeMaximum string size of elements

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