Helper class to write a dynamic array of primtive types from RscVariant. This class uses the array information stored in RscVariant.
More...
#include <RscArrayWriter.hpp>
Helper class to write a dynamic array of primtive types from RscVariant. This class uses the array information stored in RscVariant.
◆ RscArrayWriter() [1/4]
template<int N>
Arp::Base::Rsc::Commons::RscArrayWriter::RscArrayWriter |
( |
const RscVariant< N > & |
value | ) |
|
|
inlineexplicit |
Constructs an RscArray instance.
- Parameters
-
value | Reference to RscVariant containing a dynamic array. |
- Template Parameters
-
N | N determines the maximum string size of string array elements. If set to 0 strings will not be supported. |
◆ RscArrayWriter() [2/4]
Arp::Base::Rsc::Commons::RscArrayWriter::RscArrayWriter |
( |
const RscVariantBase & |
value | ) |
|
|
explicit |
Constructs an RscArray instance.
- Parameters
-
value | Reference to RscVariant containing a dynamic array. |
- Template Parameters
-
N | N determines the maximum string size of string array elements. If set to 0 strings will not be supported. |
◆ RscArrayWriter() [3/4]
Arp::Base::Rsc::Commons::RscArrayWriter::RscArrayWriter |
( |
size_t |
size, |
|
|
RscType |
elementType, |
|
|
WriteElementFunction |
writeFunction |
|
) |
| |
Constructs an RscArrayWriter instance.
- Parameters
-
size | The size of the array. |
elementType | The value type of the array elements. |
writeFunction | A lambda expression to write the next element. |
◆ RscArrayWriter() [4/4]
Arp::Base::Rsc::Commons::RscArrayWriter::RscArrayWriter |
( |
size_t |
size, |
|
|
RscType |
elementType, |
|
|
RscWriter & |
writer, |
|
|
size_t |
dimensions = 1 |
|
) |
| |
Constructs an RscArrayWriter instance.
- Parameters
-
size | The size of the array. |
elementType | The value type of the array elements. |
writer | |
dimensions | |
◆ GetElementType()
RscType Arp::Base::Rsc::Commons::RscArrayWriter::GetElementType |
( |
void |
| ) |
const |
Gets the element type of the array values.
- Returns
- The element type of the array values.
◆ GetPosition()
size_t Arp::Base::Rsc::Commons::RscArrayWriter::GetPosition |
( |
void |
| ) |
const |
Gets the current writing position in the array.
- Returns
- The writing position in the array.
◆ GetSize()
size_t Arp::Base::Rsc::Commons::RscArrayWriter::GetSize |
( |
void |
| ) |
const |
Returns number of elements contained in the array to read.
- Returns
- The number of elements contained in the array.
◆ WriteNext() [1/3]
template<int N>
void Arp::Base::Rsc::Commons::RscArrayWriter::WriteNext |
( |
const RscString< N > & |
current | ) |
|
|
inline |
Writes the next array string element using the callback function given by ArrayInformation of RscVariant.
- Parameters
-
current | The current string to write. |
- Template Parameters
-
N | Maximum string size of RscString. This has to be equal to the string size defined by construction. |
◆ WriteNext() [2/3]
template<int N>
void Arp::Base::Rsc::Commons::RscArrayWriter::WriteNext |
( |
const RscVariant< N > & |
current | ) |
|
|
inline |
Writes the next array object element using the callback function given by ArrayInformation of RscVariant.
- Parameters
-
current | The current object to write. |
- Template Parameters
-
N | Maximum string size of RscVariant. This has to be equal to string size defined by construction. |
◆ WriteNext() [3/3]
template<class T >
void Arp::Base::Rsc::Commons::RscArrayWriter::WriteNext |
( |
const T & |
current | ) |
|
|
inline |
Writes the next single array element using the callback function given by array information of RscVariant. This method can only be used for primitive types.
- Parameters
-
current | The current element to write. |
- Template Parameters
-
T | The element type of the array. |
◆ WriteNextArray()
RscArrayWriter Arp::Base::Rsc::Commons::RscArrayWriter::WriteNextArray |
( |
size_t |
arraySize | ) |
|
Writes the next subarray of arrays with more than one dimension. The next subarray is written using a new instance of RscArrayWriter.
- Parameters
-
arraySize | The size of the next subarray to write. |
- Returns
- A new instance of RscArrayWriter used to write next subarray.
◆ WriteNextSimple()
void Arp::Base::Rsc::Commons::RscArrayWriter::WriteNextSimple |
( |
const RscVariantBase & |
value | ) |
|
For internal use only.
- Parameters
-
value | The simple value to write. |
◆ WriteNextStruct()
template<int N>
RscVariant< N > Arp::Base::Rsc::Commons::RscArrayWriter::WriteNextStruct |
|
inline |
Writes the next struct element.
- Returns
- A new instance of RscVariant used to read next struct element from using RscArrayWriter.
- Template Parameters
-
MaxStringSize | Maximum string size of struct fields. |
The return object of this operation might be used to directly initialize a <see cref=="RscStructWriter"/>
Utility class to write dynamic structs.
Definition: RscStructWriter.hpp:24
The documentation for this class was generated from the following files: