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. Plain types (shallow types without the need for construction) can be added and retrieved using the methods suffixed with 'Plain'.

For example: int32 Index = Container.AddPlain<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.AddPlainArray<float>(MyArray); TArrayView<float> ArrayView = Container.GetArray<float>(Index);

More complex data structures such as USTRUCT types need to be stored with the 'Struct' suffixed methods - since they require a constructor / destructor to be called.

For example: FMyStruct MyStruct; int32 Index = Container.AddStruct<FMyStruct>(MyStruct); FMyStruct& ValueRef = Container.GetRef<FMyStruct>(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

 

AddPlain

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

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

Public function

int32

 

AddPlain

(
    const T& InValue,
    int32 InSliceCount
)

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

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FVector > InArrayView,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FName > InArrayView,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FVector4 > InArrayView,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FColor > InArrayView,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FLinearColor > InArrayV...,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FTransform > InArrayVie...,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FQuat > InArrayView,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FRotator > InArrayView,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< T > InArrayView,
    int32 InSliceCount
)

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

Public function

int32

 

AddPlainArray

(
    TArrayView< T > InArrayView,
    int32 InSliceCount
)

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

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FVector2D > InArrayView,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FPlane > InArrayView,
    int32 InSliceCount
)

Public function

int32

 

AddPlainArray

(
    const FName& InNewName,
    TArrayView< FString > InArrayView,
    int32 InSliceCount
)

Public function

int32

 

AddStruct

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

Adds a new named register for a typed struct given a value reference.

Public function

int32

 

AddStruct

(
    const T& InValue,
    int32 InSliceCount
)

Adds a new unnamed register for a typed struct given a value reference.

Public function

int32

 

AddStructArray

(
    const FName& InNewName,
    TArrayView< T > InArrayView,
    int32 InSliceCount
)

Adds a new named register for a typed struct array given a value reference.

Public function

int32

 

AddStructArray

(
    TArrayView< T > InArrayView,
    int32 InSliceCount
)

Adds a new named register for a typed struct array given a TArray.

Public function

TArray< FRig...

 

begin()

Public function Const

TArray< FRig...

 

begin()

Public function

bool

 

ChangeRegisterType

(
    int32 InRegisterIndex,
    const T* InDataPtr,
    int32 InNewElementCount,
    int32 InNewSliceCount
)

Changes the type of a register provided a new type and a data pointer.

Public function

bool

 

ChangeRegisterType

(
    int32 InRegisterIndex,
    const FName* InDataPtr,
    int32 InNewElementCount,
    int32 InNewSliceCount
)

Public function

bool

 

ChangeRegisterType

(
    int32 InRegisterIndex,
    const FString* InDataPtr,
    int32 InNewElementCount,
    int32 InNewSliceCount
)

Public function

bool

 

ChangeRegisterType

(
    int32 InRegisterIndex,
    ERigVMRegisterType InNewType,
    int32 InElementSize,
    const uint8* InDataPtr,
    int32 InNewElementCount,
    int32 InNewSliceCount
)

Changes the type of a register provided a new type and a data pointer.

Public function

bool

 

Copy

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

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

Public function

bool

 

Copy

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

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

Public function

bool

 

Copy

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

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

Public function

void

 

Empty()

Resets the container and removes all storage.

Public function Const

TArray< FRig...

 

end()

Public function

TArray< FRig...

 

end()

Public function

T *

 

Get

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    bool bMoveToNextSlice
)

Returns the current typed pointer for a given register index Note: This refers to the active slice - and can change over time.

Public function

T *

 

Get

(
    FRigVMRegister& InRegister,
    int32 InRegisterOffset,
    bool bMoveToNextSlice
)

Returns the current typed pointer for a given register Note: This refers to the active slice - and can change over time.

Public function

T *

 

Get

(
    const FRigVMOperand& InOperand,
    bool bMoveToNextSlice
)

Returns the current typed pointer for a given argument Note: This refers to the active slice - and can change over time.

Public function Const

const T *...

 

Get

(
    int32 InRegisterIndex,
    int32 InRegisterOffset
)

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

Public function Const

const T *...

 

Get

(
    const FRigVMRegister& InRegister,
    int32 InRegisterOffset
)

Returns the current const typed pointer for a given register.

Public function Const

const T *...

 

Get

(
    const FRigVMOperand& InOperand
)

Returns the current const typed pointer for a given argument Note: This refers to the active slice - and can change over time.

Public function

TArrayView< ...

 

GetArray

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    bool bMoveToNextSlice
)

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

Public function

TArrayView< ...

 

GetArray

(
    FRigVMRegister& InRegister,
    int32 InRegisterOffset,
    bool bMoveToNextSlice
)

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

Public function

TArrayView< ...

 

GetArray

(
    const FRigVMOperand& InOperand,
    bool bMoveToNextSlice
)

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

