Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::IO::FullFileDecompressor Class Reference

#include <FullFileDecompressor.h>

Inherits AZ::IO::StreamStackEntry.

Public Member Functions

 FullFileDecompressor (u32 maxNumReads, u32 maxNumJobs, u32 alignment)
 
void PrepareRequest (FileRequest *request) override
 
void QueueRequest (FileRequest *request) override
 
bool ExecuteRequests () override
 
void UpdateStatus (Status &status) const override
 Gets a combined status update from all the nodes in the stack.
 
void UpdateCompletionEstimates (AZStd::chrono::steady_clock::time_point now, AZStd::vector< FileRequest * > &internalPending, StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd) override
 
void CollectStatistics (AZStd::vector< Statistic > &statistics) const override
 
- Public Member Functions inherited from AZ::IO::StreamStackEntry
 StreamStackEntry (AZStd::string &&name)
 
virtual const AZStd::stringGetName () const
 Returns the name that uniquely identifies this entry.
 
virtual void SetNext (AZStd::shared_ptr< StreamStackEntry > next)
 
virtual AZStd::shared_ptr< StreamStackEntryGetNext () const
 
virtual void SetContext (StreamerContext &context)
 
virtual void PrepareRequest (FileRequest *request)
 
virtual void QueueRequest (FileRequest *request)
 
virtual bool ExecuteRequests ()
 
virtual void UpdateStatus (Status &status) const
 Gets a combined status update from all the nodes in the stack.
 
virtual void UpdateCompletionEstimates (AZStd::chrono::steady_clock::time_point now, AZStd::vector< FileRequest * > &internalPending, StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd)
 
virtual void CollectStatistics (AZStd::vector< Statistic > &statistics) const
 

Additional Inherited Members

- Protected Attributes inherited from AZ::IO::StreamStackEntry
AZStd::string m_name
 The name that uniquely identifies this entry.
 
AZStd::shared_ptr< StreamStackEntrym_next
 The next entry in the stack.
 
StreamerContextm_context
 Context information for the entire streaming stack.
 

Detailed Description

Entry in the streaming stack that decompresses files from an archive that are stored as single files and without equally distributed seek points. Because the target archive has compressed the entire file, it needs to be decompressed completely, so even if the file is partially read, it needs to be fully loaded. This also means that there's no upper limit to the memory so every decompression job will need to allocate memory as a temporary buffer (in-place decompression is not supported). Finally, the lack of an upper limit also means that the duration of the decompression job can vary largely so a dedicated job system is used to decompress on to avoid blocking the main job system from working.

Member Function Documentation

◆ CollectStatistics()

void AZ::IO::FullFileDecompressor::CollectStatistics ( AZStd::vector< Statistic > &  statistics) const
overridevirtual

Collect various statistics on this stack entry. These are for profiling and debugging purposes only.

Reimplemented from AZ::IO::StreamStackEntry.

◆ ExecuteRequests()

bool AZ::IO::FullFileDecompressor::ExecuteRequests ( )
overridevirtual

Executes one or more queued requests. This is needed for synchronously executing requests, but asynchronous requests can already be running from the PrepareRequest call in which case this call is ignored.

Returns
True if a request was processed, otherwise false.

Reimplemented from AZ::IO::StreamStackEntry.

◆ PrepareRequest()

void AZ::IO::FullFileDecompressor::PrepareRequest ( FileRequest request)
overridevirtual

Prepare an external request for processing. This can include resolving file paths, create more specific internal requests, etc. The returned will be queued for further processing by QueueRequest and ExecuteRequest.

Reimplemented from AZ::IO::StreamStackEntry.

◆ QueueRequest()

void AZ::IO::FullFileDecompressor::QueueRequest ( FileRequest request)
overridevirtual

Queues a request to be executed at a later point when ExecuteRequests is called. This can include splitting up the request in more fine-grained steps.

Reimplemented from AZ::IO::StreamStackEntry.

◆ UpdateCompletionEstimates()

void AZ::IO::FullFileDecompressor::UpdateCompletionEstimates ( AZStd::chrono::steady_clock::time_point  now,
AZStd::vector< FileRequest * > &  internalPending,
StreamerContext::PreparedQueue::iterator  pendingBegin,
StreamerContext::PreparedQueue::iterator  pendingEnd 
)
overridevirtual

Updates the estimate of the time the requests will complete. This generally works by bubbling up the estimation and each stack entry adding it's additional overhead if any. When chaining this call, first call the next entry in the stack before adding the current entry's estimate.

Parameters
nowThe current time. This is captured once to avoid repeatedly querying the system clock.
internalPendingThe requests that are pending in the stream stack. These are always estimated as coming after the queued requests. Because this call will go from the top of the stack to the bottom, but estimation is calculated from the bottom to the top, this list should be processed in reverse order.
pendingBeginIterator pointing to the start of the requests that are waiting for a processing slot in the stack.
pendingEndIterator pointing to the end of the requests that are waiting for a processing slot in the stack.

Reimplemented from AZ::IO::StreamStackEntry.

◆ UpdateStatus()

void AZ::IO::FullFileDecompressor::UpdateStatus ( Status status) const
overridevirtual

Gets a combined status update from all the nodes in the stack.

Reimplemented from AZ::IO::StreamStackEntry.


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