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::IStreamer Class Referenceabstract

#include <IStreamer.h>

Inherited by AZ::IO::Streamer.

Public Types

using OnCompleteCallback = AZStd::function< void(FileRequestHandle)>
 

Public Member Functions

 AZ_RTTI (IStreamer, "{0015594D-6EA5-4309-A2AD-1D704F264A66}")
 
virtual FileRequestPtr Read (AZStd::string_view relativePath, void *outputBuffer, size_t outputBufferSize, size_t readSize, IStreamerTypes::Deadline deadline=IStreamerTypes::s_noDeadline, IStreamerTypes::Priority priority=IStreamerTypes::s_priorityMedium, size_t offset=0)=0
 
virtual FileRequestPtrRead (FileRequestPtr &request, AZStd::string_view relativePath, void *outputBuffer, size_t outputBufferSize, size_t readSize, IStreamerTypes::Deadline deadline=IStreamerTypes::s_noDeadline, IStreamerTypes::Priority priority=IStreamerTypes::s_priorityMedium, size_t offset=0)=0
 
virtual FileRequestPtr Read (AZStd::string_view relativePath, IStreamerTypes::RequestMemoryAllocator &allocator, size_t size, IStreamerTypes::Deadline deadline=IStreamerTypes::s_noDeadline, IStreamerTypes::Priority priority=IStreamerTypes::s_priorityMedium, size_t offset=0)=0
 
virtual FileRequestPtrRead (FileRequestPtr &request, AZStd::string_view relativePath, IStreamerTypes::RequestMemoryAllocator &allocator, size_t size, IStreamerTypes::Deadline deadline=IStreamerTypes::s_noDeadline, IStreamerTypes::Priority priority=IStreamerTypes::s_priorityMedium, size_t offset=0)=0
 
virtual FileRequestPtr Cancel (FileRequestPtr target)=0
 
virtual FileRequestPtrCancel (FileRequestPtr &request, FileRequestPtr target)=0
 
virtual FileRequestPtr RescheduleRequest (FileRequestPtr target, IStreamerTypes::Deadline newDeadline, IStreamerTypes::Priority newPriority)=0
 
virtual FileRequestPtrRescheduleRequest (FileRequestPtr &request, FileRequestPtr target, IStreamerTypes::Deadline newDeadline, IStreamerTypes::Priority newPriority)=0
 
virtual FileRequestPtr CreateDedicatedCache (AZStd::string_view relativePath)=0
 
virtual FileRequestPtrCreateDedicatedCache (FileRequestPtr &request, AZStd::string_view relativePath)=0
 
virtual FileRequestPtr DestroyDedicatedCache (AZStd::string_view relativePath)=0
 
virtual FileRequestPtrDestroyDedicatedCache (FileRequestPtr &request, AZStd::string_view relativePath)=0
 
virtual FileRequestPtr FlushCache (AZStd::string_view relativePath)=0
 
virtual FileRequestPtrFlushCache (FileRequestPtr &request, AZStd::string_view relativePath)=0
 
virtual FileRequestPtr FlushCaches ()=0
 
virtual FileRequestPtrFlushCaches (FileRequestPtr &request)=0
 
virtual FileRequestPtr Report (AZStd::vector< Statistic > &output, IStreamerTypes::ReportType reportType)=0
 
virtual FileRequestPtrReport (FileRequestPtr &request, AZStd::vector< Statistic > &output, IStreamerTypes::ReportType reportType)=0
 
virtual FileRequestPtr Custom (AZStd::any data)=0
 
virtual FileRequestPtrCustom (FileRequestPtr &request, AZStd::any data)=0
 
virtual FileRequestPtrSetRequestCompleteCallback (FileRequestPtr &request, OnCompleteCallback callback)=0
 
virtual FileRequestPtr CreateRequest ()=0
 
virtual void CreateRequestBatch (AZStd::vector< FileRequestPtr > &requests, size_t count)=0
 
virtual void QueueRequest (const FileRequestPtr &request)=0
 
virtual void QueueRequestBatch (const AZStd::vector< FileRequestPtr > &requests)=0
 
virtual void QueueRequestBatch (AZStd::vector< FileRequestPtr > &&requests)=0
 
virtual bool HasRequestCompleted (FileRequestHandle request) const =0
 
virtual IStreamerTypes::RequestStatus GetRequestStatus (FileRequestHandle request) const =0
 
virtual AZStd::chrono::steady_clock::time_point GetEstimatedRequestCompletionTime (FileRequestHandle request) const =0
 
virtual bool GetReadRequestResult (FileRequestHandle request, void *&buffer, u64 &numBytesRead, IStreamerTypes::ClaimMemory claimMemory=IStreamerTypes::ClaimMemory::No) const =0
 
virtual void CollectStatistics (AZStd::vector< Statistic > &statistics)=0
 
virtual const IStreamerTypes::RecommendationsGetRecommendations () const =0
 
virtual void SuspendProcessing ()=0
 
virtual void ResumeProcessing ()=0
 
virtual bool IsSuspended () const =0
 Whether or not processing of requests has been suspended.
 

Detailed Description

Member Function Documentation

◆ Cancel() [1/2]

virtual FileRequestPtr & AZ::IO::IStreamer::Cancel ( FileRequestPtr request,
FileRequestPtr  target 
)
pure virtual

Sets a request to the cancel command. When this request completes it's not guaranteed to have canceled the target request. Not all requests can be canceled and requests that already processing may complete. It's recommended to let the target request handle the completion of the request as normal and handle cancellation by checking the status on the target request is set to IStreamerTypes::RequestStatus::Canceled.

Parameters
requestThe request that will store the cancel command.
targetThe request to cancel.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ Cancel() [2/2]

virtual FileRequestPtr AZ::IO::IStreamer::Cancel ( FileRequestPtr  target)
pure virtual

Creates a request to cancel a previously queued request. When this request completes it's not guaranteed to have canceled the target request. Not all requests can be canceled and requests that already processing may complete. It's recommended to let the target request handle the completion of the request as normal and handle cancellation by checking the status on the target request is set to IStreamerTypes::RequestStatus::Canceled. @target The request to cancel.

Returns
A smart pointer to the newly created request with the cancel command.

Implemented in AZ::IO::Streamer.

◆ CollectStatistics()

virtual void AZ::IO::IStreamer::CollectStatistics ( AZStd::vector< Statistic > &  statistics)
pure virtual

Collect statistics from all the components that make up Streamer. This function is immediately executed and returns immediately with the results. Due to this behavior there's a limit to the number of statistics that can be returned as only lockless retrieval data can be retrieved. The data is also a snapshot so may be slightly out of date. To get additional data use Report.

Parameters
statisticsThe container where statistics will be added to.

Implemented in AZ::IO::Streamer.

◆ CreateDedicatedCache() [1/2]

virtual FileRequestPtr AZ::IO::IStreamer::CreateDedicatedCache ( AZStd::string_view  relativePath)
pure virtual

Creates a dedicated cache for the target file. The target file won't be removed from the cache until DestroyDedicatedCache is called. Typical use of a dedicated cache is for files that have their own compression and are periodically visited to read a section, e.g. streaming video play or streaming audio banks. This request will fail if there are no nodes in Streamer's stack that deal with dedicated caches.

Parameters
relativePathRelative path to the file to receive a dedicated cache. This can include aliases such as @products.
Returns
A smart pointer to the newly created request with the command to create a dedicated cache.

Implemented in AZ::IO::Streamer.

◆ CreateDedicatedCache() [2/2]

virtual FileRequestPtr & AZ::IO::IStreamer::CreateDedicatedCache ( FileRequestPtr request,
AZStd::string_view  relativePath 
)
pure virtual

Creates a dedicated cache for the target file. The target file won't be removed from the cache until DestroyDedicatedCache is called. Typical use of a dedicated cache is for files that have their own compression and are periodically visited to read a section, e.g. streaming video play or streaming audio banks. This request will fail if there are no nodes in Streamer's stack that deal with dedicated caches.

Parameters
requestThe request that will store the command to create a dedicated cache.
relativePathRelative path to the file to receive a dedicated cache. This can include aliases such as @products.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ CreateRequest()

virtual FileRequestPtr AZ::IO::IStreamer::CreateRequest ( )
pure virtual

Create a new blank request. Before queuing this request a command must be assigned first.

Returns
A smart pointer to the newly created request.

Implemented in AZ::IO::Streamer.

◆ CreateRequestBatch()

virtual void AZ::IO::IStreamer::CreateRequestBatch ( AZStd::vector< FileRequestPtr > &  requests,
size_t  count 
)
pure virtual

Creates a number of new blank requests. The requests need to be assigned a command before they can be queued. This function is preferable over CreateRequest if multiple requests are needed as it avoids repeatedly syncing with Streamer's stack.

Parameters
requestsContainer where the requests will be stored in.
countThe number of requests to create.

Implemented in AZ::IO::Streamer.

◆ Custom() [1/2]

virtual FileRequestPtr AZ::IO::IStreamer::Custom ( AZStd::any  data)
pure virtual

Creates a custom request. This can be used by extensions to Streamer's stack to add their own commands.

Parameters
dataStorage for the arguments to the command.
Returns
A smart pointer to the newly created request with the custom command.

Implemented in AZ::IO::Streamer.

◆ Custom() [2/2]

virtual FileRequestPtr & AZ::IO::IStreamer::Custom ( FileRequestPtr request,
AZStd::any  data 
)
pure virtual

Creates a custom request. This can be used by extensions to Streamer's stack to add their own commands.

Parameters
requestThe request that will store the custom command.
dataStorage for the arguments to the command.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ DestroyDedicatedCache() [1/2]

virtual FileRequestPtr AZ::IO::IStreamer::DestroyDedicatedCache ( AZStd::string_view  relativePath)
pure virtual

Destroy a dedicated cache created by CreateDedicatedCache. See CreateDedicatedCache for more details.

Parameters
relativePathRelative path to the file that got a dedicated cache. This can include aliases such as @products.
Returns
A smart pointer to the newly created request with the command to destroy a dedicated cache.

Implemented in AZ::IO::Streamer.

◆ DestroyDedicatedCache() [2/2]

virtual FileRequestPtr & AZ::IO::IStreamer::DestroyDedicatedCache ( FileRequestPtr request,
AZStd::string_view  relativePath 
)
pure virtual

Destroy a dedicated cache created by CreateDedicatedCache. See CreateDedicatedCache for more details.

Parameters
requestThe request that will store the command to destroy a dedicated cache.
relativePathRelative path to the file that got a dedicated cache. This can include aliases such as @products.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ FlushCache() [1/2]

virtual FileRequestPtr AZ::IO::IStreamer::FlushCache ( AZStd::string_view  relativePath)
pure virtual

Clears a file from all caches in use by Streamer. Flushing the cache will cause the streaming stack to pause processing until it's idle before issuing the flush and resuming processing. This can result in a noticeable interruption.

Parameters
relativePathRelative path to the file that will be cleared from all caches. This can include aliases such as @products.
Returns
A smart pointer to the newly created request with the command to flush a file from all caches.

Implemented in AZ::IO::Streamer.

◆ FlushCache() [2/2]

virtual FileRequestPtr & AZ::IO::IStreamer::FlushCache ( FileRequestPtr request,
AZStd::string_view  relativePath 
)
pure virtual

Clears a file from all caches in use by Streamer. Flushing the cache will cause the streaming stack to pause processing until it's idle before issuing the flush and resuming processing. This can result in a noticeable interruption.

Parameters
requestThe request that will store the command to flush a file from all caches.
relativePathRelative path to the file that will be cleared from all caches. This can include aliases such as @products.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ FlushCaches() [1/2]

virtual FileRequestPtr AZ::IO::IStreamer::FlushCaches ( )
pure virtual

Forcefully clears out all caches internally held by the streaming stack. This removes all cached information and can result in needing to reload a substantial amount of data. Flushing will cause the streaming stack to pause processing until it's idle before issuing the flush and resuming processing. Both behaviors combined can result in a noticeable interruption. If possible, prefer to use FlushCache instead to reduce the amount of data that would potentially need to be reloaded.

Returns
A smart pointer to the newly created request with the command to flush all caches.

Implemented in AZ::IO::Streamer.

◆ FlushCaches() [2/2]

virtual FileRequestPtr & AZ::IO::IStreamer::FlushCaches ( FileRequestPtr request)
pure virtual

Forcefully clears out all caches internally held by the streaming stack. This removes all cached information and can result in needing to reload a substantial amount of data. Flushing will cause the streaming stack to pause processing until it's idle before issuing the flush and resuming processing. Both behaviors combined can result in a noticeable interruption. If possible, prefer to use FlushCache instead to reduce the amount of data that would potentially need to be reloaded.

Parameters
requestThe request that will store the command to flush all caches.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ GetEstimatedRequestCompletionTime()

