FRigVMMemoryContainer

The [FRigVMMemoryContainer](API\Runtime\RigVM\RigVMCore\FRigVMMemoryContainer) provides a heterogeneous memory container to store arbitrary data.

Windows
MacOS
Linux

References

Module

RigVM

Header

/Engine/Source/Runtime/RigVM/Public/RigVMCore/RigVMMemory.h

Include

#include "RigVMCore/RigVMMemory.h"

Syntax

struct FRigVMMemoryContainer

Remarks

The FRigVMMemoryContainer provides a heterogeneous memory container to store arbitrary data. Each element stored can be referred to using a FRigVMRegister. Elements can be accessed by index (index of the register), FRigVMOperand or by name. Name access is optional and is specified upon construction of the container. The memory container provides a series of templated functions to add and get data.

For example: int32 Index = Container.Add<float>(4.f); float& ValueRef = Container.GetRef<float>(Index);

This can also be done with arrays: TArray<float> MyArray = {3.f, 4.f, 5.f}; int32 Index = Container.AddFixedArray<float>(MyArray); FRigVMFixedArray<float> ArrayView = Container.GetFixedArray<float>(Index);

Constructors

Name Description

Public function

FRigVMMemoryContainer

(
    bool bInUseNames
)

Public function

FRigVMMemoryContainer

(
    const FRigVMMemoryContainer& Other
)

Destructors

Name Description

Public function

~FRigVMMemoryContainer()

Functions

Name Description

Public function

int32

 

Add

(
    const FName& InNewName,
    const T& InValue,
    int32 InSliceCount
)

Adds a new named register for a typed value from a value reference.

Public function

int32

 

Add

(
    const T& InValue,
    int32 InSliceCount
)

Adds a new unnamed register for a typed value from a value reference.

Public function

int32

 

AddDynamicArray

(
    const FRigVMFixedArray< T >& InArr...,
    int32 InSliceCount
)

Adds a new unnamed register for a typed array from an array view.

Public function

int32

 

AddDynamicArray

(
    const FName& InNewName,
    const TArray< T >& InArray,
    int32 InSliceCount
)

Adds a new named register for a typed array from an array view (used by compiler)

Public function

int32

 

AddDynamicArray

(
    const FName& InNewName,
    const FRigVMFixedArray< T >& InArr...,
    int32 InSliceCount
)

Adds a new named register for a typed array from an array view (used by compiler)

Public function

int32

 

AddDynamicArray

(
    const TArray< T >& InArray,
    int32 InSliceCount
)

Adds a new unnamed register for a typed array from an array view.

Public function

int32

 

AddDynamicValue

(
    const FName& InNewName,
    const T& InValue,
    int32 InSliceCount
)

Adds a new named register for a typed value from a value reference.

Public function

int32

 

AddDynamicValue

(
    const T& InValue,
    int32 InSliceCount
)

Adds a new unnamed register for a typed value from a value reference.

Public function

int32

 

AddFixedArray

(
    const FName& InNewName,
    const FRigVMFixedArray< T >& InArr...,
    int32 InSliceCount
)

Adds a new named register for a typed array from an array view (used by compiler)

Public function

int32

 

AddFixedArray

(
    const FRigVMFixedArray< T >& InArr...,
    int32 InSliceCount
)

Adds a new unnamed register for a typed array from an array view.

Public function Const

TArray< FRig...

 

begin()

Public function

TArray< FRig...

 

begin()

Public function

bool

 

Copy

(
    int32 InSourceRegisterIndex,
    int32 InTargetRegisterIndex,
    const FRigVMMemoryContainer* I...,
    int32 InSourceRegisterOffset,
    int32 InTargetRegisterOffset,
    int32 InSourceSliceIndex,
    int32 InTargetSliceIndex
)

Copies the content of a source register to a target register.

Public function

bool

 

Copy

(
    const FRigVMOperand& InSourceOpera...,
    const FRigVMOperand& InTargetOpera...,
    const FRigVMMemoryContainer* I...,
    int32 InSourceSliceIndex,
    int32 InTargetSliceIndex
)

Copies the content of a source register to a target register.

Public function

bool

 

Copy

(
    const FName& InSourceName,
    const FName& InTargetName,
    const FRigVMMemoryContainer* I...,
    int32 InSourceRegisterOffset,
    int32 InTargetRegisterOffset,
    int32 InSourceSliceIndex,
    int32 InTargetSliceIndex
)

Copies the content of a source register to a target register.

Public function

void

 

Empty()

Resets the container and removes all storage.

Public function

TArray< FRig...

 

end()

Public function Const

TArray< FRig...

 

end()

Public function Const

const T *...

 

Get

(
    const FRigVMOperand& InOperand,
    int32 InSliceIndex
)

Returns the current const typed pointer for a given argument.

Public function

T *

 

Get

(
    const FRigVMOperand& InOperand,
    int32 InSliceIndex
)

Returns the current typed pointer for a given argument.

Public function Const

const T *...

 

Get

(
    const FRigVMRegister& InRegister,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current const typed pointer for a given register.

Public function Const

const T *...

 

Get

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current const typed pointer for a given register index.

Public function

T *

 

Get

(
    FRigVMRegister& InRegister,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current typed pointer for a given register.

Public function

T *

 

Get

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current typed pointer for a given register index.

Public function Const

const uint8 ...

 

GetData

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current const data pointer for a given register index.

Public function

uint8 *

 

GetData

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current data pointer for a given register index.

Public function

uint8 *

 

GetData

(
    FRigVMRegister& Register,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current data pointer for a given register.

Public function Const

const uint8 ...

 

GetData

(
    const FRigVMRegister& Register,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current const data pointer for a given register.

Public function

FRigVMDynami...

 

GetDynamicArray

(
    FRigVMRegister& InRegister,
    int32 InSliceIndex
)

Returns an array view for all elements of the current slice for a given register.

Public function

FRigVMDynami...

 

GetDynamicArray

(
    int32 InRegisterIndex,
    int32 InSliceIndex
)

Returns an array view for all elements of the current slice for a given register index.

Public function

FRigVMDynami...

 

GetDynamicArray

(
    const FRigVMOperand& InOperand,
    int32 InSliceIndex
)

Returns an array view for all elements of the current slice for a given argument.

Public function

FRigVMFixedA...

 

GetFixedArray

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns an array view for all elements of the current slice for a given register index.

Public function

FRigVMFixedA...

 

GetFixedArray

(
    FRigVMRegister& InRegister,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns an array view for all elements of the current slice for a given register.

Public function

FRigVMFixedA...

 

GetFixedArray

(
    const FRigVMOperand& InOperand,
    int32 InSliceIndex
)

Returns an array view for all elements of the current slice for a given argument.

Public function Const

FRigVMMemory...

 

GetHandle

(
    int32 InRegisterIndex,
    int32 InRegisterOffset
)

Returns a memory handle for a given register.

Public function Const

FRigVMMemory...

 

GetHandle

(
    const FRigVMRegister& Register,
    int32 InRegisterOffset
)

Returns a memory handle for a given register.

Public function Const

int32

 

GetIndex

(
    const FName& InName
)

Returns the index of a register based on the register name.

Public function Const

ERigVMMemory...

 

GetMemoryType()

Returns the memory type of this container

Public function Const

int32

 

GetNumElements

(
    const FRigVMRegister& Register,
    int32 InSliceIndex
)

Returns the number of elements for a given slice.

Public function Const

int32

 

GetNumElements

(
    int32 InRegisterIndex,
    int32 InSliceIndex
)

Returns the number of elements for a given slice.

Public function

FRigVMOperan...

 

GetOperand

(
    int32 InRegisterIndex,
    const FString& InSegmentPath,
    int32 InArrayElement
)

Returns an argument for a given register.

Public function

FRigVMOperan...

 

GetOperand

(
    int32 InRegisterIndex,
    int32 InRegisterOffset
)

Returns an argument for a given register.

Public function

int32

 

GetOrAddRegisterOffset

(
    int32 InRegisterIndex,
    UScriptStruct* InScriptStruct,
    const FString& InSegmentPath,
    int32 InInitialOffset,
    int32 InElementSize
)

Adds a register path and returns its index.

Public function

int32

 

GetOrAddRegisterOffset

(
    int32 InRegisterIndex,
    const FString& InSegmentPath,
    int32 InArrayElement
)

Adds a register path and returns its index.

Public function

int32

 

GetOrAddRegisterOffset

(
    int32 InRegisterIndex,
    int32 InArrayElement
)

Adds a register path and returns its index.

Public function Const

const T &

 

GetRef

(
    const FRigVMRegister& Register,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current const typed reference for a given register.

Public function

T &

 

GetRef

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current typed reference for a given register index.

Public function

T &

 

GetRef

(
    FRigVMRegister& Register,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current typed reference for a given register.

Public function Const

const T &

 

GetRef

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    int32 InSliceIndex
)

Returns the current const typed reference for a given register index.

Public function

T &

 

GetRef

(
    const FRigVMOperand& InOperand,
    int32 InSliceIndex
)

Returns the current typed reference for a given argument.

Public function Const

const T &

 

GetRef

(
    const FRigVMOperand& InOperand,
    int32 InSliceIndex
)

Returns the current const typed reference for a given argument.

Public function Const

const FRigVM...

 

GetRegister

(
    const FRigVMOperand& InArg
)

Const accessor for a register based on an argument

Public function Const

const FRigVM...

 

GetRegister

(
    int32 InIndex
)

Const accessor for a register based on index

Public function

FRigVMRegist...

 

GetRegister

(
    const FRigVMOperand& InArg
)

Accessor for a register based on an argument

Public function

FRigVMRegist...

 

GetRegister

(
    const FName& InName
)

Accessor for a register based on a a name.

Public function Const

const FRigVM...

 

GetRegister

(
    const FName& InName
)

Const accessor for a register based on a a name.

Public function

FRigVMRegist...

 

GetRegister

(
    int32 InIndex
)

Accessor for a register based on index

Public function

TArray< FStr...

 

GetRegisterValueAsString

(
    const FRigVMOperand& InOperand,
    const FString& InCPPType,
    const UObject* InCPPTypeObject
)

Public function Const

UScriptStruc...

 

GetScriptStruct

(
    const FRigVMRegister& Register
)

Returns the script struct used for a given register (can be nullptr for non-struct-registers).

Public function Const

UScriptStruc...

 

GetScriptStruct

(
    int32 InRegisterIndex,
    int32 InRegisterOffset
)

Returns the script struct used for a given register index (can be nullptr for non-struct-registers).

Public function Const

FRigVMMemory...

 

GetStatistics()

Returns the statistics information

Public function Const

bool

 

IsNameAvailable

(
    const FName& InPotentialNewName
)

Returns true if a given name is available for a new register.

Public function Const

int32

 

Num()

Returns the number of registers in this container

Public function

FName

 

Rename

(
    const FName& InOldName,
    const FName& InNewName
)

Remove a register given its old name.

Public function

FName

 

Rename

(
    int32 InRegisterIndex,
    const FName& InNewName
)

Remove a register given its index.

Public function

void

 

Reset()

Resets the container but maintains storage.

Public function

bool

 

Serialize

(
    FArchive& Ar
)

Public function

void

 

SetMemoryType

(
    ERigVMMemoryType InMemoryType
)

Sets the memory type. should only be used when the container is empty

Public function

void

 

SetRegisterValueFromString

(
    const FRigVMOperand& InOperand,
    const FString& InCPPType,
    const UObject* InCPPTypeObject,
    const TArray< FString >& InDefault...
)

Public function Const

bool

 

SupportsNames()

Returns true if this container supports name based lookup

Operators

Name Description

Public function Const

const FRigVM...

 

operator[]

(
    const FRigVMOperand& InArg
)

Const accessor for a register based on an argument

Public function Const

const FRigVM...

 

operator[]

(
    const FName& InName
)

Const accessor for a register based on a a name.

Public function

FRigVMRegist...

 

operator[]

(
    int32 InIndex
)

Accessor for a register based on index

Public function

FRigVMRegist...

 

operator[]

(
    const FRigVMOperand& InArg
)

Accessor for a register based on an argument

Public function

FRigVMRegist...

 

operator[]

(
    const FName& InName
)

Accessor for a register based on a a name.

Public function Const

const FRigVM...

 

operator[]

(
    int32 InIndex
)

Const accessor for a register based on index

Public function

FRigVMMemory...

 

operator=

(
    const FRigVMMemoryContainer& InOth...
)

Constants

Name

Description

DefaultByteArray

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