Navigation
API > API/Plugins > API/Plugins/RigVM > API/Plugins/RigVM/RigVMCore
Inheritance Hierarchy
- UObject
- URigVM
- URigVMNativized
References
| Module | RigVM |
| Header | /Engine/Plugins/Runtime/RigVM/Source/RigVM/Public/RigVMCore/RigVM.h |
| Include | #include "RigVMCore/RigVM.h" |
Syntax
UCLASS (BlueprintType)
class URigVM : public UObject
Remarks
The RigVM is the main object for evaluating FRigVMByteCode instructions. It combines the byte code, a list of required function pointers for execute instructions and required memory in one class.
Variables
| Type | Name | Description | |
|---|---|---|---|
| std::atomic< int32 > | ActiveExecutions | ||
| FRigVMByteCode * | ByteCodePtr | ||
| FRigVMByteCode | ByteCodeStorage | The byte code of the VM. | |
| FRigVMMemoryStorageStruct | DefaultDebugMemoryStorage | ||
| FRigVMMemoryStorageStruct | DefaultWorkMemoryStorage | ||
| TArray< FRigVMPropertyPathDescription > | ExternalPropertyPathDescriptions | ||
| TArray< FRigVMPropertyPath > | ExternalPropertyPaths | ||
| FRigVMMemoryStorageStruct | LiteralMemoryStorage | ||
| FCriticalSection | ResolveFunctionsMutex |
Constructors
| Type | Name | Description | |
|---|---|---|---|
URigVM () |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~URigVM () |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FRigVMOperand | AddExternalVariable
(
FRigVMExtendedExecuteContext& Context, |
Adds a new external / unowned variable to the VM. | |
| FRigVMOperand | AddExternalVariable
(
const FRigVMExternalVariable& InExternalVariable |
||
| FRigVMParameter | AddParameter
(
ERigVMParameterType InType, |
||
| FRigVMParameter | AddParameter
(
FRigVMExtendedExecuteContext& Context, |
||
| int32 | AddRigVMFunction
(
const FString& InFunctionName |
||
| int32 | AddRigVMFunction
(
UScriptStruct* InRigVMStruct, |
Add a function for execute instructions to this VM. | |
| bool | CanExecuteEntry
(
const FName& InEntryName, |
||
| bool | CanExecuteEntry
(
const FRigVMExtendedExecuteContext& Context, |
Returns false if an entry can not be executed | |
| void | |||
| void | ClearExternalVariables
(
FRigVMExtendedExecuteContext& Context |
Clears the external variables of the VM. | |
| void | ClearMemory () |
||
| void | ClearMemory
(
FRigVMExtendedExecuteContext& Context |
||
| void | |||
| uint32 | Generates a unique hash to compare VMs. | ||
| bool | ContainsEntry
(
const FName& InEntryName |
Returns true if this VM's bytecode contains a given entry. | |
| void | CopyDataForSerialization
(
URigVM* InVM |
||
| void | |||
| void | DeclareConstructClasses
(
TArray< FTopLevelAssetPath >& OutConstructClasses, |
||
| FString | DumpByteCodeAsText
(
FRigVMExtendedExecuteContext& Context, |
||
| FString | DumpByteCodeAsText
(
const TArray< int32 >& InInstructionOrder, |
||
| TArray< FString > | DumpByteCodeAsTextArray
(
FRigVMExtendedExecuteContext& Context, |
Returns the instructions as text, OperandFormatFunction is an optional argument that allows you to override how operands are displayed, for example, see SRigVMExecutionStackView::PopulateStackView | |
| TArray< FString > | |||
| void | Empty
(
FRigVMExtendedExecuteContext& Context |
Resets the container and removes all memory | |
| void | Empty () |
||
| ERigVMExecuteResult | Execute
(
FRigVMExtendedExecuteContext& Context, |
||
| ERigVMExecuteResult | Execute
(
TArrayView< URigVMMemoryStorage* > Memory, |
||
| bool | Execute
(
const FName& InEntryName |
||
| bool | Execute
(
FRigVMExtendedExecuteContext& Context, |
||
| ERigVMExecuteResult | ExecuteBranch
(
FRigVMExtendedExecuteContext& Context, |
Executes a single branch on the VM. We assume that the memory is already set correctly at this point. | |
| ERigVMExecuteResult | ExecuteLazyBranch
(
const FRigVMBranchInfo& InBranchToRun |
||
| ERigVMExecuteResult | ExecuteVM
(
FRigVMExtendedExecuteContext& Context, |
Executes the VM. You can optionally provide optional additional operands. | |
| FExecutionHaltedEvent & | |||
| FExecutionReachedExitEvent & | |||
| int32 | FindEntry
(
const FName& InEntryName |
Returns the index of an entry. | |
| void | GenerateDefaultMemoryType
(
ERigVMMemoryType InMemoryType, |
Used by the compiler and EngineTests to generate the default VM memory storages. | |
| void | GenerateMemoryType
(
FRigVMExtendedExecuteContext& Context, |
Generates the Default memory and copy it to the Context if required by the type of memory. | |
| int32 | |||
| const FRigVMByteCode & | GetByteCode () |
||
| FRigVMByteCode & | GetByteCode () |
||
| const FRigVMExtendedExecuteContext * | GetContext () |
||
| FRigVMExtendedExecuteContext * | GetContext () |
||
| const UScriptStruct * | |||
| URigVMMemoryStorage * | GetDebugMemory
(
bool bCreateIfNeeded |
||
| FRigVMMemoryStorageStruct * | GetDebugMemory
(
FRigVMExtendedExecuteContext& Context |
The instance debug watch memory. | |
| const FRigVMMemoryStorageStruct * | GetDebugMemory
(
const FRigVMExtendedExecuteContext& Context |
||
| const FRigVMMemoryStorageStruct & | The default non mutable reference debug memory (generated by the compiler and copied to the instances as initial state) | ||
| FRigVMMemoryStorageStruct & | |||
| const FRigVMMemoryStorageStruct & | The default non mutable reference literal memory (generated by the compiler and copied to the instances as initial state) | ||
| FRigVMMemoryStorageStruct & | |||
| FRigVMMemoryStorageStruct * | GetDefaultMemoryByType
(
ERigVMMemoryType InMemoryType |
||
| const FRigVMMemoryStorageStruct * | GetDefaultMemoryByType
(
ERigVMMemoryType InMemoryType |
Returns a default memory storage by type. | |
| const FRigVMMemoryStorageStruct & | The default non mutable reference work memory (generated by the compiler and copied to the instances as initial state) | ||
| FRigVMMemoryStorageStruct & | |||
| const TArray< FName > & | Returns a list of all valid entry names for this VM's bytecode. | ||
| FRigVMExternalVariable | GetExternalVariableByName
(
const FName& InExternalVariableName |
||
| FRigVMExternalVariable | GetExternalVariableByName
(
const FRigVMExtendedExecuteContext& Context, |
Returns an external variable given it's name. | |
| FRigVMExternalVariableDef | GetExternalVariableDefByName
(
const FName& InExternalVariableName |
Returns an external variable Def given it's name. | |
| const TArray< FRigVMExternalVariableDef > & | Returns the external variables of the VM (without variable memory, as it is stored in Context) | ||
| const TArray< FRigVMExternalVariable > | |||
| const TArray< FRigVMExternalVariable > | GetExternalVariables
(
const FRigVMExtendedExecuteContext& Context |
Returns the external variables of the VM with variable memory. | |
| TArray< const FRigVMFunction * > & | GetFunctions () |
||
| const TArray< const FRigVMFunction * > & | GetFunctions () |
||
| const FRigVMBreakpoint & | |||
| const URigVMHost * | GetHostCDO () |
||
| TArray< FRigVMMemoryStorageStruct * > | GetInstanceMemory
(
FRigVMExtendedExecuteContext& Context |
Returns the VM Literal memory and context instanced memory. | |
| uint64 | GetInstructionCycles
(
int32 InIndex |
||
| uint64 | GetInstructionCycles
(
const FRigVMExtendedExecuteContext& Context, |
Returns accumulated cycles spent in an instruction during the last run This requires bEnabledProfiling to be turned on in the runtime settings. | |
| double | GetInstructionMicroSeconds
(
int32 InIndex |
||
| double | GetInstructionMicroSeconds
(
const FRigVMExtendedExecuteContext& Context, |
Returns accumulated duration of the instruction in microseconds during the last run Note: this requires bEnabledProfiling to be turned on in the runtime settings. | |
| const FRigVMInstructionArray & | Returns the instructions of the VM. | ||
| int32 | GetInstructionVisitedCount
(
int32 InIndex |
||
| int32 | GetInstructionVisitedCount
(
const FRigVMExtendedExecuteContext& Context, |
Returns the number of times an instruction has been hit. | |
| const TArray< int32 > | |||
| const TArray< int32 > | GetInstructionVisitOrder
(
const FRigVMExtendedExecuteContext& Context |
Returns the order of all instructions during the last run. | |
| FRigVMMemoryStorageStruct * | The default const literal memory. | ||
| const FRigVMMemoryStorageStruct * | |||
| URigVMMemoryStorage * | GetLiteralMemory
(
bool bCreateIfNeeded |
||
| TArray< URigVMMemoryStorage * > | |||
| URigVMMemoryStorage * | GetMemoryByType
(
ERigVMMemoryType InMemoryType, |
||
| const FRigVMMemoryStorageStruct * | GetMemoryByType
(
const FRigVMExtendedExecuteContext& Context, |
||
| FRigVMMemoryStorageStruct * | GetMemoryByType
(
FRigVMExtendedExecuteContext& Context, |
Returns a memory storage by type. | |
| UClass * | GetNativizedClass
(
const TArray< FRigVMExternalVariable >& InExternalVariables |
||
| UClass * | GetNativizedClass
(
const TArray< FRigVMExternalVariableDef >& InExternalVariables |
Returns the VM's matching nativized class if it exists | |
| uint32 | |||
| FString | GetOperandLabel
(
const FRigVMOperand& InOperand, |
||
| FString | GetOperandLabel
(
FRigVMExtendedExecuteContext& Context, |
FormatFunction is an optional argument that allows you to override how operands are displayed, for example, see SRigVMExecutionStackView::PopulateStackView. | |
| int32 | GetParameterArraySize
(
const FRigVMParameter& InParameter |
||
| int32 | GetParameterArraySize
(
int32 InParameterIndex |
||
| int32 | GetParameterArraySize
(
const FName& InParameterName |
||
| int32 | GetParameterArraySize
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the array size of the parameter. | |
| int32 | GetParameterArraySize
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the array size of the parameter. | |
| int32 | GetParameterArraySize
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the array size of the parameter. | |
| FRigVMParameter | GetParameterByName
(
const FName& InParameterName |
Returns a parameter given it's name. | |
| const TArray< FRigVMParameter > & | Returns the parameters of the VM. | ||
| T | GetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the value of a parameter given its name. | |
| T | GetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the value of a parameter given its index. | |
| T | GetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Retrieve the value of a parameter. | |
| bool | GetParameterValueBool
(
const FName& InParameterName, |
||
| double | GetParameterValueDouble
(
const FName& InParameterName, |
||
| float | GetParameterValueFloat
(
const FName& InParameterName, |
||
| int32 | GetParameterValueInt
(
const FName& InParameterName, |
||
| FName | GetParameterValueName
(
const FName& InParameterName, |
||
| FQuat | GetParameterValueQuat
(
const FName& InParameterName, |
||
| FString | GetParameterValueString
(
const FName& InParameterName, |
||
| FTransform | GetParameterValueTransform
(
const FName& InParameterName, |
||
| FVector | GetParameterValueVector
(
const FName& InParameterName, |
||
| FVector2D | GetParameterValueVector2D
(
const FName& InParameterName, |
||
| const ExecuteContextType & | |||
| ExecuteContextType & | |||
| FString | GetRigVMFunctionName
(
int32 InFunctionIndex |
Returns the name of a function given its index. | |
| FRigVMStatistics | Returns the statistics information | ||
| TMap< int32, TArray< FRigVMTraitScope > > | GetTraits
(
FRigVMExtendedExecuteContext& InContext |
Returns the traits of a given type for this VM's bytecode and Context | |
| TMap< int32, TArray< FRigVMTraitScope > > | GetTraits
(
FRigVMExtendedExecuteContext& InContext, |
Returns the traits for this VM's bytecode and Context | |
| TMap< int32, TArray< FRigVMTraitScope > > | GetTraits
(
FRigVMExtendedExecuteContext& InContext, |
Returns the traits of a given type for this VM's bytecode and Context, as well as any additional memory handles | |
| TMap< int32, TArray< FRigVMTraitScope > > | GetTraits
(
FRigVMExtendedExecuteContext& InContext, |
Returns the traits for this VM's bytecode and Context, as well as any additional memory handles | |
| TArray< FRigVMTraitScope > | GetTraitsForInstruction
(
const FRigVMInstruction& InInstruction, |
Returns the traits of a given type for the provided memory for a single instruction | |
| TArray< FRigVMTraitScope > | GetTraitsForInstruction
(
const FRigVMInstruction& InInstruction, |
Returns the traits for the provided memory for a single instruction | |
| uint32 | GetVMHash () |
Returns the cached VM hash | |
| const FRigVMMemoryStorageStruct * | GetWorkMemory
(
const FRigVMExtendedExecuteContext& Context |
||
| FRigVMMemoryStorageStruct * | GetWorkMemory
(
FRigVMExtendedExecuteContext& Context |
The instance mutable work memory the VM will use to execute. | |
| URigVMMemoryStorage * | GetWorkMemory
(
bool bCreateIfNeeded |
||
| bool | Initialize
(
FRigVMExtendedExecuteContext& Context |
Prepares caches and memory for execution. | |
| bool | Initialize
(
FRigVMExtendedExecuteContext& Context, |
||
| bool | Initialize
(
TArrayView< URigVMMemoryStorage* > Memory |
||
| bool | InitializeInstance
(
FRigVMExtendedExecuteContext& Context, |
Initializes cached memory handles and optionally copies work memory from the CDO to the Context. | |
| void | |||
| void | InvalidateCachedMemory
(
FRigVMExtendedExecuteContext& Context |
||
| void | |||
| bool | IsContextValidForExecution
(
FRigVMExtendedExecuteContext& Context |
||
| bool | IsNativized () |
Returns true if this is a nativized VM | |
| void | Load
(
FArchive& Ar |
||
| void | PostLoad () |
||
| void | |||
| void | Reset
(
bool IsIgnoringArchetypeRef |
||
| void | Reset
(
FRigVMExtendedExecuteContext& Context |
Resets the container and maintains all memory | |
| void | |||
| bool | ResumeExecution
(
FRigVMExtendedExecuteContext& Context, |
||
| bool | ResumeExecution
(
TArrayView< URigVMMemoryStorage* > Memory, |
||
| bool | ResumeExecution
(
FRigVMExtendedExecuteContext& Context, |
||
| bool | ResumeExecution
(
FRigVMExtendedExecuteContext& Context |
||
| bool | |||
| void | Save
(
FArchive& Ar |
||
| void | Serialize
(
FArchive& Ar |
||
| void | SetBreakpointAction
(
const ERigVMBreakpointAction& Action |
||
| void | SetContextPublicDataStruct
(
UScriptStruct* InScriptStruct |
||
| void | SetDebugInfo
(
FRigVMDebugInfo* InDebugInfo |
||
| void | SetExternalVariableDefs
(
const TArray< FRigVMExternalVariable >& InExternalVariables |
Sets the external variables without the instance data. | |
| void | SetExternalVariablesInstanceData
(
FRigVMExtendedExecuteContext& Context, |
Sets the external variables instance data required for execution. | |
| void | SetInstructionIndex
(
FRigVMExtendedExecuteContext& Context, |
||
| void | SetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Set the value of a parameter given its index. | |
| void | SetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Set the value of a parameter. | |
| void | SetParameterValue
(
FRigVMExtendedExecuteContext& Context, |
Set the value of a parameter given its name. | |
| void | SetParameterValueBool
(
const FName& InParameterName, |
||
| void | SetParameterValueDouble
(
const FName& InParameterName, |
||
| void | SetParameterValueFloat
(
const FName& InParameterName, |
||
| void | SetParameterValueInt
(
const FName& InParameterName, |
||
| void | SetParameterValueName
(
const FName& InParameterName, |
||
| void | SetParameterValueQuat
(
const FName& InParameterName, |
||
| void | SetParameterValueString
(
const FName& InParameterName, |
||
| void | SetParameterValueTransform
(
const FName& InParameterName, |
||
| void | SetParameterValueVector
(
const FName& InParameterName, |
||
| void | SetParameterValueVector2D
(
const FName& InParameterName, |
||
| void | SetPropertyValueFromString
(
const FRigVMOperand& InOperand, |
||
| void | SetPropertyValueFromString
(
FRigVMExtendedExecuteContext& Context, |
||
| void | SetRuntimeSettings
(
FRigVMRuntimeSettings InRuntimeSettings |
Sets the max array size allowed by this VM | |
| void | SetupInstructionTracking
(
FRigVMExtendedExecuteContext& Context, |
||
| void | Stores the current VM hash. | ||
| void | StartProfiling
(
FRigVMExtendedExecuteContext& Context |
||
| void | StopProfiling
(
FRigVMExtendedExecuteContext& Context |
||
| bool | |||
| bool | WasInstructionVisitedDuringLastRun
(
int32 InIndex |
||
| bool | WasInstructionVisitedDuringLastRun
(
const FRigVMExtendedExecuteContext& Context, |
Returns true if the given instruction has been visited during the last run. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FEntryExecuteGuard | |||
| FExecutionHaltedEvent | |||
| FExecutionReachedExitEvent | Bindable event for external objects to be notified when the VM reaches an Exit Operation | ||
| FInstructionBracketGuard |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| TObjectPtr< URigVMMemoryStorage > | DebugMemoryStorageObject_DEPRECATED | Deprecated 5.4,. | |
| TObjectPtr< URigVMMemoryStorage > | LiteralMemoryStorageObject_DEPRECATED | Deprecated 5.4. | |
| uint32 | NumExecutions_DEPRECATED | ||
| TObjectPtr< URigVMMemoryStorage > | WorkMemoryStorageObject_DEPRECATED | Deprecated 5.4. |