PLCnext API Documentation 25.0.2.69
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Arp::Base::Rsc::Commons::RscVariantBase Class Reference

This class is a base class of template class RscVariant. More...

#include <RscVariantBase.hpp>

Inheritance diagram for Arp::Base::Rsc::Commons::RscVariantBase:
Inheritance graph

Public Types

using ReadFieldFunction = std::function< void(RscType fieldType, RscVariantBase &value)>
 The read field delegate type.
 
using WriteFieldFunction = std::function< void(RscType fieldType, const RscVariantBase &value)>
 The write field delegate type.
 
using ReadElementFunction = std::function< void(RscType elementType, RscVariantBase &value)>
 The read element delegate type.
 
using WriteElementFunction = std::function< void(RscType elementType, const RscVariantBase &value)>
 The write element delegate type.
 

Public Member Functions

 RscVariantBase (RscType type=RscType::None)
 The default constructor creates an empty instance of RscVariantBase. More...
 
 RscVariantBase (RscType type, byte *pBuffer)
 Creates a typed instance of RscVariant which refers to an external buffer. More...
 
 RscVariantBase (RscType type, char *pBuffer, size_t bufferSize)
 Creates a typed instance of RscVariant which refers to an external buffer. More...
 
 RscVariantBase (const RscStringBase &data)
 Creates a typed instance of RscVariant which refers to an external buffer. More...
 
 RscVariantBase (const RscArrayInfo &arrayInfo)
 Creates a typed instance of RscVariant which represents an array. More...
 
 RscVariantBase (const RscStructInfo &structInfo)
 Creates a typed instance of RscVariant which represents a struct. More...
 
 RscVariantBase (const RscVariantBase &arg)
 The copy constructor. More...
 
 RscVariantBase (RscVariantBase &&arg) noexcept
 The move constructor. More...
 
RscVariantBaseoperator= (const RscVariantBase &arg)
 The assign operator. More...
 
RscVariantBaseoperator= (RscVariantBase &&arg) noexcept
 The move-assign operator. More...
 
 ~RscVariantBase (void)
 The default destructor.
 
RscVariantBaseoperator= (const String &value)
 Assign operator for type String. More...
 
RscVariantBaseoperator= (const char *value)
 Assign operator for type char*. More...
 
RscVariantBaseoperator= (const char8u *value)
 Assign operator for type char8u*. More...
 
template<class T >
RscVariantBaseoperator= (const T &value)
 Assign operator for values of arbitrary type. More...
 
template<int N>
RscVariantBaseoperator= (const RscString< N > &value)
 Assign operator for values of type RscString. More...
 
template<int N>
RscVariantBaseoperator= (const RscSecureString< N > &value)
 Assign operator for values of type SecureString. More...
 
void SetType (RscType value)
 Forces the internal RscType to be set to another RscType. More...
 
RscType GetType (void) const
 Gets the RscType of the contained element More...
 
RscType GetValueType (void) const
 Gets the raw value type as RscType of the contained element. More...
 
bool IsComplexType (void) const
 Determines if this instance represents a complex type, i.e. an array or a struct. More...
 
bool IsArray (void) const
 Determines if this instance represents an array. More...
 
bool IsStruct (void) const
 Determines if this instance represents a struct. More...
 
bool IsFormattable (void) const
 Determines if this instance is convertible to String using the ToString() operation. More...
 
size_t GetDataSize (void) const
 Gets the data size of the contained element. More...
 
size_t GetMaxStringSize (void) const
 Gets the maximal length of strings which are provided by this instance. More...
 
size_t GetBufferSize (void) const
 Gets the buffer size of this instance. More...
 
RscType GetArrayElementType (void) const
 Gets the RscType of the array elements, if this instance represents an array. More...
 
size_t GetArraySize (void) const
 Gets the array size, if this instance represents an array. More...
 
size_t GetArrayDimensions (void) const
 Gets the count of array dimensions (1 for simple array, 2 for array of array etc.), if this instance represents an array. More...
 
size_t GetArrayFieldCount (void) const
 Gets the field count of the struct elements, if this instance represents an array of structs. More...
 
size_t GetFieldCount (void) const
 Gets the field count, if this instance represents a struct. More...
 
byte * GetDataAddress (void)
 Gets a writable raw pointer to the internal data buffer. More...
 
const byte * GetDataAddress (void) const
 
const char * GetChars (void) const
 Gets a readable pointer to internal string buffer. More...
 
void Assign (const char *input, RscType rscType=RscType::String)
 Assigns an UTF8 string to this instance. More...
 
void Assign (const char *input, size_t length, RscType rscType=RscType::String)
 Assigns an UTF8 string to this instance. More...
 
void Assign (const char16 *input, size_t length)
 Assigns an UTF16 string to this instance. More...
 
void Assign (const String &value)
 Assigns the given value of type String. More...
 
void CopyTo (String &value) const
 Copies the content of this variant to a string. More...
 
String ToString (void) const
 Converts this instance to String if the variant type has a reasonable string representation. More...
 
void Clear (bool clearBuffer=false)
 Clears the type and all other infos of this instance. More...
 
bool Equals (const RscVariantBase &arg) const
 Checks if this instance is equal to arg . More...
 
void Read (RscReader &reader, bool omitTag)
 Reads this instance from RSC. More...
 
void Write (RscWriter &writer, bool omitTag) const
 Writes this instance to RSC. More...
 
bool HasArrayInfo (void) const
 Determines if the array info of this instance was set yet. More...
 
void SetArrayInfo (const RscArrayInfo &arrayInfo)
 Set the array info of this instance. More...
 
void SetArrayInfo (size_t size, RscType elementType=RscType::None, size_t dimensions=1, size_t fieldCount=0)
 Sets the array info of this instance. More...
 
RscArrayInfoGetArrayInfo (void)
 Gets the array info of this instance. More...
 
const RscArrayInfoGetArrayInfo (void) const
 
bool HasStructInfo (void) const
 Determines if the struct info of this instance was set yet. More...
 
void SetStructInfo (size_t fieldCount)
 Sets the struct info of this instance. More...
 
RscStructInfoGetStructInfo (void)
 Gets the struct info of this instance. More...
 
const RscStructInfoGetStructInfo (void) const
 
bool HasReadElementFunction (void) const
 Determines if this instance provides an element read function. More...
 
ReadElementFunction GetReadElementFunction (void) const
 Gets the element read function if available. More...
 
void SetReadElementFunction (ReadElementFunction &function)
 Sets the element read function. More...
 
bool HasWriteElementFunction (void) const
 Determines if this instance provides an element write function. More...
 
WriteElementFunction GetWriteElementFunction (void) const
 Gets the element write function if available. More...
 
void SetWriteElementFunction (WriteElementFunction &function) const
 Sets the element write function. More...
 
void ResetComplexTypeInfo (void)
 Clears reader, writer and read/write element functions.
 
template<int N>
void Assign (char value[N])
 Assigns the given value of type T . More...
 
template<int N>
void Assign (const char value[N])
 
template<int N>
void Assign (const RscString< N > &value)
 Assigns the given value of type RscString. More...
 
template<int N>
void Assign (const RscSecureString< N > &value)
 Assigns the given value of type SecureString. More...
 
template<class T >
void Assign (const T &value)
 Assigns the given value of type T . More...
 
template<class T >
void CopyTo (T &value) const
 Copies the value of this instance to the out parameter value . More...
 
template<class T >
GetValue (void) const
 Converts this value to the given type T . More...
 
template<class T >
T * GetValueAddress (void)
 Gets the address of the contained value as type T *. More...
 
template<class T >
const T * GetValueAddress (void) const
 Gets the address of the contained value as type const T *. More...
 

Protected Member Functions

void SetBufferInfo (byte *pDataBuffer, size_t dataBufferSize, bool isDynamicString)
 Sets the buffer properties which are provided by super class RscVariant. More...
 
bool HasReader (void) const
 Determines if this instance has a reader for deserialization. More...
 
bool HasWriter (void) const
 Determines if this instance has a write for serialization. More...
 
void SetReader (RscReader &reader)
 Sets the RSC reader, if this instance represents a complex type (array or struct). More...
 
void SetWriter (RscWriter &writer) const
 Sets the RSC writer, if this instance represents a complex type (array or struct). More...
 
RscReaderGetReader (void) const
 Gets a reader for deserialization. More...
 
RscWriterGetWriter (void) const
 Gets a writer for serialization. More...
 

Protected Attributes

RscType type = RscType::None
 The RSC type of this variant.
 
byte * pBuffer = nullptr
 The buffer of this variant (usually applied by RscVariant<T>)
 
size_t bufferSize = 0
 The size of the applied buffer.
 
bool providesDynamicString = false
 Determines if this variant supports dynamic strings (see String)
 
String dynamicString
 The dynamic string storage.
 
ComplexTypeInfo typeInfo
 The type info of this variant.
 

Friends

class Arp::Base::Rsc::Commons::Internal::RscVariantAccessor
 

Detailed Description

This class is a base class of template class RscVariant.

This implementation avoids extensive inlining of RscVariant implementation, due to the fact, that all template code has to be inlined.

This class is not intended for direct use.

Constructor & Destructor Documentation

◆ RscVariantBase() [1/8]

Arp::Base::Rsc::Commons::RscVariantBase::RscVariantBase ( RscType  type = RscType::None)

The default constructor creates an empty instance of RscVariantBase.

Parameters
typeThe type of this variant.

◆ RscVariantBase() [2/8]

Arp::Base::Rsc::Commons::RscVariantBase::RscVariantBase ( RscType  type,
byte *  pBuffer 
)

Creates a typed instance of RscVariant which refers to an external buffer.

Parameters
typeThe type of this variant.
pBufferThe external buffer

For internal use only.

◆ RscVariantBase() [3/8]

Arp::Base::Rsc::Commons::RscVariantBase::RscVariantBase ( RscType  type,
char *  pBuffer,
size_t  bufferSize 
)

Creates a typed instance of RscVariant which refers to an external buffer.

Parameters
typeThe type of this variant.
pBufferThe external buffer.
bufferSizeThe buffer size of the external buffer.

For internal use only.

◆ RscVariantBase() [4/8]

Arp::Base::Rsc::Commons::RscVariantBase::RscVariantBase ( const RscStringBase data)

Creates a typed instance of RscVariant which refers to an external buffer.

Parameters
dataThe external string buffer.

For internal use only.

◆ RscVariantBase() [5/8]

Arp::Base::Rsc::Commons::RscVariantBase::RscVariantBase ( const RscArrayInfo arrayInfo)

Creates a typed instance of RscVariant which represents an array.

Parameters
arrayInfoThe array information.

◆ RscVariantBase() [6/8]

Arp::Base::Rsc::Commons::RscVariantBase::RscVariantBase ( const RscStructInfo structInfo)

Creates a typed instance of RscVariant which represents a struct.

Parameters
structInfoThe struct information.

◆ RscVariantBase() [7/8]

Arp::Base::Rsc::Commons::RscVariantBase::RscVariantBase ( const RscVariantBase arg)
default

The copy constructor.

Parameters
argThe argument to copy.

◆ RscVariantBase() [8/8]

Arp::Base::Rsc::Commons::RscVariantBase::RscVariantBase ( RscVariantBase &&  arg)
defaultnoexcept

The move constructor.

Parameters
argThe argument to move.

Member Function Documentation

◆ Assign() [1/8]

template<int N>
void Arp::Base::Rsc::Commons::RscVariantBase::Assign ( char  value[N])
inline

Assigns the given value of type T .

Parameters
valueThe string to assign.

◆ Assign() [2/8]

void Arp::Base::Rsc::Commons::RscVariantBase::Assign ( const char *  str,
RscType  rscType = RscType::String 
)

Assigns an UTF8 string to this instance.

Parameters
strThe input UTF8 string to assign.
rscTypeThe RscType marshalling type. Actually only RscType::String is supported.

◆ Assign() [3/8]

void Arp::Base::Rsc::Commons::RscVariantBase::Assign ( const char *  str,
size_t  length,
RscType  rscType = RscType::String 
)

Assigns an UTF8 string to this instance.

Parameters
strThe input UTF8 string to assign.
lengthThe string length of the input string.
rscTypeThe RscType marshalling type. Actually only RscType::String is supported.

◆ Assign() [4/8]

void Arp::Base::Rsc::Commons::RscVariantBase::Assign ( const char16 *  input,
size_t  length 
)

Assigns an UTF16 string to this instance.

Parameters
inputThe input UTF16 string to assign.
lengthThe string length of the input string (number of char16 characters).

The input string is converted to an UTF8 string for marshalling.

◆ Assign() [5/8]

template<int N>
void Arp::Base::Rsc::Commons::RscVariantBase::Assign ( const RscSecureString< N > &  value)
inline

Assigns the given value of type SecureString.

Parameters
valueThe string to assign.

◆ Assign() [6/8]

template<int N>
void Arp::Base::Rsc::Commons::RscVariantBase::Assign ( const RscString< N > &  value)
inline

Assigns the given value of type RscString.

Parameters
valueThe string to assign.

◆ Assign() [7/8]

void Arp::Base::Rsc::Commons::RscVariantBase::Assign ( const String value)

Assigns the given value of type String.

Parameters
valueThe string to assign.

◆ Assign() [8/8]

template<class T >
void Arp::Base::Rsc::Commons::RscVariantBase::Assign ( const T &  value)
inline

Assigns the given value of type T .

Parameters
valueThe value to assign.
Template Parameters
TThe type to convert this instance to.

◆ Clear()

void Arp::Base::Rsc::Commons::RscVariantBase::Clear ( bool  clearBuffer = false)

Clears the type and all other infos of this instance.

Parameters
clearBuffertrue if the buffer should be zeroed also, otherwise false.

◆ CopyTo() [1/2]

void Arp::Base::Rsc::Commons::RscVariantBase::CopyTo ( String value) const

Copies the content of this variant to a string.

Parameters
valueThe resulting string to copy this content to.

This operation specializes the generic operation CopyTo<T> for the String type.

◆ CopyTo() [2/2]

template<class T >
void Arp::Base::Rsc::Commons::RscVariantBase::CopyTo ( T &  value) const
inline

Copies the value of this instance to the out parameter value .

Parameters
valueThe resulting value.
Exceptions
InvalidCastExceptionIf this instance does not match the supplied parameter type T .

◆ Equals()

bool Arp::Base::Rsc::Commons::RscVariantBase::Equals ( const RscVariantBase arg) const

Checks if this instance is equal to arg .

Parameters
argThe argument to check on equality.
Returns
true if this instance is equal to arg , otherwise false.

◆ GetArrayDimensions()

size_t Arp::Base::Rsc::Commons::RscVariantBase::GetArrayDimensions ( void  ) const

Gets the count of array dimensions (1 for simple array, 2 for array of array etc.), if this instance represents an array.

Returns
The count of array dimensions
Exceptions
InvalidOperationExceptionIf this instance does not represent an array.

◆ GetArrayElementType()

RscType Arp::Base::Rsc::Commons::RscVariantBase::GetArrayElementType ( void  ) const

Gets the RscType of the array elements, if this instance represents an array.

Returns
The array element type as RscType.
Exceptions
InvalidOperationExceptionIf this instance does not represent an array.

◆ GetArrayFieldCount()

size_t Arp::Base::Rsc::Commons::RscVariantBase::GetArrayFieldCount ( void  ) const

Gets the field count of the struct elements, if this instance represents an array of structs.

Returns
The field count of the struct elements.
Exceptions
InvalidOperationExceptionIf this instance does not represent an array.

◆ GetArrayInfo()

const RscArrayInfo & Arp::Base::Rsc::Commons::RscVariantBase::GetArrayInfo ( void  )

Gets the array info of this instance.

Returns
The array info.
Exceptions
InvalidOperationExceptionIf this instance does not represent an array.

◆ GetArraySize()

size_t Arp::Base::Rsc::Commons::RscVariantBase::GetArraySize ( void  ) const

Gets the array size, if this instance represents an array.

Returns
The array size.
Exceptions
InvalidOperationExceptionIf this instance does not represent an array.

◆ GetBufferSize()

size_t Arp::Base::Rsc::Commons::RscVariantBase::GetBufferSize ( void  ) const

Gets the buffer size of this instance.

Returns
The buffer size of this instance.

◆ GetChars()

const char * Arp::Base::Rsc::Commons::RscVariantBase::GetChars ( void  ) const

Gets a readable pointer to internal string buffer.

Returns
A pointer to the string buffer.
Exceptions
InvalidCastExceptionIf this instance does not represent a string.

◆ GetDataAddress()

const byte * Arp::Base::Rsc::Commons::RscVariantBase::GetDataAddress ( void  )

Gets a writable raw pointer to the internal data buffer.

Gets a readable raw pointer to the internal data buffer.

Returns
The pointer to the internal data buffer

To obtain data from this instance prefer the use of CopyTo or GetValue operations and to write instance data prefer Assign operations or assign operators, because this operation is not type safe. For internal use only.

◆ GetDataSize()

size_t Arp::Base::Rsc::Commons::RscVariantBase::GetDataSize ( void  ) const

Gets the data size of the contained element.

Returns
The data size of contained element.

◆ GetFieldCount()

size_t Arp::Base::Rsc::Commons::RscVariantBase::GetFieldCount ( void  ) const

Gets the field count, if this instance represents a struct.

Returns
The field count of the struct type.
Exceptions
InvalidOperationExceptionIf this instance does not represent a struct.

◆ GetMaxStringSize()

size_t Arp::Base::Rsc::Commons::RscVariantBase::GetMaxStringSize ( void  ) const

Gets the maximal length of strings which are provided by this instance.

Returns
The maximal string length excluding the string terminator.

◆ GetReadElementFunction()

RscVariantBase::ReadElementFunction Arp::Base::Rsc::Commons::RscVariantBase::GetReadElementFunction ( void  ) const

Gets the element read function if available.

Returns
The function to read elements.
Exceptions
InvalidOperationExceptionIf this instance does not provide an element read function.

◆ GetReader()

RscReader * Arp::Base::Rsc::Commons::RscVariantBase::GetReader ( void  ) const
protected

Gets a reader for deserialization.

Returns
The reader pointer if a reader is available, otherwise nullptr.

For internal use only.

◆ GetStructInfo()

const RscStructInfo & Arp::Base::Rsc::Commons::RscVariantBase::GetStructInfo ( void  )

Gets the struct info of this instance.

Returns
The struct info.
Exceptions
InvalidOperationExceptionIf this instance does not represent a struct.

◆ GetType()

RscType Arp::Base::Rsc::Commons::RscVariantBase::GetType ( void  ) const

Gets the RscType of the contained element

Returns
RscType of contained element

◆ GetValue()

template<class T >
T Arp::Base::Rsc::Commons::RscVariantBase::GetValue ( void  ) const
inline

Converts this value to the given type T .

Returns
The value of this instance of type T.
Returns
Template Parameters
TThe type to convert this instance to.

◆ GetValueAddress() [1/2]

template<class T >
T * Arp::Base::Rsc::Commons::RscVariantBase::GetValueAddress ( void  )
inline

Gets the address of the contained value as type T *.

Returns
The address of the value of this instance as type T*.
Returns
Template Parameters
TThe type to convert the value address to.

◆ GetValueAddress() [2/2]

template<class T >
const T * Arp::Base::Rsc::Commons::RscVariantBase::GetValueAddress ( void  ) const
inline

Gets the address of the contained value as type const T *.

Returns
The address of the value of this instance as type const T*.
Returns
Template Parameters
TThe type to convert the value address to.

◆ GetValueType()

RscType Arp::Base::Rsc::Commons::RscVariantBase::GetValueType ( void  ) const

Gets the raw value type as RscType of the contained element.

Returns
The raw value type as RscType of the contained element.

Some types like <see cref="RscType::IecTime /> are mapped to its raw value counterpart e.g. <see cref="RscType::Int32 />.

◆ GetWriteElementFunction()

RscVariantBase::WriteElementFunction Arp::Base::Rsc::Commons::RscVariantBase::GetWriteElementFunction ( void  ) const

Gets the element write function if available.

Returns
The function to write elements.
Exceptions
InvalidOperationExceptionIf this instance does not provide an element write function.

◆ GetWriter()

RscWriter * Arp::Base::Rsc::Commons::RscVariantBase::GetWriter ( void  ) const
protected

Gets a writer for serialization.