virtual AZStd::chrono::steady_clock::time_point AZ::IO::IStreamer::GetEstimatedRequestCompletionTime ( FileRequestHandle  request) const
pure virtual

Returns the estimated time that the provided request will complete. Estimation doesn't happen until Streamer's stack has picked up the request and zero will be returned until then. As requests complete and new ones are added the estimated completion time will change over time until the request completes. Not all requests well get an estimation.

Parameters
requestThe request to get the estimation for.
Returns
The system time the request will complete or zero of no estimation has been done.

Implemented in AZ::IO::Streamer.

◆ GetReadRequestResult()

virtual bool AZ::IO::IStreamer::GetReadRequestResult ( FileRequestHandle  request,
void *&  buffer,
u64 &  numBytesRead,
IStreamerTypes::ClaimMemory  claimMemory = IStreamerTypes::ClaimMemory::No 
) const
pure virtual

Get the result for operations that read data.

Parameters
requestThe request to query.
bufferThe buffer the data was written to.
numBytesReadThe total number of bytes that were read from the file.
Returns
True if data could be retrieved, otherwise false.

Implemented in AZ::IO::Streamer.

◆ GetRecommendations()

virtual const IStreamerTypes::Recommendations & AZ::IO::IStreamer::GetRecommendations ( ) const
pure virtual

Returns the recommended configuration options for read requests. Following these recommendations will help improve performance, but are optional.

Implemented in AZ::IO::Streamer.

◆ GetRequestStatus()

virtual IStreamerTypes::RequestStatus AZ::IO::IStreamer::GetRequestStatus ( FileRequestHandle  request) const
pure virtual

Check the status of a request. This can be called even if the request has not been queued yet.

Parameters
requestThe request to query.
Returns
The current status of the request.

Implemented in AZ::IO::Streamer.

◆ HasRequestCompleted()

virtual bool AZ::IO::IStreamer::HasRequestCompleted ( FileRequestHandle  request) const
pure virtual

Check if the provided request has completed. This can mean it was successful, failed or was canceled.

Parameters
requestThe request to query.
Returns
True if the request is no longer pending or processing and has completed, otherwise false.

Implemented in AZ::IO::Streamer.

◆ IsSuspended()

virtual bool AZ::IO::IStreamer::IsSuspended ( ) const
pure virtual

Whether or not processing of requests has been suspended.

Implemented in AZ::IO::Streamer.

◆ QueueRequest()

virtual void AZ::IO::IStreamer::QueueRequest ( const FileRequestPtr request)
pure virtual

Queues a request for processing by Streamer's stack. After a request has been queued the request pointer can optionally be stored as Streamer supports fire-and-forget for requests.

Parameters
requestThe request that will be processed.

Implemented in AZ::IO::Streamer.

◆ QueueRequestBatch() [1/2]

virtual void AZ::IO::IStreamer::QueueRequestBatch ( AZStd::vector< FileRequestPtr > &&  requests)
pure virtual

Queue a batch of requests for processing by Streamer's stack. This version will move requests from the container, but not delete them. This function is preferable over QueueRequest if multiple requests need to be queued at the same time as it avoids repeatedly syncing with the Streamer's stack.

Parameters
requestsThe requests that will be processed.

Implemented in AZ::IO::Streamer.

◆ QueueRequestBatch() [2/2]

virtual void AZ::IO::IStreamer::QueueRequestBatch ( const AZStd::vector< FileRequestPtr > &  requests)
pure virtual

Queue a batch of requests for processing by Streamer's stack. This function is preferable over QueueRequest if multiple requests need to be queued at the same time as it avoids repeatedly syncing with the Streamer's stack.

Parameters
requestsThe requests that will be processed.

Implemented in AZ::IO::Streamer.

◆ Read() [1/4]

virtual FileRequestPtr AZ::IO::IStreamer::Read ( AZStd::string_view  relativePath,
IStreamerTypes::RequestMemoryAllocator allocator,
size_t  size,
IStreamerTypes::Deadline  deadline = IStreamerTypes::s_noDeadline,
IStreamerTypes::Priority  priority = IStreamerTypes::s_priorityMedium,
size_t  offset = 0 
)
pure virtual

Creates a request to the read command.

Parameters
relativePathRelative path to the file to load. This can include aliases such as @products.
allocatorThe allocator used to reserve and release memory for the read request. Memory allocated this way will be automatically freed when there are no more references to the FileRequestPtr. To avoid this, use GetReadRequestResult to claim the pointer and use the provided allocator to release the memory at a later point. The allocator needs to live at least as long as the FileRequestPtr is in use. Do not store the FileRequestPtr in the allocator as this will result in a circular dependency and a memory leak.
sizeThe number of bytes to read from the file at the relative path.
deadlineThe amount of time from calling Read that the request should complete. Is FileRequest::s_noDeadline if the request doesn't need to be completed before a specific time.
priorityThe priority used to order requests if multiple requests are at risk of missing their deadline.
offsetThe offset into the file where reading begins. Warning: reading at an offset other than 0 has a significant impact on performance.
Returns
A smart pointer to the newly created request with the read command.

Implemented in AZ::IO::Streamer.

◆ Read() [2/4]

virtual FileRequestPtr AZ::IO::IStreamer::Read ( AZStd::string_view  relativePath,
void *  outputBuffer,
size_t  outputBufferSize,
size_t  readSize,
IStreamerTypes::Deadline  deadline = IStreamerTypes::s_noDeadline,
IStreamerTypes::Priority  priority = IStreamerTypes::s_priorityMedium,
size_t  offset = 0 
)
pure virtual

Creates a request to read a file.

Parameters
relativePathRelative path to the file to load. This can include aliases such as @products.
outputBufferThe buffer that will hold the loaded data. This must be able to at least hold "size" number of bytes.
outputBufferSizeThe size of the buffer that will hold the loaded data. This must be equal or larger than "size" number of bytes.
readSizeThe number of bytes to read from the file at the relative path.
deadlineThe amount of time from calling Read that the request should complete. Is FileRequest::s_noDeadline if the request doesn't need to be completed before a specific time.
priorityThe priority used to order requests if multiple requests are at risk of missing their deadline.
offsetThe offset into the file where reading begins. Warning: reading at an offset other than 0 has a significant impact on performance.
Returns
A smart pointer to the newly created request with the read command.

Implemented in AZ::IO::Streamer.

◆ Read() [3/4]

virtual FileRequestPtr & AZ::IO::IStreamer::Read ( FileRequestPtr request,
AZStd::string_view  relativePath,
IStreamerTypes::RequestMemoryAllocator allocator,
size_t  size,
IStreamerTypes::Deadline  deadline = IStreamerTypes::s_noDeadline,
IStreamerTypes::Priority  priority = IStreamerTypes::s_priorityMedium,
size_t  offset = 0 
)
pure virtual

Sets a request to the read command.

Parameters
requestThe request that will store the read command.
relativePathRelative path to the file to load. This can include aliases such as @products.
allocatorThe allocator used to reserve and release memory for the read request. Memory allocated this way will be automatically freed when there are no more references to the FileRequestPtr. To avoid this, use GetReadRequestResult to claim the pointer and use the provided allocator to release the memory at a later point. The allocator needs to live at least as long as the FileRequestPtr is in use. Do not store the FileRequestPtr in the allocator as this will result in a circular dependency and a memory leak.
sizeThe number of bytes to read from the file at the relative path.
deadlineThe amount of time from calling Read that the request should complete. Is FileRequest::s_noDeadline if the request doesn't need to be completed before a specific time.
priorityThe priority used to order requests if multiple requests are at risk of missing their deadline.
offsetThe offset into the file where reading begins. Warning: reading at an offset other than 0 has a significant impact on performance.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ Read() [4/4]

virtual FileRequestPtr & AZ::IO::IStreamer::Read ( FileRequestPtr request,
AZStd::string_view  relativePath,
void *  outputBuffer,
size_t  outputBufferSize,
size_t  readSize,
IStreamerTypes::Deadline  deadline = IStreamerTypes::s_noDeadline,
IStreamerTypes::Priority  priority = IStreamerTypes::s_priorityMedium,
size_t  offset = 0 
)
pure virtual

Sets a request to the read command.

Parameters
requestThe request that will store the read command.
relativePathRelative path to the file to load. This can include aliases such as @products.
outputBufferThe buffer that will hold the loaded data. This must be able to at least hold "size" number of bytes.
outputBufferSizeThe size of the buffer that will hold the loaded data. This must be equal or larger than "size" number of bytes.
readSizeThe number of bytes to read from the file at the relative path.
deadlineThe amount of time from calling Read that the request should complete. Is FileRequest::s_noDeadline if the request doesn't need to be completed before a specific time.
priorityThe priority used to order requests if multiple requests are at risk of missing their deadline.
offsetThe offset into the file where reading begins. Warning: reading at an offset other than 0 has a significant impact on performance.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ Report() [1/2]

