8#include "Arp/Base/Rsc/Commons/Rsc.hpp"
9#include "Arp/Base/Rsc/Commons/RscVariant.hxx"
10#include "Arp/Base/Rsc/Commons/RscTypeInfo.hpp"
11#include "Arp/Base/Rsc/Commons/RscStructReader.hpp"
12#include "Arp/Base/Commons/Exceptions/InvalidOperationException.hpp"
14namespace Arp::Base::Rsc::Commons
35 size_t GetSize(
void)
const;
36 RscType GetElementType(
void)
const;
37 size_t GetDimensions(
void)
const;
38 size_t GetFieldCount(
void)
const;
39 size_t GetPosition(
void)
const;
42 template<
class T>
void ReadNext(T& current);
54 void CheckReadArgument(RscType argumentType,
size_t maxLength);
59 size_t maxStringSize = 0;
97 this->ReadNextSimple(currentVariant);
98 currentVariant.
CopyTo(current);
109 this->CheckReadArgument(RscType::String, N);
112 this->readElementFunction(this->
GetElementType(), currentVariant);
125 if(this->maxStringSize != N)
135 this->SetReaderTo(current);
This exception is thrown when an operation cannot be executed because the related state is invalid.
Definition: InvalidOperationException.hpp:16
Contains information to marshal dynamic arrays.
Definition: RscArrayInfo.hpp:14
size_t FieldCount
The count of Fields of struct element type, if the array consists of structs.
Definition: RscArrayInfo.hpp:22
Utility class to read an array of primitive types from RscVariant. This class uses the array informat...
Definition: RscArrayReader.hpp:22
void ReadNext(T ¤t)
Reads the next array value using the supplied callback function given by ArrayInformation of RscVaria...
Definition: RscArrayReader.hpp:86
RscVariantBase::ReadElementFunction ReadElementFunction
The read element delegate type.
Definition: RscArrayReader.hpp:25
RscArrayReader(const RscVariant< N > &arrayVariant)
Constructs an RscArray instance.
Definition: RscArrayReader.hpp:74
RscType GetElementType(void) const
Returns the value type of the array elements.
Definition: RscArrayReader.cpp:103
size_t GetDimensions(void) const
Gets the count of the array dimensions.
Definition: RscArrayReader.cpp:110
RscStructReader ReadNextStruct(void)
Reads the next struct element.
Definition: RscArrayReader.hpp:145
Contains a static string with string lentgh up to N characters. The string shall be null terminated.
Definition: RscString.hxx:24
Utility class to read dynamic structs.
Definition: RscStructReader.hpp:30
static bool IsPrimitiveType(RscType type)
Determines if the supplied RscType is a primitive type.
Definition: RscTypeInfo.cpp:77
This class is a base class of template class RscVariant.
Definition: RscVariantBase.hpp:40
bool IsComplexType(void) const
Determines if this instance represents a complex type, i.e. an array or a struct.
Definition: RscVariantBase.cpp:243
std::function< void(RscType elementType, RscVariantBase &value)> ReadElementFunction
The read element delegate type.
Definition: RscVariantBase.hpp:46
void SetReadElementFunction(ReadElementFunction &function)
Sets the element read function.
Definition: RscVariantBase.cpp:741
void SetStructInfo(size_t fieldCount)
Sets the struct info of this instance.
Definition: RscVariantBase.cpp:688
void CopyTo(String &value) const
Copies the content of this variant to a string.
Definition: RscVariantBase.cpp:858
Rsc class for variant data types like primitive data type, strings or information about arrays or str...
Definition: RscVariant.hxx:57
Reads marshaled data of RSC services.
Definition: RscReader.hpp:34