FVMReflection::operator[]

Array subscript operator, which takes a string for verifying that an array is of a particular type, e.g. ["uint8"].

Windows
MacOS
Linux

References

Module

NetcodeUnitTest

Header

/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Public/NUTUtilReflection.h

Include

#include "NUTUtilReflection.h"

Source

/Engine/Plugins/NetcodeUnitTest/NetcodeUnitTest/Source/NetcodeUnitTest/Private/NUTUtilReflection.cpp

Syntax

FVMReflection & operator[]
(
    const ANSICHAR * InFieldType
)

Remarks

Array subscript operator, which takes a string for verifying that an array is of a particular type, e.g. ["uint8"]. This is mandatory, and must be specified before the array element subscript, like so: ByteArray["uint8"][0].

This also works for structs, but should only be used when using (void*) to cast a struct to a pointer. The primary purpose of this, is for casting arrays to an (FScriptArray*), and then to (TArray*); without type verification with this operator, casting like this would be unsafe, as you would be assuming a type which may have later changed as the codebase evolves.

Object arrays should be specified in the format ["U?*"], e.g. ["UObject*"], Actor arrays should be specified in the format ["A?*"], e.g. ["APawn*"], and Struct and struct arrays should be specified in the format ["F?"], e.g. ["FVector"].

Returns

Returns this VM reflector, for operator chaining

Parameters

Parameter

Description

InFieldType

The expected field type

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss