FRigVMByteCode

The [FRigVMByteCode](API\Runtime\RigVM\RigVMCore\FRigVMByteCode) is a container to store a list of instructions with their corresponding data.

Choose your operating system:

Windows

macOS

Linux

References

Module

RigVM

Header

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

Include

#include "RigVMCore/RigVMByteCode.h"

Syntax

struct FRigVMByteCode

Remarks

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.

Constructors

Name Description

Public function

FRigVMByteCode()

Functions

Name Description

Public function

uint64

 

AddArrayAddOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InElementArg,
    FRigVMOperand InIndexArg
)

Adds an array add operator

Public function

uint64

 

AddArrayAppendOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InOtherArrayArg
)

Adds an array append operator

Public function

uint64

 

AddArrayCloneOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InClonedArrayArg
)

Adds an array clone operator

Public function

uint64

 

AddArrayDifferenceOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InOtherArrayArg,
    FRigVMOperand InResultArrayArg
)

Adds an array difference operator

Public function

uint64

 

AddArrayFindOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InElementArg,
    FRigVMOperand InIndexArg,
    FRigVMOperand InSuccessArg
)

Adds an array find operator

Public function

uint64

 

AddArrayGetAtIndexOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InIndexArg,
    FRigVMOperand InElementArg
)

Adds an array get at index operator

Public function

uint64

 

AddArrayGetNumOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InNumArg
)

Adds an array get num operator

Public function

uint64

 

AddArrayInsertOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InIndexArg,
    FRigVMOperand InElementArg
)

Adds an array insert operator

Public function

uint64

 

AddArrayIntersectionOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InOtherArrayArg,
    FRigVMOperand InResultArrayArg
)

Adds an array intersection operator

Public function

uint64

 

AddArrayIteratorOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InElementArg,
    FRigVMOperand InIndexArg,
    FRigVMOperand InCountArg,
    FRigVMOperand InRatioArg,
    FRigVMOperand InContinueArg
)

Adds an array iterator operator

Public function

uint64

 

AddArrayRemoveOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InIndexArg
)

Adds an array remove operator

Public function

uint64

 

AddArrayResetOp

(
    FRigVMOperand InArrayArg
)

Adds an array reset operator

Public function

uint64

 

AddArrayReverseOp

(
    FRigVMOperand InArrayArg
)

Adds an array reverse operator

Public function

uint64

 

AddArraySetAtIndexOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InIndexArg,
    FRigVMOperand InElementArg
)

Adds an array set at index operator

Public function

uint64

 

AddArraySetNumOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InNumArg
)

Adds an array set num operator

Public function

uint64

 

AddArrayUnionOp

(
    FRigVMOperand InArrayArg,
    FRigVMOperand InOtherArrayArg
)

Adds an array union operator

Public function

uint64

 

AddBeginBlockOp

(
    FRigVMOperand InCountArg,
    FRigVMOperand InIndexArg
)

Adds an operator to end the last memory slice

Public function

uint64

 

AddCopyOp

(
    const FRigVMOperand& InSource,
    const FRigVMOperand& InTarget
)

Adds a copy operator to copy the content of a source argument to a target argument

Public function

uint64

 

AddCopyOp

(
    const FRigVMCopyOp& InCopyOp
)

Adds a copy operator to copy the content of a source argument to a target argument

Public function

uint64

 

AddDecrementOp

(
    const FRigVMOperand& InArg
)

Adds an decrement operator to decrement a int32 argument

Public function

uint64

 

AddEndBlockOp()

Adds an operator to end the last memory slice

Public function

uint64

 

AddEqualsOp

(
    const FRigVMOperand& InA,
    const FRigVMOperand& InB,
    const FRigVMOperand& InResult
)

Adds an equals operator to store the comparison result of A and B into a Result argument

Public function

uint64

 

AddExecuteOp

(
    uint16 InFunctionIndex,
    const FRigVMOperandArray& InOperan...
)

Adds an execute operator given its function index operands

Public function

uint64

 

AddExitOp()

Adds an exit operator to exit the execution loop

Public function

uint64

 

AddFalseOp

(
    const FRigVMOperand& InArg
)

Adds a false operator to set a given argument to false

Public function

uint64

 

AddIncrementOp

(
    const FRigVMOperand& InArg
)

Adds an increment operator to increment a int32 argument

Public function

uint64

 

AddJumpIfOp

(
    ERigVMOpCode InOpCode,
    uint16 InInstructionIndex,
    const FRigVMOperand& InConditionAr...,
    bool bJumpWhenConditionIs
)

Adds an absolute, forward or backward jump operator based on a condition argument

Public function

uint64

 

AddJumpOp

(
    ERigVMOpCode InOpCode,
    uint16 InInstructionIndex
)

Adds an absolute, forward or backward jump operator

Public function

uint64

 

AddNotEqualsOp

(
    const FRigVMOperand& InA,
    const FRigVMOperand& InB,
    const FRigVMOperand& InResult
)

Adds an not-equals operator to store the comparison result of A and B into a Result argument

Public function

uint64

 

AddTrueOp

(
    const FRigVMOperand& InArg
)

Adds a true operator to set a given argument to true

Public function

uint64

 

AddZeroOp

(
    const FRigVMOperand& InArg
)

Adds a zero operator to zero the memory of a given argument

Public function Const

FString

 