Returns
The writer pointer if a writer is available, otherwise nullptr.

For internal use only.

◆ HasArrayInfo()

bool Arp::Base::Rsc::Commons::RscVariantBase::HasArrayInfo ( void  ) const

Determines if the array info of this instance was set yet.

Returns
true if the array info was set yet, otherwise false.

◆ HasReadElementFunction()

bool Arp::Base::Rsc::Commons::RscVariantBase::HasReadElementFunction ( void  ) const

Determines if this instance provides an element read function.

Returns
true if an element read function is available, otherwise false.

◆ HasReader()

bool Arp::Base::Rsc::Commons::RscVariantBase::HasReader ( void  ) const
protected

Determines if this instance has a reader for deserialization.

Returns
true if a reader is available, otherwise false.

For internal use only.

◆ HasStructInfo()

bool Arp::Base::Rsc::Commons::RscVariantBase::HasStructInfo ( void  ) const

Determines if the struct info of this instance was set yet.

Returns
true if the struct info was set yet, otherwise false.

◆ HasWriteElementFunction()

bool Arp::Base::Rsc::Commons::RscVariantBase::HasWriteElementFunction ( void  ) const

Determines if this instance provides an element write function.

Returns
true if an element write function is available, otherwise false.

◆ HasWriter()

bool Arp::Base::Rsc::Commons::RscVariantBase::HasWriter ( void  ) const
protected

Determines if this instance has a write for serialization.

Returns
true if a writer is available, otherwise false.

For internal use only.

◆ IsArray()

bool Arp::Base::Rsc::Commons::RscVariantBase::IsArray ( void  ) const

Determines if this instance represents an array.

Returns
true if this instance represents an array, otherwise false.

◆ IsComplexType()

bool Arp::Base::Rsc::Commons::RscVariantBase::IsComplexType ( void  ) const

Determines if this instance represents a complex type, i.e. an array or a struct.

Returns
true if this instance represents an array or a struct, otherwise false.

◆ IsFormattable()

bool Arp::Base::Rsc::Commons::RscVariantBase::IsFormattable ( void  ) const

Determines if this instance is convertible to String using the ToString() operation.

Returns
true if this instance has a string representation, otherwise false.

◆ IsStruct()

bool Arp::Base::Rsc::Commons::RscVariantBase::IsStruct ( void  ) const

Determines if this instance represents a struct.

Returns
true if this instance represents a struct, otherwise false.

◆ operator=() [1/8]

RscVariantBase & Arp::Base::Rsc::Commons::RscVariantBase::operator= ( const char *  value)

Assign operator for type char*.

Parameters
valueThe string to assign.
Returns
A reference to this instance.

◆ operator=() [2/8]

RscVariantBase & Arp::Base::Rsc::Commons::RscVariantBase::operator= ( const char8u *  value)

Assign operator for type char8u*.

Parameters
valueThe string to assign.
Returns
A reference to this instance.

◆ operator=() [3/8]

template<int N>
RscVariantBase & Arp::Base::Rsc::Commons::RscVariantBase::operator= ( const RscSecureString< N > &  value)
inline

Assign operator for values of type SecureString.

Parameters
valueThe string to assign.
Template Parameters
NThe maximal string length.
Returns
This instance as reference.

◆ operator=() [4/8]

template<int N>
RscVariantBase & Arp::Base::Rsc::Commons::RscVariantBase::operator= ( const RscString< N > &  value)
inline

Assign operator for values of type RscString.

Parameters
valueThe string to assign.
Template Parameters
NThe maximal string length.
Returns
This instance as reference.

◆ operator=() [5/8]

RscVariantBase & Arp::Base::Rsc::Commons::RscVariantBase::operator= ( const RscVariantBase arg)
default

The assign operator.

Parameters
argThe argument to assign.
Returns
This instance.

◆ operator=() [6/8]

RscVariantBase & Arp::Base::Rsc::Commons::RscVariantBase::operator= ( const String value)

Assign operator for type String.

Parameters
valueThe string to assign.
Returns
A reference to this instance.

◆ operator=() [7/8]

template<class T >
RscVariantBase & Arp::Base::Rsc::Commons::RscVariantBase::operator= ( const T &  value)
inline

Assign operator for values of arbitrary type.

Parameters
valueThe value to assign.
Template Parameters
TThe type of the value.
Returns
This instance as reference.

◆ operator=() [8/8]

RscVariantBase & Arp::Base::Rsc::Commons::RscVariantBase::operator= ( RscVariantBase &&  arg)
defaultnoexcept

The move-assign operator.

Parameters
argThe argument to move.
Returns
This instance.

◆ Read()

void Arp::Base::Rsc::Commons::RscVariantBase::Read ( RscReader reader,
bool  omitTag 
)

Reads this instance from RSC.

Parameters
readerThe RSC reader to read from.
omitTagtrue if the data tag should be omitted during read, otherwise false.

For internal use only.

◆ SetArrayInfo() [1/2]

void Arp::Base::Rsc::Commons::RscVariantBase::SetArrayInfo ( const RscArrayInfo arrayInfo)

Set the array info of this instance.

Parameters
arrayInfoThe array info to assign.

This operation set the type of this instance implicitly to RscType::Array and the array infos accordingly.

◆ SetArrayInfo() [2/2]

void Arp::Base::Rsc::Commons::RscVariantBase::SetArrayInfo ( size_t  size,
RscType  elementType = RscType::None,
size_t  dimensions = 1,
size_t  fieldCount = 0 
)

Sets the array info of this instance.

Parameters
sizeThe size of the array.
elementTypeThe element type of the array.
dimensionsThe array dimensions.
fieldCountThe field count of the element struct type.

This operation set the type of this instance implicitly to RscType::Array and the array infos accordingly.

◆ SetBufferInfo()

void Arp::Base::Rsc::Commons::RscVariantBase::SetBufferInfo ( byte *  pDataBuffer,
size_t  dataBufferSize,
bool  isDynamicString 
)
protected

Sets the buffer properties which are provided by super class RscVariant.

Parameters
pDataBufferThe data buffer.
dataBufferSizeThe data buffer size.
isDynamicStringDetermines if the buffer belongs to a dynamic string of type String.

For internal use only.

◆ SetReadElementFunction()

void Arp::Base::Rsc::Commons::RscVariantBase::SetReadElementFunction ( ReadElementFunction function)

Sets the element read function.

Parameters
functionThe function to read elements.
Exceptions
InvalidOperationExceptionIf this instance does not provide an element read function.

◆ SetReader()

void Arp::Base::Rsc::Commons::RscVariantBase::SetReader ( RscReader reader)
protected

Sets the RSC reader, if this instance represents a complex type (array or struct).

Parameters
readerThe reader to use for deserialization.

For internal use only.

◆ SetStructInfo()

void Arp::Base::Rsc::Commons::RscVariantBase::SetStructInfo ( size_t  fieldCount)

Sets the struct info of this instance.

Parameters
fieldCountThe field count of the struct.

◆ SetType()

void Arp::Base::Rsc::Commons::RscVariantBase::SetType ( RscType  value)

Forces the internal RscType to be set to another RscType.

This method does no conversion or validation. Prefer using assignment operators, which sets the RscType implicitly.

Parameters
valueThe new value to set.

◆ SetWriteElementFunction()

void Arp::Base::Rsc::Commons::RscVariantBase::SetWriteElementFunction ( WriteElementFunction function) const

Sets the element write function.

Parameters
functionThe function to write elements.

◆ SetWriter()

void Arp::Base::Rsc::Commons::RscVariantBase::SetWriter ( RscWriter writer) const
protected

Sets the RSC writer, if this instance represents a complex type (array or struct).

Parameters
writerThe writer to use for serialization.

For internal use only.

◆ ToString()

String Arp::Base::Rsc::Commons::RscVariantBase::ToString ( void  ) const

Converts this instance to String if the variant type has a reasonable string representation.

Returns
The string representation of this instance.

◆ Write()

void Arp::Base::Rsc::Commons::RscVariantBase::Write ( RscWriter writer,
bool  omitTag 
) const

Writes this instance to RSC.

Parameters
writerThe RSC writer to write to.
omitTagtrue if the data tag should be omitted during write, otherwise false.

For internal use only.


The documentation for this class was generated from the following files: