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

Public Types

using PreparedQueue = AZStd::deque< FileRequest * >
 

Public Member Functions

FileRequestPtr GetNewExternalRequest ()
 
void GetNewExternalRequestBatch (AZStd::vector< FileRequestPtr > &requests, size_t count)
 
size_t GetNumPreparedRequests () const
 
FileRequestPopPreparedRequest ()
 
void PushPreparedRequest (FileRequest *request)
 Adds a prepared request for later queuing and processing.
 
PreparedQueueGetPreparedRequests ()
 Gets the prepared requests that are queued to be processed.
 
const PreparedQueueGetPreparedRequests () const
 Gets the prepared requests that are queued to be processed.
 
void MarkRequestAsCompleted (FileRequest *request)
 
FileRequestRejectRequest (FileRequest *request)
 
void RecycleRequest (FileRequest *request)
 Adds an old request to the recycle bin so it can be reused later.
 
void RecycleRequest (ExternalFileRequest *request)
 Adds an old external request to the recycle bin so it can be reused later.
 
bool FinalizeCompletedRequests ()
 
void WakeUpSchedulingThread ()
 
void SuspendSchedulingThread ()
 If there's no pending messages this will cause the main thread for streamer to go to sleep.
 
AZ::Platform::StreamerContextThreadSyncGetStreamerThreadSynchronizer ()
 Returns the native primitive(s) used to suspend and wake up the scheduling thread and possibly other threads.
 
void CollectStatistics (AZStd::vector< Statistic > &statistics)
 

Member Function Documentation

◆ CollectStatistics()

void AZ::IO::StreamerContext::CollectStatistics ( AZStd::vector< Statistic > &  statistics)

Collects statistics recorded during processing. This will only return statistics for the context. Use the CollectStatistics on AZ::IO::Streamer to get all statistics.

◆ FinalizeCompletedRequests()

bool AZ::IO::StreamerContext::FinalizeCompletedRequests ( )

Does the FinalizeRequest callback where appropriate and does some bookkeeping to finalize requests.

Returns
True if any requests were finalized, otherwise false.

◆ GetNewExternalRequest()

FileRequestPtr AZ::IO::StreamerContext::GetNewExternalRequest ( )

Gets a new file request, either by creating a new instance or picking one from the recycle bin. This version is for use by any system outside the stream stack and is thread safe. Once the reference count in the request hits zero it will automatically be recycled.

◆ GetNewExternalRequestBatch()

void AZ::IO::StreamerContext::GetNewExternalRequestBatch ( AZStd::vector< FileRequestPtr > &  requests,
size_t  count 
)

Gets a batch of new file requests, either by creating new instances or picking from the recycle bin. This version is for use by any system outside the stream stack and is thread safe. The owner needs to manually recycle these requests once they're done. Requests with a reference count of zero will automatically be recycled. If multiple requests need to be create this is preferable as it only locks the recycle bin once.

◆ GetNumPreparedRequests()

size_t AZ::IO::StreamerContext::GetNumPreparedRequests ( ) const

Gets the number of prepared requests. Prepared requests are requests that are ready to be queued up for further processing.

◆ MarkRequestAsCompleted()

void AZ::IO::StreamerContext::MarkRequestAsCompleted ( FileRequest request)

Marks a request as completed so the main thread in Streamer can close it out. This can be safely called from multiple threads.

◆ PopPreparedRequest()

FileRequest * AZ::IO::StreamerContext::PopPreparedRequest ( )

Gets the next prepared request that should be queued. Prepared requests are requests that are ready to be queued up for further processing.

◆ RejectRequest()

FileRequest * AZ::IO::StreamerContext::RejectRequest ( FileRequest request)

Rejects a request by removing it from the chain and recycling it. Only requests without children can be rejected. If the rejected request has a parent it might need to be processed further.

Parameters
requestThe request to remove and recycle.
Returns
The parent request of the rejected request or null if there was no parent.

◆ WakeUpSchedulingThread()

void AZ::IO::StreamerContext::WakeUpSchedulingThread ( )

Causes the main thread for streamer to wake up and process any pending requests. If the thread is already awake, nothing happens.


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