Public function

uint8 *

 

GetData

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    bool bMoveToNextSlice
)

Returns the current data pointer for a given register index.

Public function

uint8 *

 

GetData

(
    FRigVMRegister& Register,
    int32 InRegisterOffset,
    bool bMoveToNextSlice
)

Returns the current data pointer for a given register.

Public function Const

const uint8 ...

 

GetData

(
    int32 InRegisterIndex,
    int32 InRegisterOffset
)

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

Public function Const

const uint8 ...

 

GetData

(
    const FRigVMRegister& Register,
    int32 InRegisterOffset
)

Returns the current const data pointer 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

FRigVMOperan...

 

GetOperand

(
    int32 InRegisterIndex,
    int32 InRegisterOffset
)

Returns an argument for a given register.

Public function

FRigVMOperan...

 

GetOperand

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

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

T &

 

GetRef

(
    int32 InRegisterIndex,
    int32 InRegisterOffset,
    bool bMoveToNextSlice
)

Returns the current typed reference for a given register index Note: This refers to the active slice - and can change over time.

Public function

T &

 

GetRef

(
    FRigVMRegister& Register,
    int32 InRegisterOffset,
    bool bMoveToNextSlice
)

Returns the current typed reference for a given register Note: This refers to the active slice - and can change over time.

Public function

T &

 

GetRef

(
    const FRigVMOperand& InOperand,
    bool bMoveToNextSlice
)

Returns the current typed reference for a given argument Note: This refers to the active slice - and can change over time.

Public function Const

const T &

 

GetRef

(
    const FRigVMRegister& Register,
    int32 InRegisterOffset
)

Returns the current const typed reference for a given register Note: This refers to the active slice - and can change over time.

Public function Const

const T &

 

GetRef

(
    const FRigVMOperand& InOperand
)

Returns the current const typed reference for a given argument Note: This refers to the active slice - and can change over time.

Public function Const

const T &

 

GetRef

(
    int32 InRegisterIndex,
    int32 InRegisterOffset
)

Returns the current const typed reference for a given register index Note: This refers to the active slice - and can change over time.

Public function Const

const FRigVM...

 

GetRegister

(
    const FName& InName
)

Const accessor for a register based on a a name. note: only works if SupportsNames() == true

Public function Const

const FRigVM...

 

GetRegister

(
    int32 InIndex
)

Const accessor for a register based on index

Public function

FRigVMRegist...

 

GetRegister

(
    int32 InIndex
)

Accessor for a register based on index

Public function Const

const FRigVM...

 

GetRegister

(
    const FRigVMOperand& InArg
)

Const accessor for a register based on an argument

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. note: only works if SupportsNames() == true

Public function

TArray< FStr...

 

GetRegisterValueAsString

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

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

UScriptStruc...

 

GetScriptStruct

(
    const FRigVMRegister& Register
)

Returns the script struct used for a given register (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

bool

 

Remove

(
    int32 InRegisterIndex
)

Remove a register given its index.

Public function

bool

 

Remove

(
    const FName& InRegisterName
)

Remove a register given its name Note: This only works if SupportsNames() == true

Public function

FName

 

Rename

(
    const FName& InOldName,
    const FName& InNewName
)

Remove a register given its old name Note: This only works if SupportsNames() == true

Public function

FName

 

Rename

(
    int32 InRegisterIndex,
    const FName& InNewName
)

Remove a register given its index Note: This only works if SupportsNames() == true

Public function

void

 

Reset()

Resets the container but maintains storage.

Public function

bool

 

Resize

(
    const FName& InRegisterName,
    int32 InNewElementCount,
    int32 InNewSliceCount
)

Resize a register given its name Note: This only works if SupportsNames() == true

Public function

bool

 

Resize

(
    int32 InRegisterIndex,
    int32 InNewElementCount,
    int32 InNewSliceCount
)

Resize a register given its index.

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

FRigVMRegist...

 

operator[]

(
    int32 InIndex
)

Accessor for a register based on index

Public function Const

const FRigVM...

 

operator[]

(
    const FRigVMOperand& InArg
)

Const accessor for a register based on an argument

Public function

FRigVMRegist...

 

operator[]

(
    const FRigVMOperand& InArg
)

Accessor for a register based on an argument

Public function Const

const FRigVM...

 

operator[]

(
    int32 InIndex
)

Const accessor for a register based on index

Public function

FRigVMRegist...

 

operator[]

(
    const FName& InName
)

Accessor for a register based on a a name. note: only works if SupportsNames() == true

Public function Const

const FRigVM...

 

operator[]

(
    const FName& InName
)

Const accessor for a register based on a a name. note: only works if SupportsNames() == true

Public function

FRigVMMemory...

 

operator=

(
    const FRigVMMemoryContainer& InOth...
)

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