UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
StructOpsTypeTraits.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
7
9template <class CPPSTRUCT>
11{
12 enum
13 {
14 WithZeroConstructor = false, // struct can be constructed as a valid object by filling its memory footprint with zeroes.
15 WithNoInitConstructor = false, // struct has a constructor which takes an EForceInit parameter which will force the constructor to perform initialization, where the default constructor performs 'uninitialization'.
16 WithNoDestructor = false, // struct will not have its destructor called when it is destroyed.
17 WithCopy = !TIsPODType<CPPSTRUCT>::Value, // struct can be copied via its copy assignment operator.
18 WithIdenticalViaEquality = false, // struct can be compared via its operator==. This should be mutually exclusive with WithIdentical.
19 WithIdentical = false, // struct can be compared via an Identical(const T* Other, uint32 PortFlags) function. This should be mutually exclusive with WithIdenticalViaEquality.
20 WithExportTextItem = false, // struct has an ExportTextItem function used to serialize its state into a string.
21 WithImportTextItem = false, // struct has an ImportTextItem function used to deserialize a string into an object of that class.
22 WithAddStructReferencedObjects = false, // struct has an AddStructReferencedObjects function which allows it to add references to the garbage collector.
23 WithSerializer = false, // struct has a Serialize function for serializing its state to an FArchive.
24 WithStructuredSerializer = false, // struct has a Serialize function for serializing its state to an FStructuredArchive.
25 WithPostSerialize = false, // struct has a PostSerialize function which is called after it is serialized
26 WithNetSerializer = false, // struct has a NetSerialize function for serializing its state to an FArchive used for network replication.
27 WithNetDeltaSerializer = false, // struct has a NetDeltaSerialize function for serializing differences in state from a previous NetSerialize operation.
28 WithSerializeFromMismatchedTag = false, // struct has a SerializeFromMismatchedTag function for converting from other property tags.
29 WithStructuredSerializeFromMismatchedTag = false, // struct has an FStructuredArchive-based SerializeFromMismatchedTag function for converting from other property tags.
30 WithPostScriptConstruct = false, // struct has a PostScriptConstruct func tion which is called after it is constructed in blueprints
31 WithNetSharedSerialization = false, // struct has a NetSerialize function that does not require the package map to serialize its state.
32 WithGetPreloadDependencies = false, // struct has a GetPreloadDependencies function to return all objects that will be Preload()ed when the struct is serialized at load time.
33 WithPureVirtual = false, // struct has PURE_VIRTUAL functions and cannot be constructed when CHECK_PUREVIRTUALS is true
34 WithFindInnerPropertyInstance = false, // struct has a FindInnerPropertyInstance function that can provide an FProperty and data pointer when given a property FName
35 WithCanEditChange = false, // struct has an editor-only CanEditChange function that can conditionally make child properties read-only in the details panel (same idea as UObject::CanEditChange)
36 WithClearOnFinishDestroy = false, // struct should be cleared during owner UObject's FinishDestroy. Clearing calls destructor and initializes again to default value. This is intended for structs which may need to access UObject pointer members during destruction. Referenced objects may already have their FinishDestroy() called. Clearing should ensure that no UObject pointer members are used during the final destruction.
37 WithVisitor = false, // struct has Visit function that allows to visit additional properties
38 WithIntrusiveOptionalSafeForGC = false, // struct with an intrusive unset state for TOptional certifies that object fields it contains are nulled in the unset state
39 };
40
41 static constexpr EPropertyObjectReferenceType WithSerializerObjectReferences = EPropertyObjectReferenceType::Conservative; // struct's Serialize method(s) may serialize object references of these types - default Conservative means unknown and object reference collector archives should serialize this struct
42};
43
44template<class CPPSTRUCT>
46{
47};
EPropertyObjectReferenceType
Definition ObjectMacros.h:533
Definition IsPODType.h:12
Definition StructOpsTypeTraits.h:11
@ WithNoInitConstructor
Definition StructOpsTypeTraits.h:15
@ WithStructuredSerializeFromMismatchedTag
Definition StructOpsTypeTraits.h:29
@ WithVisitor
Definition StructOpsTypeTraits.h:37
@ WithGetPreloadDependencies
Definition StructOpsTypeTraits.h:32
@ WithZeroConstructor
Definition StructOpsTypeTraits.h:14
@ WithAddStructReferencedObjects
Definition StructOpsTypeTraits.h:22
@ WithNetSharedSerialization
Definition StructOpsTypeTraits.h:31
@ WithIdenticalViaEquality
Definition StructOpsTypeTraits.h:18
@ WithNetSerializer
Definition StructOpsTypeTraits.h:26
@ WithNetDeltaSerializer
Definition StructOpsTypeTraits.h:27
@ WithFindInnerPropertyInstance
Definition StructOpsTypeTraits.h:34
@ WithPostScriptConstruct
Definition StructOpsTypeTraits.h:30
@ WithCopy
Definition StructOpsTypeTraits.h:17
@ WithClearOnFinishDestroy
Definition StructOpsTypeTraits.h:36
@ WithCanEditChange
Definition StructOpsTypeTraits.h:35
@ WithPureVirtual
Definition StructOpsTypeTraits.h:33
@ WithExportTextItem
Definition StructOpsTypeTraits.h:20
@ WithSerializer
Definition StructOpsTypeTraits.h:23
@ WithPostSerialize
Definition StructOpsTypeTraits.h:25
@ WithStructuredSerializer
Definition StructOpsTypeTraits.h:24
@ WithIntrusiveOptionalSafeForGC
Definition StructOpsTypeTraits.h:38
@ WithImportTextItem
Definition StructOpsTypeTraits.h:21
@ WithIdentical
Definition StructOpsTypeTraits.h:19
@ WithNoDestructor
Definition StructOpsTypeTraits.h:16
@ WithSerializeFromMismatchedTag
Definition StructOpsTypeTraits.h:28
static constexpr EPropertyObjectReferenceType WithSerializerObjectReferences
Definition StructOpsTypeTraits.h:41
Definition StructOpsTypeTraits.h:46