Utility class to read an array of primitive types from RscVariant. This class uses the array information stored in RscVariant.
More...
#include <RscArrayReader.hpp>
Utility class to read an array of primitive types from RscVariant. This class uses the array information stored in RscVariant.
◆ RscArrayReader() [1/4]
template<int N>
Arp::Base::Rsc::Commons::RscArrayReader::RscArrayReader |
( |
const RscVariant< N > & |
arrayVariant | ) |
|
|
inlineexplicit |
Constructs an RscArray instance.
- Parameters
-
arrayVariant | The RscVariant with array information. |
- Template Parameters
-
N | N determines the maximum string size, if the array consists of string elements. If set to 0 strings are not supported. |
◆ RscArrayReader() [2/4]
Arp::Base::Rsc::Commons::RscArrayReader::RscArrayReader |
( |
const RscVariantBase & |
arrayVariant | ) |
|
|
explicit |
Constructs an RscArray instance.
- Parameters
-
arrayVariant | The RscVariant instance with array information. |
- Template Parameters
-
N | N Determines the maximum string size if the array consists of string elements. If set to 0 strings are not supported. |
◆ RscArrayReader() [3/4]
Arp::Base::Rsc::Commons::RscArrayReader::RscArrayReader |
( |
size_t |
size, |
|
|
RscType |
elementType, |
|
|
const ReadElementFunction & |
readElementFunction |
|
) |
| |
Constructs an RscArrayReader instance.
- Parameters
-
size | The size of the array. |
elementType | The value type of the array elements. |
readElementFunction | A lambda expression to read the next element. |
◆ RscArrayReader() [4/4]
Arp::Base::Rsc::Commons::RscArrayReader::RscArrayReader |
( |
size_t |
size, |
|
|
RscType |
elementType, |
|
|
Reader & |
reader |
|
) |
| |
Constructs an RscArrayReader instance.
- Parameters
-
size | The size of the array. |
elementType | The value type of the array elements. |
reader | The reader used to read the values from. |
◆ GetDimensions()
size_t Arp::Base::Rsc::Commons::RscArrayReader::GetDimensions |
( |
void |
| ) |
const |
Gets the count of the array dimensions.
- Returns
- The count of array dimensions (0 for elementary type, 1 for array type, 2 for array of array type etc)
◆ GetElementType()
RscType Arp::Base::Rsc::Commons::RscArrayReader::GetElementType |
( |
void |
| ) |
const |
Returns the value type of the array elements.
- Returns
- The value type.
◆ GetFieldCount()
size_t Arp::Base::Rsc::Commons::RscArrayReader::GetFieldCount |
( |
void |
| ) |
const |
Returns field count if the array contains struct elements.
- Returns
- The field count of struct elements.
◆ GetPosition()
size_t Arp::Base::Rsc::Commons::RscArrayReader::GetPosition |
( |
void |
| ) |
const |
Returns the current reading position in the array to read.
- Returns
- The current position in the array to read.
◆ GetSize()
size_t Arp::Base::Rsc::Commons::RscArrayReader::GetSize |
( |
void |
| ) |
const |
Returns the number of values contained in the array.
- Returns
- The number of values contained in the array.
◆ ReadNext() [1/3]
template<int N>
void Arp::Base::Rsc::Commons::RscArrayReader::ReadNext |
( |
RscString< N > & |
current | ) |
|
|
inline |
Reads the next string array value using the callback function given by ArrayInformation of RscVariant.
- Parameters
-
- Template Parameters
-
N | Maximum string size of RscString. Have to be equal to internal maximum string size defined with the constructor. |
◆ ReadNext() [2/3]
template<int N>
void Arp::Base::Rsc::Commons::RscArrayReader::ReadNext |
( |
RscVariant< N > & |
current | ) |
|
|
inline |
Reads the next array object of type RscVariant.
- Parameters
-
- Template Parameters
-
N | Maximum string size of string elements. This has to be equal to internal maximum string size defined by construction. |
◆ ReadNext() [3/3]
template<class T >
void Arp::Base::Rsc::Commons::RscArrayReader::ReadNext |
( |
T & |
current | ) |
|
|
inline |
Reads the next array value using the supplied callback function given by ArrayInformation of RscVariant. This method can only be used for primitive types.
- Parameters
-
- Template Parameters
-
T | Type of the array element. |
◆ ReadNextArray()
RscArrayReader Arp::Base::Rsc::Commons::RscArrayReader::ReadNextArray |
( |
void |
| ) |
|
Reads the next subarray of arrays with more than one dimension. The next subarray is read using a new instance of <see cref="RscArrayReader/>.
- Returns
- New instance of RscArrayReader used to read the next subarray.
◆ ReadNextStruct()
template<int N>
RscStructReader Arp::Base::Rsc::Commons::RscArrayReader::ReadNextStruct |
( |
void |
| ) |
|
|
inline |
Reads the next struct element.
- Returns
- A new instance of RscStructReader used to read next struct element from.
- Template Parameters
-
N | Maximum string size of struct fields. |
The documentation for this class was generated from the following files: