UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ContentBundleContainer.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3
4#include "CoreMinimal.h"
6
7#if WITH_EDITOR
8#include "Misc/TVariant.h"
9#endif
10
12class FContentBundle;
18
19/*
20* Stores the content bundles for a given world.
21* In Editor builds, the content bundles can be store as 2 different types:
22* 1. Editor and Non-Game Worlds:
23* - The content bundles are stored as FContentBundleEditor, which support editing of content bundles.
24* - They are stored in TSharedPtr to allow the UI to keep TWeakPtr.
25* 2. Editor and Game Worlds (PIE)
26* - The content bundles are stored as FContentBundles, which support injections of streaming objects and cells in a runtime hash.
27* - They are stored in TUniquePtr.
28*
29* A TVariant is use to express that behavior in editor builds. In Editor and Non-Game Worlds the variant will contain FContentBundleEditors. In Game-Worlds it will contain FContentBundles.
30*
31* In Non-Editor builds, the content bundles are always stored as FContentBundles.
32*/
34{
35public:
38
39 UWorld* GetInjectedWorld() const;
40
41 void Initialize();
42 void Deinitialize();
43
45
47
50
53
54#if WITH_EDITOR
57
60
61 bool UseEditorContentBundle() const;
62#endif
63
66
67private:
69
70 void RegisterContentBundleClientEvents();
71 void UnregisterContentBundleClientEvents();
72
73 void OnContentBundleClientRegistered(TSharedPtr<FContentBundleClient>& ContentBundleClient);
74 void OnContentBundleClientUnregistered(FContentBundleClient& ContentBundleClient);
75 void OnContentBundleClientContentInjectionRequested(FContentBundleClient& ContentBundleClient);
76 void OnContentBundleClientContentRemovalRequested(FContentBundleClient& ContentBundleClient);
77
79 void DeinitializeContentBundle(FContentBundleBase& ContentBundle);
80
81 void InitializeContentBundlesForegisteredClients();
82 void DeinitializeContentBundles();
83
86
87#if WITH_EDITOR
91#endif
92
94#if WITH_EDITOR
97#else
98 ContentBundleGameArray ContentBundles;
99#endif
100
101 UWorld* InjectedWorld;
102};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition ContentBundleBase.h:13
Definition ContentBundleClient.h:35
Definition ContentBundleContainer.h:34
const TArray< TUniquePtr< FContentBundle > > & GetGameContentBundles() const
Definition ContentBundleContainer.cpp:105
void ForEachContentBundle(TFunctionRef< void(FContentBundleBase *)> Func) const
Definition ContentBundleContainer.cpp:166
UWorld * GetInjectedWorld() const
Definition ContentBundleContainer.cpp:30
uint32 GetNumContentBundles() const
Definition ContentBundleContainer.cpp:93
void Initialize()
Definition ContentBundleContainer.cpp:35
void Deinitialize()
Definition ContentBundleContainer.cpp:65
~FContentBundleContainer()
Definition ContentBundleContainer.cpp:17
bool RemoveContentBundle(FContentBundleClient &ContentBundleClient)
Definition ContentBundleContainer.cpp:308
bool InjectContentBundle(FContentBundleClient &ContentBundleClient)
Definition ContentBundleContainer.cpp:281
void AddReferencedObjects(FReferenceCollector &Collector)
Definition ContentBundleContainer.cpp:88
void ForEachContentBundleBreakable(TFunctionRef< bool(FContentBundleBase *)> Func) const
Definition ContentBundleContainer.cpp:185
Definition ContentBundle.h:16
Definition UObjectGlobals.h:2492
Definition Array.h:670
Definition AssetRegistryState.h:50
Definition SharedPointer.h:692
Definition TVariant.h:48
Definition ContentBundleDescriptor.h:16
Definition World.h:918
Definition ContentBundleLog.cpp:15
Definition Guid.h:109