8#include "Arp/Base/Rsc/Commons/RscVariant.hxx"
9#include "Arp/Base/Rsc/Commons/RscTypeInfo.hpp"
10#include "Arp/Base/Commons/Exceptions/InvalidOperationException.hpp"
12namespace Arp::Base::Rsc::Commons
32 size_t GetFieldCount(
void)
const;
35 template<
class T>
void WriteNextField(
const T& value);
36 template<
int N>
void WriteNextField(
const RscVariant<N>& value);
37 template<
int N>
void WriteNextField(
const RscString<N>& value);
68 this->writeFieldFunction(type, variant);
82 if(value.
GetType() == RscType::Array)
84 this->writeFieldFunction(RscType::Array, value);
85 if(this->pWriter ==
nullptr)
91 this->SetWriterTo(value);
94 else if (value.
GetType() == RscType::Struct)
96 this->writeFieldFunction(RscType::Struct, value);
97 if (this->pWriter ==
nullptr)
103 this->SetWriterTo(value);
108 this->writeFieldFunction(value.
GetType(), value);
121 this->writeFieldFunction(RscType::String, variantField);
133 this->writeFieldFunction(RscType::SecureString, variantField);
This exception is thrown when an operation cannot be executed because the related state is invalid.
Definition: InvalidOperationException.hpp:16
Specialized implementation of RscString for secure context.
Definition: RscSecureString.hxx:16
Contains a static string with string lentgh up to N characters. The string shall be null terminated.
Definition: RscString.hxx:24
Contains information to marshal structs.
Definition: RscStructInfo.hpp:17
Utility class to write dynamic structs.
Definition: RscStructWriter.hpp:24
RscVariantBase::WriteElementFunction WriteElementFunction
The prototype of the delegate to write a field.
Definition: RscStructWriter.hpp:26
void WriteNextField(const T &value)
Writes the next field of the struct. This operation is used if the field is an object,...
Definition: RscStructWriter.hpp:59
static constexpr RscType GetFrom(const T &)
Gets the RscType of the as argument passed parameter.
Definition: RscTypeDeduction.hpp:77
static bool IsSimpleType(RscType type)
Determines if the supplied RscType is a simple type.
Definition: RscTypeInfo.cpp:139
This class is a base class of template class RscVariant.
Definition: RscVariantBase.hpp:41
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:48
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
Writes marshalled data of RSC services.
Definition: RscWriter.hpp:34