DumpToText()

Public function

void

 

Empty()

Resets the container and removes all memory

Public function Const

int32

 

FindEntryIndex

(
    const FName& InEntryName
)

Returns the index of an entry given a name or INDEX_NONE

Public function Const

TArray< int3...

 

GetAllInstructionIndicesForCallPath

(
    const FString& InCallPath,
    bool bStartsWith,
    bool bEndsWith
)

Returns all found instruction indices for a given callpath

Public function Const

const TArray...

 

GetAllInstructionIndicesForCallstack

(
    const TArray< UObject* >& InC...
)

Returns all found instruction indices for a given callpath

Public function Const

const TArray...

 

GetAllInstructionIndicesForSubject

(
    UObject* InSubject
)

Returns all found instruction indices for a given subject

Public function Const

const TArray...

 

GetByteCode()

Returns the raw data of the byte code

Public function Const

FString

 

GetCallPathForInstruction

(
    int32 InInstructionIndex
)

Returns the callpath which was used to inject a given instruction

Public function Const

const TArray...

 

GetCallstackForInstruction

(
    int32 InInstructionIndex
)

Returns the callstack which was used to inject a given instruction

Public function Static

uint32

 

GetCallstackHash

(
    const TArrayView< UObject*cons...
)

Computes a hash for a given callstack

Public function Static

uint32

 

GetCallstackHash

(
    const TArray< UObject* >& InC...
)

Computes a hash for a given callstack

Public function Const

uint32

 

GetCallstackHashForInstruction

(
    int32 InInstructionIndex
)

Returns the callstack hash which was used to inject a given instruction

Public function Const

const FRigVM...

 

GetEntry

(
    int32 InEntryIndex
)

Returns the entry with a given index

Public function Const

int32

 

GetFirstInstructionIndexForCallPath

(
    const FString& InCallPath,
    bool bStartsWith,
    bool bEndsWith
)

Returns the first hit instruction index for a given callpath (or INDEX_NONE)

Public function Const

int32

 

GetFirstInstructionIndexForCallstack

(
    const TArray< UObject* >& InC...
)

Returns the first hit instruction index for a given callpath (or INDEX_NONE)

Public function Const

int32

 

GetFirstInstructionIndexForSubject

(
    UObject* InSubject
)

Returns the first hit instruction index for a given subject (or INDEX_NONE)

Public function

FRigVMOperan...

 

GetInputOperands

(
    int32 InInstructionIndex
)

Returns the input operands of a given instruction

Public function Const

FRigVMInstru...

 

GetInstructions()

Returns an instruction array for iterating over all operators

Public function Const

int32

 

GetNumInstructions()

Returns the number of instructions within this byte code

Public function Const

uint64

 

GetOpAlignment

(
    ERigVMOpCode InOpCode
)

Returns the alignment for an operator given its opcode

Public function Const

const OpType...

 

GetOpAt

(
    const FRigVMInstruction& InInstruc...
)

Returns an operator for a given instruction

Public function Const

const OpType...

 

GetOpAt

(
    uint64 InByteCodeIndex
)

Returns an operator at a given byte code index

Public function

OpType &

 

GetOpAt

(
    uint64 InByteCodeIndex
)

Returns an operator at a given byte code index

Public function

OpType &

 

GetOpAt

(
    const FRigVMInstruction& InInstruc...
)

Returns an operator for a given instruction

Public function Const

ERigVMOpCode

 

GetOpCodeAt

(
    uint64 InByteCodeIndex
)

Returns the opcode at a given byte index

Public function Const

uint64

 

GetOperandAlignment()

Returns the alignment for an operand

Public function Const

FRigVMOperan...

 

GetOperandsAt

(
    uint64 InByteCodeIndex,
    uint16 InArgumentCount
)

Returns a list of operands at a given byte code index

Public function Const

FRigVMOperan...

 

GetOperandsForExecuteOp

(
    const FRigVMInstruction& InInstruc...
)

Returns the operands for a given execute instruction

Public function Const

uint64

 

GetOpNumBytesAt

(
    uint64 InByteCodeIndex,
    bool bIncludeOperands
)

Returns the size of the operator in bytes at a given byte index

Public function

FRigVMOperan...

 

GetOutputOperands

(
    int32 InInstructionIndex
)

Returns the output operands of a given instruction

Public function Const

FRigVMByteCo...

 

GetStatistics()

Returns the statistics information

Public function Const

UObject *...

 

GetSubjectForInstruction

(
    int32 InInstructionIndex
)

Returns the subject which was used to inject a given instruction

Public function

void

 

Load

(
    FArchive& Ar
)

Public function Const

uint64

 

Num()

Returns the number of instructions in this container

Public function Const

uint64

 

NumEntries()

Returns the number of entries

Public function

void

 

Reset()

Resets the container and maintains all memory

Public function Const

void

 

Save

(
    FArchive& Ar
)

Public function

void

 

Serialize

(
    FArchive& Ar
)

Public function

void

 

SetOperandsForInstruction

(
    int32 InInstructionIndex,
    const FRigVMOperandArray& InputOpe...,
    const FRigVMOperandArray& OutputOp...
)

Operators

Name Description

Public function Const

const uint8 ...

 

operator[]

(
    int32 InIndex
)

Const accessor for a byte given its index

Constants

Name

Description

EmptyInstructionIndices