Navigation
API > API/Plugins > API/Plugins/RigVM > API/Plugins/RigVM/RigVMCore
Inheritance Hierarchy
References
| Module | RigVM |
| Header | /Engine/Plugins/Runtime/RigVM/Source/RigVM/Public/RigVMCore/RigVM.h |
| Include | #include "RigVMCore/RigVM.h" |
Syntax
UCLASS&40;BlueprintType&41;
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. | |
| TObjectPtr< URigVMMemoryStorage > | DebugMemoryStorageObject | ||
| TArray< FRigVMPropertyPathDescription > | ExternalPropertyPathDescriptions | ||
| TArray< FRigVMPropertyPath > | ExternalPropertyPaths | ||
| TObjectPtr< URigVMMemoryStorage > | LiteralMemoryStorageObject | ||
| FCriticalSection | ResolveFunctionsMutex | ||
| TObjectPtr< URigVMMemoryStorage > | WorkMemoryStorageObject |
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. | |
| FRigVMParameter | AddParameter
(
ERigVMParameterType InType, |
||
| int32 | AddRigVMFunction
(
const FString& InFunctionName |
Add a function for execute instructions to this VM. | |
| int32 | AddRigVMFunction
(
UScriptStruct* InRigVMStruct, |
Add a function for execute instructions to this VM. | |
| bool | CanExecuteEntry
(
const FRigVMExtendedExecuteContext& Context, |
Returns false if an entry can not be executed | |
| void | ClearExternalVariables
(
FRigVMExtendedExecuteContext& Context |
Clears the external variables of the VM. | |
| void | ClearMemory () |
||
| 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 | Resets the container and clones the input VM | ||
| void | DeclareConstructClasses
(
TArray< FTopLevelAssetPath >& OutConstructClasses, |
||
| FString | DumpByteCodeAsText
(
const TArray< int32 >& InInstructionOrder, |
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 > | Returns the instructions as text, OperandFormatFunction is an optional argument that allows you to override how operands are displayed, for example, see SRigVMExecutionStackView::PopulateStackView | ||
| void | Empty
(
FRigVMExtendedExecuteContext& Context |
Resets the container and removes all memory | |
| ERigVMExecuteResult | Execute
(
FRigVMExtendedExecuteContext& Context, |
Executes the VM. | |
| bool | Execute
(
FRigVMExtendedExecuteContext& Context, |
Executes the VM. | |
| ERigVMExecuteResult | ExecuteBranch
(
FRigVMExtendedExecuteContext& Context, |
Executes a single branch on the VM. We assume that the memory is already set correctly at this point. | |
| int32 | Returns the index of an entry. | ||
| const FRigVMByteCode & | GetByteCode () |
||
| FRigVMByteCode & | GetByteCode () |
||
| URigVMMemoryStorage * | GetDebugMemory
(
bool bCreateIfNeeded |
The default debug watch memory. | |
| const TArray< FName > & | Returns a list of all valid entry names for this VM's bytecode. | ||
| 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 > | GetExternalVariables
(
const FRigVMExtendedExecuteContext& Context |
Returns the external variables of the VM with variable memory. | |
| 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
(
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
(
const FRigVMExtendedExecuteContext& Context, |
Returns the number of times an instruction has been hit. | |
| const TArray< int32 > | GetInstructionVisitOrder
(
const FRigVMExtendedExecuteContext& Context |
Returns the order of all instructions during the last run. | |
| URigVMMemoryStorage * | GetLiteralMemory
(
bool bCreateIfNeeded |
The default const literal memory. | |
| TArray< URigVMMemoryStorage * > | Returns all memory storages as an array | ||
| URigVMMemoryStorage * | GetMemoryByType
(
ERigVMMemoryType InMemoryType, |
Returns a memory storage by type. | |
| UClass * | GetNativizedClass
(
const TArray< FRigVMExternalVariableDef >& InExternalVariables |
Returns the VM's matching nativized class if it exists | |
| FString | GetOperandLabel
(
const FRigVMOperand& InOperand, |
FormatFunction is an optional argument that allows you to override how operands are displayed, for example, see SRigVMExecutionStackView::PopulateStackView. | |
| int32 | GetParameterArraySize
(
int32 InParameterIndex |
Retrieve the array size of the parameter. | |
| int32 | GetParameterArraySize
(
const FRigVMParameter& InParameter |
Retrieve the array size of the parameter. | |
| int32 | GetParameterArraySize
(
const FName& InParameterName |
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
(
int32 InParameterIndex, |
Retrieve the value of a parameter given its index. | |
| T | GetParameterValue
(
const FRigVMParameter& InParameter, |
Retrieve the value of a parameter. | |
| T | GetParameterValue
(
const FName& InParameterName, |
Retrieve the value of a parameter given its name. | |
| 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, |
||
| FString | GetRigVMFunctionName
(
int32 InFunctionIndex |
Returns the name of a function given its index. | |
| FRigVMStatistics | Returns the statistics information | ||
| uint32 | GetVMHash () |
Returns the cached VM hash | |
| URigVMMemoryStorage * | GetWorkMemory
(
bool bCreateIfNeeded |
The default mutable work memory. | |
| bool | Initialize
(
FRigVMExtendedExecuteContext& Context, |
Initializes all execute ops and their memory. | |
| void | |||
| void | InvalidateCachedMemory
(
FRigVMExtendedExecuteContext& Context |
||
| bool | IsContextValidForExecution
(
FRigVMExtendedExecuteContext& Context |
||
| bool | IsNativized () |
Returns true if this is a nativized VM | |
| void | |||
| void | Reset
(
bool IsIgnoringArchetypeRef |
Resets the container and maintains all memory | |
| bool | ResumeExecution
(
FRigVMExtendedExecuteContext& Context |
||
| void | |||
| const void | SetFirstEntryEventInEventQueue
(
FRigVMExtendedExecuteContext& Context, |
||
| void | SetInstructionIndex
(
FRigVMExtendedExecuteContext& Context, |
||
| void | SetParameterValue
(
int32 ParameterIndex, |
Set the value of a parameter given its index. | |
| void | SetParameterValue
(
const FName& InParameterName, |
Set the value of a parameter given its name. | |
| void | SetParameterValue
(
const FRigVMParameter& InParameter, |
Set the value of a parameter. | |
| 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 | SetupInstructionTracking
(
FRigVMExtendedExecuteContext& Context, |
||
| void | SetVMHash
(
uint32 InVMHash |
Stores the current VM hash. | |
| void | StartProfiling
(
FRigVMExtendedExecuteContext& Context |
||
| void | StopProfiling
(
FRigVMExtendedExecuteContext& Context |
||
| bool | WasInstructionVisitedDuringLastRun
(
const FRigVMExtendedExecuteContext& Context, |
Returns true if the given instruction has been visited during the last run. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | PostLoad () |
Do any object-specific cleanup required immediately after loading an object. | |
| void | Handles reading, writing, and reference collecting using FArchive. |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FEntryExecuteGuard | |||
| FExecutionHaltedEvent | |||
| FExecutionReachedExitEvent | Bindable event for external objects to be notified when the VM reaches an Exit Operation |
Deprecated Variables
| Type | Name | Description | |
|---|---|---|---|
| uint32 | NumExecutions_DEPRECATED |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| FRigVMOperand | AddExternalVariable
(
const FRigVMExternalVariable& InExternalVariable |
Please use AddExternalVariable with ExtendedExecuteContext parameter. | |
| bool | CanExecuteEntry
(
const FName& InEntryName, |
Please, use CanExecuteEntry with Context param | |
| void | Please, use ClearExternalVariables with Context param | ||
| void | Empty () |
Please, use Empty with Context param | |
| ERigVMExecuteResult | Execute
(
TArrayView< URigVMMemoryStorage* > Memory, |
Please, use Execute with Context param | |
| bool | Please, use Execute with Context param | ||
| ERigVMExecuteResult | ExecuteLazyBranch
(
const FRigVMBranchInfo& InBranchToRun |
Please, use ExecuteLazyBranch with Context param | |
| FExecutionHaltedEvent & | Please use ExecutionHalted in the ExtendedExecuteContext. | ||
| FExecutionReachedExitEvent & | Please use ExecutionReachedExit in the ExtendedExecuteContext. | ||
| FRigVMExtendedExecuteContext * | GetContext () |
Please, use an external Context in the RigVMHost. | |
| const FRigVMExtendedExecuteContext * | GetContext () |
Please, use an external Context in the RigVMHost. | |
| const UScriptStruct * | Please, use an external Context in the RigVMHost. | ||
| FRigVMExternalVariable | GetExternalVariableByName
(
const FName& InExternalVariableName |
Please use GetExternalVariableByName with ExtendedExecuteContext parameter. | |
| const TArray< FRigVMExternalVariable > | Please use GetExternalVariables with Context parameter. | ||
| const FRigVMBreakpoint & | Please use GetHaltedAtBreakpoint in the RigVMHost. | ||
| uint64 | GetInstructionCycles
(
int32 InIndex |
Please, use GetInstructionCycles with Context param | |
| double | GetInstructionMicroSeconds
(
int32 InIndex |
Please, use GetInstructionMicroSeconds with Context param | |
| int32 | GetInstructionVisitedCount
(
int32 InIndex |
Please, use GetInstructionVisitedCount with Context param | |
| const TArray< int32 > | Please, use GetInstructionVisitOrder with Context param | ||
| UClass * | GetNativizedClass
(
const TArray< FRigVMExternalVariable >& InExternalVariables |
Please, use GetNativizedClass with FRigVMExternalVariableDef array. | |
| uint32 | Please use GetNumExecutions() in the ExtendedExecuteContext. | ||
| const ExecuteContextType & | Please, use an external Context in the RigVMHost. | ||
| ExecuteContextType & | Please, use an external Context in the RigVMHost. | ||
| bool | Initialize
(
TArrayView< URigVMMemoryStorage* > Memory |
Please, use Initialize with Context param | |
| bool | Please, use ResumeExecution with Context param | ||
| bool | ResumeExecution
(
TArrayView< URigVMMemoryStorage* > Memory, |
Please, use ResumeExecution with Context param | |
| bool | ResumeExecution
(
FRigVMExtendedExecuteContext& Context, |
Please, use ResumeExecution with Context param | |
| void | SetBreakpointAction
(
const ERigVMBreakpointAction& Action |
Please use SetBreakpointAction in the RigVMHost. | |
| void | SetContextPublicDataStruct
(
UScriptStruct* InScriptStruct |
Please, use an external Context in the RigVMHost. | |
| void | SetDebugInfo
(
FRigVMDebugInfo* InDebugInfo |
Please use SetDebugInfo in the ExtendedExecuteContext. | |
| const void | SetFirstEntryEventInEventQueue
(
const FName& InFirstEventName |
Please, use SetFirstEntryEventInEventQueue with Context param | |
| void | SetRuntimeSettings
(
FRigVMRuntimeSettings InRuntimeSettings |
Please, use Context.SetRuntimeSettings | |
| bool | WasInstructionVisitedDuringLastRun
(
int32 InIndex |
Please, use WasInstructionVisitedDuringLastRun with Context param |