virtual FileRequestPtr AZ::IO::IStreamer::Report ( AZStd::vector< Statistic > &  output,
IStreamerTypes::ReportType  reportType 
)
pure virtual

Retrieves statistics for the requested type. This is meant for statistics that can't be retrieved in a lockless manner. For metrics that can be retrieved lockless use CollectStatistics.

Parameters
outputThe storage for the information that's being reported. The container needs to remain alive for the duration of the call. Register a callback with SetRequestCompleteCallback to determine when the container is no longer needed.
reportTypeThe type of information to report.
Returns
A smart pointer to the newly created request with the command to report statistics.

Implemented in AZ::IO::Streamer.

◆ Report() [2/2]

virtual FileRequestPtr & AZ::IO::IStreamer::Report ( FileRequestPtr request,
AZStd::vector< Statistic > &  output,
IStreamerTypes::ReportType  reportType 
)
pure virtual

Retrieves statistics for the requested type. This is meant for statistics that can't be retrieved in a lockless manner. For metrics that can be retrieved lockless use CollectStatistics.

Parameters
requestThe request that will store the command to report.
outputThe storage for the information that's being reported. The container needs to remain alive for the duration of the call. Register a callback with SetRequestCompleteCallback to determine when the container is no longer needed.
reportTypeThe type of information to report.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ RescheduleRequest() [1/2]

virtual FileRequestPtr & AZ::IO::IStreamer::RescheduleRequest ( FileRequestPtr request,
FileRequestPtr  target,
IStreamerTypes::Deadline  newDeadline,
IStreamerTypes::Priority  newPriority 
)
pure virtual

Adjusts the deadline and priority of a request. This has no effect if the requests is already being processed, if the request doesn't contain a command that can be rescheduled or if the request hasn't been queued.

Parameters
requestThe request that will store the reschedule command.
targetThe request that will be rescheduled.
newDeadlineThe new deadline for the request.
newPriorityThe new priority for the request.
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ RescheduleRequest() [2/2]

virtual FileRequestPtr AZ::IO::IStreamer::RescheduleRequest ( FileRequestPtr  target,
IStreamerTypes::Deadline  newDeadline,
IStreamerTypes::Priority  newPriority 
)
pure virtual

Adjusts the deadline and priority of a request. This has no effect if the requests is already being processed, if the request doesn't contain a command that can be rescheduled or if the request hasn't been queued.

Parameters
targetThe request that will be rescheduled.
newDeadlineThe new deadline for the request.
newPriorityThe new priority for the request.
Returns
A smart pointer to the newly created request with the reschedule command.

Implemented in AZ::IO::Streamer.

◆ ResumeProcessing()

virtual void AZ::IO::IStreamer::ResumeProcessing ( )
pure virtual

Resumes processing requests in Streamer's stack if previously one or more calls to SuspendProcessing were made.

Implemented in AZ::IO::Streamer.

◆ SetRequestCompleteCallback()

virtual FileRequestPtr & AZ::IO::IStreamer::SetRequestCompleteCallback ( FileRequestPtr request,
OnCompleteCallback  callback 
)
pure virtual

Sets a callback function that will trigger when the provided request completes. The callback will be triggered from within the Streamer's stack on a different thread. While in the callback function Streamer can't continue processing requests so it's recommended to keep the callback short, for instance by setting an atomic value to be picked up by another thread like the main thread or to queue a job (function) to complete the work. Note avoid storing a copy of the owning FileRequestPtr in a lambda provided as the callback. This will result in the same request storing a copy of itself indirectly, which means the reference counter can never reach zero due to the circular dependency and results in a resource leak.

Parameters
requestThe request that will get the callback assigned.
callbackA function with the signature "void(FileRequestHandle request);"
Returns
A reference to the provided request.

Implemented in AZ::IO::Streamer.

◆ SuspendProcessing()

virtual void AZ::IO::IStreamer::SuspendProcessing ( )
pure virtual

Suspends processing of requests in Streamer's stack. New requests can still be queued, but they won't be processed until ResumeProcessing is called.

Implemented in AZ::IO::Streamer.


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