8#include "Arp/Base/Commons/Exceptions/InvalidOperationException.hpp"
9#include "Arp/Base/Rsc/Commons/Rsc.hpp"
10#include "Arp/Base/Rsc/Commons/RscString.hxx"
11#include "Arp/Base/Rsc/Commons/RscVariant.hxx"
12#include "Arp/Base/Rsc/Commons/RscTypeInfo.hpp"
15namespace Arp::Base::Rsc::Commons
36 size_t GetSize(
void)
const;
37 RscType GetElementType(
void)
const;
38 size_t GetPosition(
void)
const;
41 template<
class T>
void WriteNext(
const T& current);
42 template<
int N>
void WriteNext(
const RscString<N>& current);
59 size_t maxStringSize = 0;
106 if(N != this->maxStringSize)
111 this->writeElementFunction(this->
GetElementType(), currentVariant);
130 if (N != this->maxStringSize)
134 this->writeElementFunction(current.
GetType(), current);
137 this->SetWriterTo(current);
161 if(this->pWriter ==
nullptr)
165 this->writeElementFunction(RscType::Struct, structVariant);
170 this->SetWriterTo(structVariant);
174 return structVariant;
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
RscType ElementType
The array element type.
Definition: RscArrayInfo.hpp:23
Helper class to write a dynamic array of primtive types from RscVariant. This class uses the array in...
Definition: RscArrayWriter.hpp:23
RscVariant<>::WriteElementFunction WriteElementFunction
The write element delegate type.
Definition: RscArrayWriter.hpp:26
RscType GetElementType(void) const
Gets the element type of the array values.
Definition: RscArrayWriter.cpp:93
void WriteNextSimple(const RscVariantBase &value)
For internal use only.
Definition: RscArrayWriter.cpp:131
RscArrayWriter(const RscVariant< N > &value)
Constructs an RscArray instance.
Definition: RscArrayWriter.hpp:69
void WriteNext(const T ¤t)
Writes the next single array element using the callback function given by array information of RscVar...
Definition: RscArrayWriter.hpp:81
RscVariant< N > WriteNextStruct()
Writes the next struct element.
Definition: RscArrayWriter.hpp:152
Contains a static string with string lentgh up to N characters. The string shall be null terminated.
Definition: RscString.hxx:24
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
RscType GetType(void) const
Gets the RscType of the contained element
Definition: RscVariantBase.cpp:290
std::function< void(RscType elementType, const RscVariantBase &value)> WriteElementFunction
The write element delegate type.
Definition: RscVariantBase.hpp:47
bool IsComplexType(void) const
Determines if this instance represents a complex type, i.e. an array or a struct.
Definition: RscVariantBase.cpp:243
void SetWriteElementFunction(WriteElementFunction &function) const
Sets the element write function.
Definition: RscVariantBase.cpp:768
Rsc class for variant data types like primitive data type, strings or information about arrays or str...
Definition: RscVariant.hxx:57
static RscVariant CreateStructVariant(size_t fieldCount)
Creates a new RscVariant initialized with RscStructInfo
Definition: RscVariant.ipp:273
Writes marshalled data of RSC services.
Definition: RscWriter.hpp:34