UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FBackgroundHttpManagerImpl Class Reference

#include <BackgroundHttpManagerImpl.h>

+ Inheritance diagram for FBackgroundHttpManagerImpl:

Public Member Functions

BACKGROUNDHTTP_API FBackgroundHttpManagerImpl ()
 
virtual BACKGROUNDHTTP_API ~FBackgroundHttpManagerImpl ()
 
virtual BACKGROUNDHTTP_API void AddRequest (const FBackgroundHttpRequestPtr Request) override
 
virtual BACKGROUNDHTTP_API void RemoveRequest (const FBackgroundHttpRequestPtr Request) override
 
virtual BACKGROUNDHTTP_API void Initialize () override
 
virtual BACKGROUNDHTTP_API void Shutdown () override
 
virtual BACKGROUNDHTTP_API void DeleteAllTemporaryFiles () override
 
virtual BACKGROUNDHTTP_API int GetMaxActiveDownloads () const override
 
virtual BACKGROUNDHTTP_API void SetMaxActiveDownloads (int MaxActiveDownloads) override
 
virtual BACKGROUNDHTTP_API FString GetTempFileLocationForURL (const FString &URL) override
 
virtual BACKGROUNDHTTP_API void CleanUpDataAfterCompletingRequest (const FBackgroundHttpRequestPtr Request) override
 
virtual void SetCellularPreference (int32 Value) override
 
virtual BACKGROUNDHTTP_API bool Tick (float DeltaTime) override
 
- Public Member Functions inherited from IBackgroundHttpManager
virtual ~IBackgroundHttpManager ()=default
 
virtual bool IsGenericImplementation () const =0
 
- Public Member Functions inherited from TSharedFromThis< IBackgroundHttpManager >
TSharedRef< IBackgroundHttpManager, Mode > AsShared ()
 
TSharedRef< IBackgroundHttpManager const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< IBackgroundHttpManager, Mode > AsWeak ()
 
TWeakPtr< IBackgroundHttpManager const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 
- Public Member Functions inherited from FTSTickerObjectBase
 UE_NONCOPYABLE (FTSTickerObjectBase)
 
CORE_API FTSTickerObjectBase (float InDelay=0.0f, FTSTicker &Ticker=FTSTicker::GetCoreTicker())
 
virtual CORE_API ~FTSTickerObjectBase ()
 

Protected Member Functions

virtual BACKGROUNDHTTP_API bool AssociateWithAnyExistingRequest (const FBackgroundHttpRequestPtr Request) override
 
virtual BACKGROUNDHTTP_API bool CheckForExistingCompletedDownload (const FBackgroundHttpRequestPtr Request, FString &ExistingFilePathOut, int64 &ExistingFileSizeOut)
 
virtual BACKGROUNDHTTP_API void ActivatePendingRequests ()
 
virtual BACKGROUNDHTTP_API void DeleteStaleTempFiles ()
 
virtual BACKGROUNDHTTP_API void GatherAllTempFilenames (TArray< FString > &OutAllTempFilenames, bool bOutputAsFullPaths=false) const
 
virtual BACKGROUNDHTTP_API void ConvertAllTempFilenamesToFullPaths (TArray< FString > &OutFilenamesAsFullPaths, const TArray< FString > &FilenamesToConvertToFullPaths) const
 
virtual BACKGROUNDHTTP_API void GatherTempFilesOlderThen (TArray< FString > &OutTimedOutTempFilenames, double SecondsToConsiderOld, TArray< FString > *OptionalFileList=nullptr) const
 
virtual BACKGROUNDHTTP_API void GatherTempFilesWithoutURLMappings (TArray< FString > &OutTempFilesMissingURLMappings, TArray< FString > *OptionalFileList=nullptr) const
 
virtual BackgroundHttpFileHashHelperRef GetFileHashHelper ()
 
virtual const BackgroundHttpFileHashHelperRef GetFileHashHelper () const
 
- Protected Member Functions inherited from TSharedFromThis< IBackgroundHttpManager >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 

