Navigation
API > API/Plugins > API/Plugins/RigVM
The FRigVMByteCode is a container to store a list of instructions with their corresponding data. The byte code is then used within a VM to execute. To iterate over the instructions within the byte code you can use GetInstructions() to retrieve a FRigVMInstructionArray.
| Name | FRigVMByteCode |
| Type | struct |
| Header File | /Engine/Plugins/Runtime/RigVM/Source/RigVM/Public/RigVMCore/RigVMByteCode.h |
| Include Path | #include "RigVMCore/RigVMByteCode.h" |
Syntax
USTRUCT ()
struct FRigVMByteCode
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FRigVMByteCode() |
RigVMCore/RigVMByteCode.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| EmptyInstructionIndices | TArray< int32 > | RigVMCore/RigVMByteCode.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bByteCodeIsAligned | bool | If this is set to true the stored bytecode is aligned / padded | RigVMCore/RigVMByteCode.h | |
| bHasPublicContextAssetPath | bool | If the serialization has loaded a PublicContextPathName, so we check on new versions and skip check on older. | RigVMCore/RigVMByteCode.h | |
| BranchInfoLookup | TMap< FRigVMBranchInfoKey, const FRigVMBranchInfo * > | RigVMCore/RigVMByteCode.h | ||
| BranchInfos | TArray< FRigVMBranchInfo > | A list of all lazily evaluation branches | RigVMCore/RigVMByteCode.h | |
| ByteCode | TArray< uint8 > | Memory for all instructions | RigVMCore/RigVMByteCode.h | |
| CallPathPerInstruction | TArray< FString > | RigVMCore/RigVMByteCode.h | ||
| CallPathToInstructions | TMap< FString, TArray< int32 > > | RigVMCore/RigVMByteCode.h | ||
| CallstackHashPerInstruction | TArray< uint32 > | RigVMCore/RigVMByteCode.h | ||
| CallstackHashToInstructions | TMap< uint32, TArray< int32 > > | RigVMCore/RigVMByteCode.h | ||
| CallstackPerInstruction | TArray< TArray< TWeakObjectPtr< UObject > > > | RigVMCore/RigVMByteCode.h | ||
| Entries | TArray< FRigVMByteCodeEntry > | A look up table from entry name to instruction index | RigVMCore/RigVMByteCode.h | |
| InputOperandsPerInstruction | TArray< TArray< FRigVMOperand > > | RigVMCore/RigVMByteCode.h | ||
| NumInstructions | int32 | Number of instructions stored here | RigVMCore/RigVMByteCode.h | |
| OutputOperandsPerInstruction | TArray< TArray< FRigVMOperand > > | RigVMCore/RigVMByteCode.h | ||
| PredicateBranches | TArray< FRigVMPredicateBranch > | A list of all predicate branches | RigVMCore/RigVMByteCode.h | |
| PublicContextAssetPath | FTopLevelAssetPath | RigVMCore/RigVMByteCode.h | ||
| SubjectPerInstruction | TArray< TWeakObjectPtr< UObject > > | RigVMCore/RigVMByteCode.h | ||
| SubjectToInstructions | TMap< TWeakObjectPtr< UObject >, TArray< int32 > > | RigVMCore/RigVMByteCode.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int32 AddBeginBlockOp
(
FRigVMOperand InCountArg, |
Adds an operator to end the last memory slice | RigVMCore/RigVMByteCode.h | |
int32 AddBranchInfo
(
const FName& InBranchLabel, |
RigVMCore/RigVMByteCode.h | ||
int32 AddBranchInfo
(
const FRigVMBranchInfo& InBranchInfo |
Adds information about a branch for an instruction's argument | RigVMCore/RigVMByteCode.h | |
int32 AddCopyOp
(
const FRigVMOperand& InSource, |
Adds a copy operator to copy the content of a source argument to a target argument | RigVMCore/RigVMByteCode.h | |
int32 AddCopyOp
(
const FRigVMCopyOp& InCopyOp |
Adds a copy operator to copy the content of a source argument to a target argument | RigVMCore/RigVMByteCode.h | |
int32 AddDecrementOp
(
const FRigVMOperand& InArg |
Adds an decrement operator to decrement a int32 argument | RigVMCore/RigVMByteCode.h | |
int32 AddEndBlockOp() |
Adds an operator to end the last memory slice | RigVMCore/RigVMByteCode.h | |
int32 AddEqualsOp
(
const FRigVMOperand& InA, |
Adds an equals operator to store the comparison result of A and B into a Result argument | RigVMCore/RigVMByteCode.h | |
int32 AddExecuteOp
(
int32 InFunctionIndex, |
Adds an execute operator given its function index operands | RigVMCore/RigVMByteCode.h | |
int32 AddExitOp() |
Adds an exit operator to exit the execution loop | RigVMCore/RigVMByteCode.h | |
int32 AddFalseOp
(
const FRigVMOperand& InArg |
Adds a false operator to set a given argument to false | RigVMCore/RigVMByteCode.h | |
int32 AddIncrementOp
(
const FRigVMOperand& InArg |
Adds an increment operator to increment a int32 argument | RigVMCore/RigVMByteCode.h | |
int32 AddInvokeEntryOp
(
const FName& InEntryName |
Adds an invoke entry operator | RigVMCore/RigVMByteCode.h | |
int32 AddJumpIfOp
(
ERigVMOpCode InOpCode, |
Adds an absolute, forward or backward jump operator based on a condition argument | RigVMCore/RigVMByteCode.h | |
int32 AddJumpOp
(
ERigVMOpCode InOpCode, |
Adds an absolute, forward or backward jump operator | RigVMCore/RigVMByteCode.h | |
int32 AddJumpToBranchOp
(
FRigVMOperand InBranchNameArg, |
Adds a jump to branch operator | RigVMCore/RigVMByteCode.h | |
int32 AddNotEqualsOp
(
const FRigVMOperand& InA, |
Adds an not-equals operator to store the comparison result of A and B into a Result argument | RigVMCore/RigVMByteCode.h | |
int32 AddPredicateBranch
(
const FRigVMPredicateBranch& InPredicateBranch |
Adds information about a predicate branch for an instruction | RigVMCore/RigVMByteCode.h | |
int32 AddRunInstructionsOp
(
FRigVMOperand InExecuteStateArg, |
Adds a run instructions op | RigVMCore/RigVMByteCode.h | |
int32 AddSetupTraitsOp
(
FRigVMOperand InTraitListArg |
Adds a setup traits op | RigVMCore/RigVMByteCode.h | |
int32 AddTrueOp
(
const FRigVMOperand& InArg |
Adds a true operator to set a given argument to true | RigVMCore/RigVMByteCode.h | |
int32 AddZeroOp
(
const FRigVMOperand& InArg |
Adds a zero operator to zero the memory of a given argument | RigVMCore/RigVMByteCode.h | |
FString DumpToText() |
RigVMCore/RigVMByteCode.h | ||
void Empty() |
Resets the container and removes all memory | RigVMCore/RigVMByteCode.h | |
int32 FindEntryIndex
(
const FName& InEntryName |
Returns the index of an entry given a name or INDEX_NONE | RigVMCore/RigVMByteCode.h | |
| Returns all found instruction indices for a given callpath | RigVMCore/RigVMByteCode.h | ||
const TArray< int32 > & GetAllInstructionIndicesForCallstack
(
const TArray< TWeakObjectPtr< UObject > >& InCallstack |
Returns all found instruction indices for a given callpath | RigVMCore/RigVMByteCode.h | |
| Returns all found instruction indices for a given subject | RigVMCore/RigVMByteCode.h | ||
TConstArrayView< uint8 > GetByteCode() |
Returns the raw data of the byte code | RigVMCore/RigVMByteCode.h | |
uint32 GetByteCodeHash() |
Returns a unique hash identifying this bytecode | RigVMCore/RigVMByteCode.h | |
FString GetCallPathForInstruction
(
int32 InInstructionIndex |
Returns the callpath which was used to inject a given instruction | RigVMCore/RigVMByteCode.h | |
const TArray< TWeakObjectPtr< UObject > > * GetCallstackForInstruction
(
int32 InInstructionIndex |
Returns the callstack which was used to inject a given instruction | RigVMCore/RigVMByteCode.h | |
uint32 GetCallstackHashForInstruction
(
int32 InInstructionIndex |
Returns the callstack hash which was used to inject a given instruction | RigVMCore/RigVMByteCode.h | |
const FRigVMByteCodeEntry & GetEntry
(
int32 InEntryIndex |
Returns the entry with a given index | RigVMCore/RigVMByteCode.h | |
int32 GetFirstInstructionIndexForCallPath
(
const FString& InCallPath, |
Returns the first hit instruction index for a given callpath (or INDEX_NONE) | RigVMCore/RigVMByteCode.h | |
int32 GetFirstInstructionIndexForCallstack
(
const TArray< TWeakObjectPtr< UObject > >& InCallstack |
Returns the first hit instruction index for a given callpath (or INDEX_NONE) | RigVMCore/RigVMByteCode.h | |
int32 GetFirstInstructionIndexForSubject
(
UObject* InSubject |
Returns the first hit instruction index for a given subject (or INDEX_NONE) | RigVMCore/RigVMByteCode.h | |
int32 GetFirstOperandByteIndex
(
const FRigVMInstruction& InInstruction |
Returns the byte index of the first operand for this instructions | RigVMCore/RigVMByteCode.h | |
FRigVMOperandArray GetInputOperands
(
int32 InInstructionIndex |
Returns the input operands of a given instruction | RigVMCore/RigVMByteCode.h | |
FRigVMInstructionArray GetInstructions() |
Returns an instruction array for iterating over all operators | RigVMCore/RigVMByteCode.h | |
TArray< int32 > GetInstructionsForInputOperand
(
const FRigVMOperand& InOperand |
Returns all instructions for a given input operand | RigVMCore/RigVMByteCode.h | |
TArray< int32 > GetInstructionsForOperand
(
const FRigVMOperand& InOperand |
Returns all instructions for a given operand | RigVMCore/RigVMByteCode.h | |
TArray< int32 > GetInstructionsForOutputOperand
(
const FRigVMOperand& InOperand |
Returns all instructions for a given output operand | RigVMCore/RigVMByteCode.h | |
int32 GetNumInstructions() |
Returns the number of instructions within this byte code | RigVMCore/RigVMByteCode.h | |
const OpType & GetOpAt
(
int32 InByteCodeIndex |
Returns an operator at a given byte code index | RigVMCore/RigVMByteCode.h | |
const OpType & GetOpAt
(
const FRigVMInstruction& InInstruction |
Returns an operator for a given instruction | RigVMCore/RigVMByteCode.h | |
OpType & GetOpAt
(
int32 InByteCodeIndex |
Returns an operator at a given byte code index | RigVMCore/RigVMByteCode.h | |
OpType & GetOpAt
(
const FRigVMInstruction& InInstruction |
Returns an operator for a given instruction | RigVMCore/RigVMByteCode.h | |
ERigVMOpCode GetOpCodeAt
(
int32 InByteCodeIndex |
Returns the opcode at a given byte index | RigVMCore/RigVMByteCode.h | |
FRigVMOperandArray GetOperandsAt
(
int32 InByteCodeIndex, |
Returns a list of operands at a given byte code index | RigVMCore/RigVMByteCode.h | |
FRigVMOperandArray GetOperandsForExecuteOp
(
const FRigVMInstruction& InInstruction |
Returns the operands for a given execute instruction | RigVMCore/RigVMByteCode.h | |
FRigVMOperandArray GetOperandsForOp
(
const FRigVMInstruction& InInstruction |
Returns all of the operands for a given instruction | RigVMCore/RigVMByteCode.h | |
uint32 GetOperatorHash
(
const FRigVMInstruction& InInstruction |
Returns a unique hash for an operator at a given instruction index | RigVMCore/RigVMByteCode.h | |
int32 GetOpNumBytesAt
(
int32 InByteCodeIndex, |
Returns the size of the operator in bytes at a given byte index | RigVMCore/RigVMByteCode.h | |
FRigVMOperandArray GetOutputOperands
(
int32 InInstructionIndex |
Returns the output operands of a given instruction | RigVMCore/RigVMByteCode.h | |
const FTopLevelAssetPath & GetPublicContextAssetPath() |
RigVMCore/RigVMByteCode.h | ||
FRigVMByteCodeStatistics GetStatistics() |
Returns the statistics information | RigVMCore/RigVMByteCode.h | |
UObject * GetSubjectForInstruction
(
int32 InInstructionIndex |
Returns the subject which was used to inject a given instruction | RigVMCore/RigVMByteCode.h | |
TMap< int32, TArray< FRigVMTraitScope > > GetTraits
(
FRigVMMemoryStorageStruct& InLiteralMemory, |
Returns the traits for the provided memory and any additional memory handles | RigVMCore/RigVMByteCode.h | |
TMap< int32, TArray< FRigVMTraitScope > > GetTraits
(
FRigVMMemoryStorageStruct& InLiteralMemory, |
Returns the traits of a given type for the provided memory | RigVMCore/RigVMByteCode.h | |
TMap< int32, TArray< FRigVMTraitScope > > GetTraits
(
FRigVMMemoryStorageStruct& InLiteralMemory, |
Returns the traits of a given type for the provided memory and any additional memorty handles | RigVMCore/RigVMByteCode.h | |
TMap< int32, TArray< FRigVMTraitScope > > GetTraits
(
FRigVMMemoryStorageStruct& InLiteralMemory, |
Returns the traits for the provided memory | RigVMCore/RigVMByteCode.h | |
TArray< FRigVMTraitScope > GetTraitsForInstruction
(
const FRigVMInstruction& InInstruction, |
Returns the traits of a given type for the provided memory for a single instruction | RigVMCore/RigVMByteCode.h | |
TArray< FRigVMTraitScope > GetTraitsForInstruction
(
const FRigVMInstruction& InInstruction, |
Returns the traits for the provided memory for a single instruction | RigVMCore/RigVMByteCode.h | |
TArray< FRigVMTraitScope > GetTraitsForInstruction
(
const FRigVMInstruction& InInstruction, |
Returns the traits of a given type for the provided memory for a single instruction and any additional memory handles | RigVMCore/RigVMByteCode.h | |
TArray< FRigVMTraitScope > GetTraitsForInstruction
(
const FRigVMInstruction& InInstruction, |
Returns the traits for the provided memory for a single instruction and any additional memory handles | RigVMCore/RigVMByteCode.h | |
bool HasPublicContextAssetPath() |
RigVMCore/RigVMByteCode.h | ||
int32 InlineFunction
(
const FRigVMByteCode* FunctionByteCode, |
Adds an execute operator given its function index operands | RigVMCore/RigVMByteCode.h | |
bool IsOperandShared
(
const FRigVMOperand& InOperand |
Returns true if the operator in question is used by multiple instructions | RigVMCore/RigVMByteCode.h | |
void Load
(
FArchive& Ar |
RigVMCore/RigVMByteCode.h | ||
int32 Num() |
Returns the number of instructions in this container | RigVMCore/RigVMByteCode.h | |
int32 NumEntries() |
Returns the number of entries | RigVMCore/RigVMByteCode.h | |
void Reset() |
Resets the container and maintains all memory | RigVMCore/RigVMByteCode.h | |
void Save
(
FArchive& Ar |
RigVMCore/RigVMByteCode.h | ||
void Serialize
(
FArchive& Ar |
RigVMCore/RigVMByteCode.h | ||
void SetOperandsForInstruction
(
const FRigVMInstruction& InInstruction, |
RigVMCore/RigVMByteCode.h | ||
void SetPublicContextAssetPath
(
const FTopLevelAssetPath& InPublicContextAssetPath |
RigVMCore/RigVMByteCode.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static uint32 GetCallstackHash
(
const TArrayView< TWeakObjectPtr< UObject > const >& InCallstack |
RigVMCore/RigVMByteCode.h | ||
static uint32 GetCallstackHash
(
const TArray< TWeakObjectPtr< UObject > >& InCallstack |
Computes a hash for a given callstack | RigVMCore/RigVMByteCode.h | |
static int32 GetOpAlignment
(
ERigVMOpCode InOpCode |
Returns the alignment for an operator given its opcode | RigVMCore/RigVMByteCode.h | |
static int32 GetOperandAlignment() |
Returns the alignment for an operand | RigVMCore/RigVMByteCode.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const uint8 & operator[]
(
int32 InIndex |
Const accessor for a byte given its index | RigVMCore/RigVMByteCode.h |