UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FFastArraySerializer Struct Reference

#include <FastArraySerializer.h>

+ Inheritance diagram for FFastArraySerializer:

Classes

struct  CPostReplicatedReceiveFuncable
 
struct  FPostReplicatedReceiveParameters
 

Public Member Functions

NETCORE_API FFastArraySerializer ()
 
NETCORE_API ~FFastArraySerializer ()
 
void MarkItemDirty (FFastArraySerializerItem &Item)
 
void MarkArrayDirty ()
 
void IncrementArrayReplicationKey ()
 
void PreReplicatedRemove (const TArrayView< int32 > &RemovedIndices, int32 FinalSize)
 
void PostReplicatedAdd (const TArrayView< int32 > &AddedIndices, int32 FinalSize)
 
void PostReplicatedChange (const TArrayView< int32 > &ChangedIndices, int32 FinalSize)
 
template<typename Type , typename SerializerType >
bool ShouldWriteFastArrayItem (const Type &Item, const bool bIsWritingOnClient) const
 
void SetDeltaSerializationEnabled (const bool bEnabled)
 
const EFastArraySerializerDeltaFlags GetDeltaSerializationFlags () const
 

Static Public Member Functions

template<typename Type , typename SerializerType >
static bool FastArrayDeltaSerialize (TArray< Type > &Items, FNetDeltaSerializeInfo &Parms, SerializerType &ArraySerializer)
 
static const int32 GetMaxNumberOfAllowedChangesPerUpdate ()
 
static const int32 GetMaxNumberOfAllowedDeletionsPerUpdate ()
 

Public Attributes

TMap< int32, int32ItemMap
 
int32 IDCounter
 
int32 ArrayReplicationKey
 
TMap< int32, FFastArraySerializerGuidReferencesGuidReferencesMap
 
TMap< int32, FGuidReferencesMapGuidReferencesMap_StructDelta
 

Detailed Description

Base struct for wrapping the array used in Fast TArray Replication

Constructor & Destructor Documentation

◆ FFastArraySerializer()

FFastArraySerializer::FFastArraySerializer ( )

◆ ~FFastArraySerializer()

FFastArraySerializer::~FFastArraySerializer ( )
default

Member Function Documentation

◆ FastArrayDeltaSerialize()

template<typename Type , typename SerializerType >
bool FFastArraySerializer::FastArrayDeltaSerialize ( TArray< Type > &  Items,
FNetDeltaSerializeInfo Parms,
SerializerType &  ArraySerializer 
)
static

Performs "standard" delta serialization on the items in the FastArraySerializer. This method relies more on the INetSerializeCB interface and custom logic and sends all properties that aren't marked as SkipRep, regardless of whether or not they've changed. This will be less CPU intensive, but require more bandwidth.

Parameters
ItemsArray of items owned by ArraySerializer.
ParmsSet of parms that dictate what serialization will do / return.
ArraySerializerThe typed subclass of FFastArraySerializer that we're serializing.

The function that implements Fast TArray Replication

◆ GetDeltaSerializationFlags()

const EFastArraySerializerDeltaFlags FFastArraySerializer::GetDeltaSerializationFlags ( ) const
inline

◆ GetMaxNumberOfAllowedChangesPerUpdate()

static const int32 FFastArraySerializer::GetMaxNumberOfAllowedChangesPerUpdate ( )
inlinestatic

◆ GetMaxNumberOfAllowedDeletionsPerUpdate()

static const int32 FFastArraySerializer::GetMaxNumberOfAllowedDeletionsPerUpdate ( )
inlinestatic

◆ IncrementArrayReplicationKey()

void FFastArraySerializer::IncrementArrayReplicationKey ( )
inline

◆ MarkArrayDirty()

void FFastArraySerializer::MarkArrayDirty ( )
inline

This must be called if you just remove something from the array

◆ MarkItemDirty()

void FFastArraySerializer::MarkItemDirty ( FFastArraySerializerItem Item)
inline

This must be called if you add or change an item in the array

◆ PostReplicatedAdd()

void FFastArraySerializer::PostReplicatedAdd ( const TArrayView< int32 > &  AddedIndices,
int32  FinalSize 
)
inline

Called after adding all new elements and after the elements themselves are notified. The indices are valid for this function call only!

NOTE: intentionally not virtual; invoked via templated code,

See also
FExampleItemEntry

◆ PostReplicatedChange()

void FFastArraySerializer::PostReplicatedChange ( const TArrayView< int32 > &  ChangedIndices,
int32  FinalSize 
)
inline

Called after updating all existing elements with new data and after the elements themselves are notified. The indices are valid for this function call only!

NOTE: intentionally not virtual; invoked via templated code,

See also
FExampleItemEntry

◆ PreReplicatedRemove()

void FFastArraySerializer::PreReplicatedRemove ( const TArrayView< int32 > &  RemovedIndices,
int32  FinalSize 
)
inline

Called before removing elements and after the elements themselves are notified. The indices are valid for this function call only!

NOTE: intentionally not virtual; invoked via templated code,

See also
FExampleItemEntry

◆ SetDeltaSerializationEnabled()

void FFastArraySerializer::SetDeltaSerializationEnabled ( const bool  bEnabled)
inline

◆ ShouldWriteFastArrayItem()

template<typename Type , typename SerializerType >
bool FFastArraySerializer::ShouldWriteFastArrayItem ( const Type &  Item,
const bool  bIsWritingOnClient 
) const
inline

Helper function for FastArrayDeltaSerialize to consolidate the logic of whether to consider writing an item in a fast TArray during network serialization. For client replay recording, we don't want to write any items that have been added to the array predictively.

Member Data Documentation

◆ ArrayReplicationKey

int32 FFastArraySerializer::ArrayReplicationKey

Counter used to track array replication.

◆ GuidReferencesMap

TMap<int32, FFastArraySerializerGuidReferences> FFastArraySerializer::GuidReferencesMap

List of items that need to be re-serialized when the referenced objects are mapped

◆ GuidReferencesMap_StructDelta

TMap<int32, FGuidReferencesMap> FFastArraySerializer::GuidReferencesMap_StructDelta

List of items that need to be re-serialized when the referenced objects are mapped.

◆ IDCounter

int32 FFastArraySerializer::IDCounter

Counter used to assign IDs to new elements.

◆ ItemMap

TMap<int32, int32> FFastArraySerializer::ItemMap

Maps Element ReplicationID to Array Index.


The documentation for this struct was generated from the following files: