UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ArchiveReferenceMarker.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "UObject/Object.h"
8
10{
11 None = 0,
12 SkipCompilingAssets = 1 // Skip serialization of assets still being compiled, some data might be missing.
13};
14
16
21{
22public:
24 {
26 ArIgnoreOuterRef = true;
28
29 for ( int32 ObjectIndex = 0; ObjectIndex < SourceObjects.Num(); ObjectIndex++ )
30 {
31 UObject* Object = SourceObjects[ObjectIndex];
33
34 // OBJECTMARK_TagImp is used to allow serialization of objects which we would otherwise ignore.
35 Object->Serialize(*this);
36 }
37
38 for ( int32 ObjectIndex = 0; ObjectIndex < SourceObjects.Num(); ObjectIndex++ )
39 {
40 UObject* Object = SourceObjects[ObjectIndex];
42 }
43 }
44
52 {
53 if (Object != NULL && !(Object->HasAnyMarks(OBJECTMARK_TagExp) || !IsValidChecked(Object) || Object->IsUnreachable()) )
54 {
56
57 const bool bIgnoreObject =
58 // No need to call Serialize from here for any objects that were part of our root set.
59 // By preventing re-entrant serialization using the OBJECTMARK_TagImp flag (instead of just marking each object in the root set with
60 // OBJECTMARK_TagExp prior to calling Serialize) we can determine which objects from our root set are being referenced
61 // by other objects in our root set.
62 Object->HasAnyMarks(OBJECTMARK_TagImp);
63
64 if ( bIgnoreObject == false )
65 {
66 Object->Serialize( *this );
67 }
68 }
69
70 return *this;
71 }
72};
#define NULL
Definition oodle2base.h:134
EArchiveReferenceMarkerFlags
Definition ArchiveReferenceMarker.h:10
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
bool IsValidChecked(const UObject *Test)
Definition Object.h:1886
@ OBJECTMARK_TagExp
Definition UObjectMarks.h:50
@ OBJECTMARK_TagImp
Definition UObjectMarks.h:49
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ArchiveReferenceMarker.h:21
FArchiveReferenceMarker(TArray< UObject * > &SourceObjects, EArchiveReferenceMarkerFlags InFlags=EArchiveReferenceMarkerFlags::None)
Definition ArchiveReferenceMarker.h:23
FArchive & operator<<(UObject *&Object)
Definition ArchiveReferenceMarker.h:51
Definition ArchiveUObject.h:17
Definition Archive.h:1208
virtual void Serialize(void *V, int64 Length)
Definition Archive.h:1689
uint8 ArIsObjectReferenceCollector
Definition Archive.h:915
uint8 ArIgnoreOuterRef
Definition Archive.h:903
void SetShouldSkipCompilingAssets(bool Enabled)
Definition Archive.h:310
Definition Array.h:670
UE_FORCEINLINE_HINT void Mark(EObjectMark Marks) const
Definition UObjectBaseUtility.h:131
UE_FORCEINLINE_HINT void UnMark(EObjectMark Marks) const
Definition UObjectBaseUtility.h:141
Definition Object.h:95