Protected Attributes

TArray< FBackgroundHttpRequestPtrPendingStartRequests
 
FRWLock PendingRequestLock
 
TArray< FBackgroundHttpRequestPtrActiveRequests
 
FRWLock ActiveRequestLock
 
volatile int NumCurrentlyActiveRequests
 
TAtomic< int > MaxActiveDownloads
 

Additional Inherited Members

- Static Protected Member Functions inherited from TSharedFromThis< IBackgroundHttpManager >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

Contains implementation of some common functions that don't vary between implementation

Constructor & Destructor Documentation

◆ FBackgroundHttpManagerImpl()

FBackgroundHttpManagerImpl::FBackgroundHttpManagerImpl ( )

◆ ~FBackgroundHttpManagerImpl()

FBackgroundHttpManagerImpl::~FBackgroundHttpManagerImpl ( )
virtual

Member Function Documentation

◆ ActivatePendingRequests()

void FBackgroundHttpManagerImpl::ActivatePendingRequests ( )
protectedvirtual

◆ AddRequest()

void FBackgroundHttpManagerImpl::AddRequest ( const FBackgroundHttpRequestPtr  Request)
overridevirtual

Adds a Background Http request instance to the manager for tracking Manager should always have a list of requests currently being processed

Parameters
Request- the request object to add

Implements IBackgroundHttpManager.

Reimplemented in FApplePlatformBackgroundHttpManager.

◆ AssociateWithAnyExistingRequest()

bool FBackgroundHttpManagerImpl::AssociateWithAnyExistingRequest ( const FBackgroundHttpRequestPtr  Request)
overrideprotectedvirtual

Designed to be called internally by AddRequest to associate our incoming request with any previously completed background downloads (might have completed before this app launch, or carried over from a previous application launch and be running without any other information.

Parameters
Request- The request to check for any existing request matches on.
Returns
bool - true if we found an existing request and associated with it. false otherwise.

Implements IBackgroundHttpManager.

◆ CheckForExistingCompletedDownload()

bool FBackgroundHttpManagerImpl::CheckForExistingCompletedDownload ( const FBackgroundHttpRequestPtr  Request,
FString &  ExistingFilePathOut,
int64 ExistingFileSizeOut 
)
protectedvirtual

◆ CleanUpDataAfterCompletingRequest()

void FBackgroundHttpManagerImpl::CleanUpDataAfterCompletingRequest ( const FBackgroundHttpRequestPtr  Request)
overridevirtual

Function that cleans up any persistent data after we have completed a reqeust. Should really never be calling this outside of a BackgroundHTTP class

Implements IBackgroundHttpManager.

◆ ConvertAllTempFilenamesToFullPaths()

void FBackgroundHttpManagerImpl::ConvertAllTempFilenamesToFullPaths ( TArray< FString > &  OutFilenamesAsFullPaths,
const TArray< FString > &  FilenamesToConvertToFullPaths 
) const
protectedvirtual

◆ DeleteAllTemporaryFiles()

void FBackgroundHttpManagerImpl::DeleteAllTemporaryFiles ( )
overridevirtual

Function to remove all temporary files used by the system to store completed downloads. This should be called when there are no active background downloads that we care about to regain disk space from background downloads that may no longer be relevant (IE: downloads that were never moved after completion) but are still on disk.

Implements IBackgroundHttpManager.

◆ DeleteStaleTempFiles()

void FBackgroundHttpManagerImpl::DeleteStaleTempFiles ( )
protectedvirtual

◆ GatherAllTempFilenames()

void FBackgroundHttpManagerImpl::GatherAllTempFilenames ( TArray< FString > &  OutAllTempFilenames,
bool  bOutputAsFullPaths = false 
) const
protectedvirtual

◆ GatherTempFilesOlderThen()

void FBackgroundHttpManagerImpl::GatherTempFilesOlderThen ( TArray< FString > &  OutTimedOutTempFilenames,
double  SecondsToConsiderOld,
TArray< FString > *  OptionalFileList = nullptr 
) const
protectedvirtual

◆ GatherTempFilesWithoutURLMappings()

void FBackgroundHttpManagerImpl::GatherTempFilesWithoutURLMappings ( TArray< FString > &  OutTempFilesMissingURLMappings,
TArray< FString > *  OptionalFileList = nullptr 
) const
protectedvirtual

◆ GetFileHashHelper() [1/2]

virtual BackgroundHttpFileHashHelperRef FBackgroundHttpManagerImpl::GetFileHashHelper ( )
inlineprotectedvirtual

◆ GetFileHashHelper() [2/2]

virtual const BackgroundHttpFileHashHelperRef FBackgroundHttpManagerImpl::GetFileHashHelper ( ) const
inlineprotectedvirtual

◆ GetMaxActiveDownloads()

int FBackgroundHttpManagerImpl::GetMaxActiveDownloads ( ) const
overridevirtual

Function that returns how many active BackgroundHttpRequests we should have actively downloading at once.

Returns
int Number of downloads we should have active at once.

Implements IBackgroundHttpManager.

◆ GetTempFileLocationForURL()

FString FBackgroundHttpManagerImpl::GetTempFileLocationForURL ( const FString &  URL)
overridevirtual

Function that returns an FString fullpath where we would expect the given URL's temp file to be located

Implements IBackgroundHttpManager.

◆ Initialize()

void FBackgroundHttpManagerImpl::Initialize ( )
overridevirtual

Initialize

Implements IBackgroundHttpManager.

◆ RemoveRequest()

void FBackgroundHttpManagerImpl::RemoveRequest ( const FBackgroundHttpRequestPtr  Request)
overridevirtual

Removes a Background Http request instance from the manager Presumably it is done being processed

Parameters
Request- the request object to remove

Implements IBackgroundHttpManager.

Reimplemented in FApplePlatformBackgroundHttpManager.

◆ SetCellularPreference()

virtual void FBackgroundHttpManagerImpl::SetCellularPreference ( int32  Value)
inlineoverridevirtual

Setting cellular preference

Implements IBackgroundHttpManager.

Reimplemented in FApplePlatformBackgroundHttpManager.

◆ SetMaxActiveDownloads()

void FBackgroundHttpManagerImpl::SetMaxActiveDownloads ( int  MaxActiveDownloads)
overridevirtual

Function that sets how many active BackgroundHttpRequests we should have actively downloading at once.

Parameters
MaxActiveDownloadsthe maximum number of downloads that should be active at once

Implements IBackgroundHttpManager.

◆ Shutdown()

void FBackgroundHttpManagerImpl::Shutdown ( )
overridevirtual

Shutdown

Implements IBackgroundHttpManager.

◆ Tick()

bool FBackgroundHttpManagerImpl::Tick ( float  DeltaTime)
overridevirtual

Pure virtual that must be overloaded by the inheriting class.

Parameters
DeltaTimetime passed since the last call.
Returns
true if should continue ticking

Implements FTSTickerObjectBase.

Reimplemented in FApplePlatformBackgroundHttpManager.

Member Data Documentation

◆ ActiveRequestLock

FRWLock FBackgroundHttpManagerImpl::ActiveRequestLock
protected

◆ ActiveRequests

TArray<FBackgroundHttpRequestPtr> FBackgroundHttpManagerImpl::ActiveRequests
protected

List of Background Http requests that are actively being processed

◆ MaxActiveDownloads

TAtomic<int> FBackgroundHttpManagerImpl::MaxActiveDownloads
protected

◆ NumCurrentlyActiveRequests

volatile int FBackgroundHttpManagerImpl::NumCurrentlyActiveRequests
protected

Count of how many requests we have active

◆ PendingRequestLock

FRWLock FBackgroundHttpManagerImpl::PendingRequestLock
protected

◆ PendingStartRequests

TArray<FBackgroundHttpRequestPtr> FBackgroundHttpManagerImpl::PendingStartRequests
protected

List of Background Http requests that we have called AddRequest on, but have not yet started due to platform active download limits


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