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::StreamStackEntry Class Reference

#include <StreamStackEntry.h>

Inherited by AZ::IO::BlockCache, AZ::IO::DedicatedCache, AZ::IO::FullFileDecompressor, AZ::IO::ReadSplitter, AZ::IO::StorageDrive, and AZ::IO::StorageDriveWin.

Classes

struct  Status
 

Public Member Functions

 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
 

Protected Attributes

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

The StreamStack is a stack of elements that serve a specific file IO function such collecting information from a file, cache read data, decompressing data, etc. The basic functionality tries perform its task and if it fails pass the request to the next entry in the stack. For instance if a request isn't cached it passes the request to the next entry which might read it from disk instead.

Member Function Documentation

◆ CollectStatistics()

virtual void AZ::IO::StreamStackEntry::CollectStatistics ( AZStd::vector< Statistic > &  statistics) const
virtual

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

Reimplemented in AZ::IO::BlockCache, AZ::IO::DedicatedCache, AZ::IO::FullFileDecompressor, AZ::IO::ReadSplitter, AZ::IO::StorageDrive, and AZ::IO::StorageDriveWin.

◆ ExecuteRequests()

virtual bool AZ::IO::StreamStackEntry::ExecuteRequests ( )
virtual

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 in AZ::IO::BlockCache, AZ::IO::DedicatedCache, AZ::IO::FullFileDecompressor, AZ::IO::StorageDrive, and AZ::IO::StorageDriveWin.

◆ GetNext()

virtual AZStd::shared_ptr< StreamStackEntry > AZ::IO::StreamStackEntry::GetNext ( ) const
virtual

Returns the next entry in the stack that handles a request if this request can't handle the request, or null if there are no more entries.

◆ PrepareRequest()

virtual void AZ::IO::StreamStackEntry::PrepareRequest ( FileRequest request)
virtual

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 in AZ::IO::DedicatedCache, AZ::IO::FullFileDecompressor, AZ::IO::StorageDrive, and AZ::IO::StorageDriveWin.

◆ QueueRequest()

virtual void AZ::IO::StreamStackEntry::QueueRequest ( FileRequest request)
virtual

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 in AZ::IO::BlockCache, AZ::IO::DedicatedCache, AZ::IO::FullFileDecompressor, AZ::IO::ReadSplitter, AZ::IO::StorageDrive, and AZ::IO::StorageDriveWin.

◆ SetNext()

virtual void AZ::IO::StreamStackEntry::SetNext ( AZStd::shared_ptr< StreamStackEntry next)
virtual

Set the next entry in the stack or reset it by using a nullptr. If the next entry has already been set, this will overwrite it.

Reimplemented in AZ::IO::DedicatedCache, and AZ::IO::StorageDrive.

◆ UpdateCompletionEstimates()

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

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 in AZ::IO::BlockCache, AZ::IO::DedicatedCache, AZ::IO::FullFileDecompressor, AZ::IO::StorageDrive, and AZ::IO::StorageDriveWin.

◆ UpdateStatus()

virtual void AZ::IO::StreamStackEntry::UpdateStatus ( Status status) const
virtual

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

Reimplemented in AZ::IO::BlockCache, AZ::IO::DedicatedCache, AZ::IO::FullFileDecompressor, AZ::IO::ReadSplitter, AZ::IO::StorageDrive, and AZ::IO::StorageDriveWin.


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