FTransaction

Base class for tracking transactions for undo/redo.

Windows
MacOS
Linux

Inheritance Hierarchy

ITransaction

FTransaction

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Classes/Editor/Transactor.h

Include

#include "Editor/Transactor.h"

Syntax

class FTransaction : public ITransaction

Remarks

Base class for tracking transactions for undo/redo. A single transaction, representing a set of serialized, undo-able changes to a set of objects.

warning: The undo buffer cannot be made persistent because of its dependence on offsets of arrays from their owning UObjects.

warning: UObject::Serialize implicitly assumes that class properties do not change in between transaction resets.

Variables

Name Description

Protected variable

bool

 

bFlip

If true, on apply flip the direction of iteration over object records.

Protected variable

TMap< UObject &...

 

ChangedObjects

Objects that will be changed directly by the transaction, empty when not transacting

Protected variable

FString

 

Context

A text string describing the context for the transaction.

Protected variable

FGuid

 

Id

Unique identifier for this transaction, used to track it during its lifetime

Protected variable

int32

 

Inc

Used to track direction to iterate over transaction's object records.

Protected variable

TMap< UObject &...

 

ObjectMap

Used to prevent objects from being serialized to a transaction more than once.

Protected variable

FGuid

 

OperationId

Unique identifier for the active operation on this transaction (if any).

Protected variable

UObject *

 

PrimaryObject

The key object being edited in this transaction. For example the blueprint object. Can be NULL

Protected variable

TIndirectArray<...

 

Records

Transaction variables.

Protected variable

FText

 

Title

Description of the transaction. Can be used by UI

Constructors

Name Description

Public function

FTransaction

(
    const TCHAR* InContext,
    const FText& InTitle,
    bool bInFlip
)

Constructor.

Destructors

Name Description

Public function Virtual

~FTransaction()

Functions

Name Description

Public function

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Used by GC to collect referenced objects.

Public function Const

SIZE_T

 

DataSize()

Public function Const

void

 

DumpObjectMap

(
    FOutputDevice& Ar
)

Outputs the contents of the ObjectMap to the specified output device.

Public function Const

FTransaction...

 

GenerateDiff()

Create a map that holds information about objects of a given transaction.

Public function Const

FGuid

 

GetId()

Returns the unique identifier for this transaction, used to track it during its lifetime

Public function Const

FGuid

 

GetOperationId()

Returns the unique identifier for the active operation on this transaction (if any)

Public function Const

const UObjec...

 

GetPrimaryObject()

Public function Const

int32

 

GetRecordCount()

Public function Const

FText

 

GetTitle()

Returns the descriptive text for the transaction

Public function Const

void

 

GetTransactionObjects

(
    TArray< UObject* >& Objects
)

Get all the objects that are part of this transaction.

Public function Virtual Const

const TCHAR ...

 

GetTransactionType()

Returns a unique string to serve as a type ID for the FTranscationBase-derived type.

Public function Virtual Const

bool

 

HasExpired()

Public function Const

bool

 

IsObjectTransacting

(
    const UObject* Object
)

Checks if a specific object is in the transaction currently underway

Public function

void

 

RemoveRecords

(
    int32 Count
)

Overridden from ITransaction

Name Description

Public function Virtual

void

 

Apply()

Enacts the transaction.

Public function Virtual

void

 

BeginOperation()

BeginOperation should be called when a transaction or undo/redo starts

Public function Virtual Const

bool

 

ContainsPieObjects()

Public function Virtual

void

 

EndOperation()

EndOperation should be called when a transaction is finalized or canceled or undo/redo ends

Public function Virtual

void

 

Finalize()

Finalize the transaction (try and work out what's changed).

Public function Virtual Const

FTransaction...

 

GetContext()

Gets the full context for the transaction.

Public function Virtual Const

bool

 

IsTransient()

Report if a transaction should be put in the undo buffer.

Public function Virtual

void

 

SaveArray

(
    UObject* Object,
    FScriptArray* Array,
    int32 Index,
    int32 Count,
    int32 Oper,
    int32 ElementSize,
    STRUCT_DC DefaultConstructor,
    STRUCT_AR Serializer,
    STRUCT_DTOR Destructor
)

Saves an array to the transaction.

Public function Virtual

void

 

SaveObject

(
    UObject* Object
)

Saves an UObject to the transaction.

Public function Virtual

void

 

SetPrimaryObject

(
    UObject* Object
)

Sets the transaction's primary object.

Public function Virtual

void

 

SnapshotObject

(
    UObject* Object,
    TArrayView< const FProperty* >...
)

Snapshots a UObject within the transaction.

Public function Virtual

void

 

StoreUndo

(
    UObject* Object,
    TUniquePtr< FChange > CustomChange
)

Stores a command that can be used to undo a change to the specified object.

Classes

Name

Description

Protected struct

FChangedObjectValue

Protected class

FObjectRecord

Record of an object.

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