UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Net::TPolymorphicStructNetSerializerImpl< ExternalSourceType, ExternalSourceItemType, GetItem > Struct Template Reference

#include <PolymorphicNetSerializerImpl.h>

+ Inheritance diagram for UE::Net::TPolymorphicStructNetSerializerImpl< ExternalSourceType, ExternalSourceItemType, GetItem >:

Classes

struct  FQuantizedData
 
struct  FSourceItemTypeDeleter
 

Public Types

typedef ExternalSourceType SourceType
 
typedef FQuantizedData QuantizedType
 
typedef FPolymorphicStructNetSerializerConfig ConfigType
 

Static Public Member Functions

static void Serialize (FNetSerializationContext &, const FNetSerializeArgs &)
 
static void Deserialize (FNetSerializationContext &, const FNetDeserializeArgs &)
 
static void SerializeDelta (FNetSerializationContext &, const FNetSerializeDeltaArgs &)
 
static void DeserializeDelta (FNetSerializationContext &, const FNetDeserializeDeltaArgs &)
 
static void Quantize (FNetSerializationContext &, const FNetQuantizeArgs &)
 
static void Dequantize (FNetSerializationContext &, const FNetDequantizeArgs &)
 
static bool IsEqual (FNetSerializationContext &, const FNetIsEqualArgs &)
 
static bool Validate (FNetSerializationContext &, const FNetValidateArgs &)
 
static void CloneDynamicState (FNetSerializationContext &, const FNetCloneDynamicStateArgs &)
 
static void FreeDynamicState (FNetSerializationContext &, const FNetFreeDynamicStateArgs &)
 
static void CollectNetReferences (FNetSerializationContext &, const FNetCollectReferencesArgs &)
 

Static Public Attributes

static constexpr bool bHasDynamicState = true
 
static constexpr bool bIsForwardingSerializer = true
 
static constexpr bool bHasCustomNetReference = true
 

Protected Types

typedef TPolymorphicStructNetSerializerImpl< ExternalSourceType, ExternalSourceItemType, GetItem > ThisType
 
typedef ExternalSourceItemType SourceItemType
 
typedef FPolymorphicNetSerializerScriptStructCache::FTypeInfo FTypeInfo
 

Static Protected Member Functions

template<typename SerializerType >
static void InitTypeCache ()
 
- Static Protected Member Functions inherited from UE::Net::Private::FPolymorphicStructNetSerializerInternal
static IRISCORE_API voidAlloc (FNetSerializationContext &Context, SIZE_T Size, SIZE_T Alignment)
 
static IRISCORE_API void Free (FNetSerializationContext &Context, void *Ptr)
 
static IRISCORE_API void CollectReferences (FNetSerializationContext &Context, UE::Net::FNetReferenceCollector &Collector, const FNetSerializerChangeMaskParam &OuterChangeMaskInfo, const uint8 *RESTRICT SrcInternalBuffer, const FReplicationStateDescriptor *Descriptor)
 
static IRISCORE_API void CloneQuantizedState (FNetSerializationContext &Context, uint8 *RESTRICT DstInternalBuffer, const uint8 *RESTRICT SrcInternalBuffer, const FReplicationStateDescriptor *Descriptor)
 

Detailed Description

template<typename ExternalSourceType, typename ExternalSourceItemType, TSharedPtr< ExternalSourceItemType > &(*)(ExternalSourceType &) GetItem>
struct UE::Net::TPolymorphicStructNetSerializerImpl< ExternalSourceType, ExternalSourceItemType, GetItem >

TPolymorphicStructNetSerializerImpl

Helper to implement serializers that requires dynamic polymorphism. It can either be used to declare a typed serializer or be used as an internal helper. ExternalSourceType is the class/struct that has the TSharedPtr<ExternalSourceItemType> data. ExternalSourceItemType is the polymorphic struct type GetItem is a function that will return a reference to the TSharedPtr<ExternalSourceItemType>

!BIG DISCLAIMER:!

This serializer was written to mimic the behavior seen in FGameplayAbilityTargetDataHandle and FGameplayEffectContextHandle which both are written with the intent of being used for RPCs and not being used for replicated properties and uses a TSharedPointer to hold the polymorphic struct

That said, IF the serializer is used for replicated properties it has very specific requirements on the implementation of the SourceType to work correctly.

  1. The sourcetype MUST provide a custom assignment operator performing a deep-copy/clone
  2. The sourcetype MUST define a comparison operator that compares the instance data of the stored ExternalSourceItemType
  3. TStructOpsTypeTraits::WithCopy and TStructOpsTypeTraits::WithIdenticalViaEquality must be specified

Member Typedef Documentation

◆ ConfigType

◆ FTypeInfo

◆ QuantizedType

◆ SourceItemType

◆ SourceType

◆ ThisType

Member Function Documentation

◆ CloneDynamicState()

◆ CollectNetReferences()

◆ Dequantize()

◆ Deserialize()

◆ DeserializeDelta()

◆ FreeDynamicState()

◆ InitTypeCache()

◆ IsEqual()

◆ Quantize()

◆ Serialize()

◆ SerializeDelta()

◆ Validate()

Member Data Documentation

◆ bHasCustomNetReference

◆ bHasDynamicState

◆ bIsForwardingSerializer


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