Isle
|
[AI] Disk-based stream provider for resource loading using background streaming and multithreading. More...
#include <mxdiskstreamprovider.h>
Public Member Functions | |
MxDiskStreamProvider () | |
[AI] Constructs a disk stream provider, initializing critical members and preparing for disk-based streaming. More... | |
~MxDiskStreamProvider () override | |
[AI] Cleans up the disk stream provider, including terminating the worker thread and releasing file and action resources. More... | |
const char * | ClassName () const override |
[AI] Returns the runtime class name. More... | |
MxBool | IsA (const char *p_name) const override |
[AI] Tests if the object is of, or derives from, the supplied class name. More... | |
MxResult | WaitForWorkToComplete () |
[AI] Blocks until all scheduled streaming work is finished (used by the streaming worker thread). More... | |
MxResult | FUN_100d1780 (MxDSStreamingAction *p_action) |
[AI] Schedules a streaming action to read data (SI chunk) from disk and buffers it asynchronously. More... | |
void | PerformWork () |
[AI] Performs a single unit of scheduled streaming work, i.e., loading data for queued actions. More... | |
MxResult | FUN_100d1b20 (MxDSStreamingAction *p_action) |
[AI] Finalizes merging of streaming buffers and updates streamed data for a given action. More... | |
MxResult | SetResourceToGet (MxStreamController *p_resource) override |
[AI] Opens and prepares a resource for streaming from disk based on the controller's atom (resource key). More... | |
MxU32 | GetFileSize () override |
[AI] Gets the size, in bytes, of the open file/buffer to be streamed. More... | |
MxS32 | GetStreamBuffersNum () override |
[AI] Gets the number of stream buffers/splits for the file, used to drive parallel reads. More... | |
void | VTable0x20 (MxDSAction *p_action) override |
[AI] Cancels or reclaims outstanding streaming actions based on object ID, returning associated actions to free buffer. More... | |
MxU32 | GetLengthInDWords () override |
[AI] Returns file length as dword-count for bulk/integer-based streaming use cases. More... | |
MxU32 * | GetBufferForDWords () override |
[AI] Returns a pointer to the buffer for raw dword access (SI file data block). More... | |
![]() | |
MxStreamProvider () | |
[AI] Default constructor. Initializes stream provider with no lookup or file resource attached. [AI] More... | |
const char * | ClassName () const override |
[AI] Returns the name identifier for this class. More... | |
MxBool | IsA (const char *p_name) const override |
[AI] Checks if this object is of the requested class name, or a subclass thereof. More... | |
virtual MxResult | SetResourceToGet (MxStreamController *p_pLookup) |
[AI] Attaches a stream controller as the resource to provide data for. More... | |
virtual MxU32 | GetFileSize ()=0 |
[AI] Gets the file size, in bytes, of the underlying SI file resource. More... | |
virtual MxS32 | GetStreamBuffersNum ()=0 |
[AI] Returns the number of stream buffers internally maintained for this resource. More... | |
virtual void | VTable0x20 (MxDSAction *p_action) |
[AI] Virtual hook for subclasses to react to new stream actions being queued. More... | |
virtual MxU32 | GetLengthInDWords ()=0 |
[AI] Gets the full buffer length, interpreted as a DWORD-count, for direct buffer streaming. More... | |
virtual MxU32 * | GetBufferForDWords ()=0 |
[AI] Returns a pointer to the underlying buffer, cast as an array of DWORDs, for streaming purposes. More... | |
![]() | |
MxCore () | |
[AI] Constructs a new MxCore object and assigns it a unique id. More... | |
virtual | ~MxCore () |
[AI] Virtual destructor. Required for correct polymorphic cleanup in derived classes. More... | |
virtual MxLong | Notify (MxParam &p_param) |
[AI] Virtual callback notification mechanism. More... | |
virtual MxResult | Tickle () |
[AI] Called by tickle managers to allow the object to update itself. More... | |
virtual const char * | ClassName () const |
[AI] Returns the runtime class name of this object. More... | |
virtual MxBool | IsA (const char *p_name) const |
[AI] Checks whether this object's class type or parents match the given name. More... | |
MxU32 | GetId () |
[AI] Gets the unique (per-process) id assigned to this object instance. More... | |
Static Public Member Functions | |
static MxBool | FUN_100d1af0 (MxDSStreamingAction *p_action) |
[AI] Returns whether a streaming action can be processed (buffer conditions met). More... | |
Protected Attributes | |
MxDiskStreamProviderThread | m_thread |
[AI] Thread object handling streaming actions asynchronously. More... | |
MxSemaphore | m_busySemaphore |
[AI] Semaphore used to synchronize and signal work for the background thread. More... | |
MxBool | m_remainingWork |
[AI] Indicates whether more streaming work remains for the thread. More... | |
MxBool | m_unk0x35 |
[AI] Internal flag signaling available work for the thread or shutdown in progress. More... | |
MxCriticalSection | m_criticalSection |
[AI] Synchronizes access to the work item queue (m_list). More... | |
MxDSObjectList | m_list |
[AI] List of streaming actions to be processed/completed by the thread. More... | |
![]() | |
MxStreamController * | m_pLookup |
[AI] The stream controller using this provider as its data source. [AI] More... | |
MxDSFile * | m_pFile |
[AI] Pointer to the loaded SI file associated with this provider. [AI] More... | |
[AI] Disk-based stream provider for resource loading using background streaming and multithreading.
[AI] Handles asynchronous loading and management of resources from disk by employing internal buffering, file/stream semantics, synchronization, and thread-based execution. Supports the LEGO SI file streaming system. SIZE: 0x60 [AI]
Definition at line 58 of file mxdiskstreamprovider.h.
MxDiskStreamProvider::MxDiskStreamProvider | ( | ) |
[AI] Constructs a disk stream provider, initializing critical members and preparing for disk-based streaming.
Definition at line 39 of file mxdiskstreamprovider.cpp.
|
override |
[AI] Cleans up the disk stream provider, including terminating the worker thread and releasing file and action resources.
Definition at line 47 of file mxdiskstreamprovider.cpp.
|
overridevirtual |
MxResult MxDiskStreamProvider::FUN_100d1780 | ( | MxDSStreamingAction * | p_action | ) |
[AI] Schedules a streaming action to read data (SI chunk) from disk and buffers it asynchronously.
p_action | The streaming action to schedule. [AI] |
Definition at line 177 of file mxdiskstreamprovider.cpp.
|
static |
[AI] Returns whether a streaming action can be processed (buffer conditions met).
p_action | The streaming action to test. [AI] |
Definition at line 279 of file mxdiskstreamprovider.cpp.
MxResult MxDiskStreamProvider::FUN_100d1b20 | ( | MxDSStreamingAction * | p_action | ) |
[AI] Finalizes merging of streaming buffers and updates streamed data for a given action.
p_action | The streaming action to finalize/merge. [AI] |
Definition at line 290 of file mxdiskstreamprovider.cpp.
|
overridevirtual |
[AI] Returns a pointer to the buffer for raw dword access (SI file data block).
Implements MxStreamProvider.
Definition at line 398 of file mxdiskstreamprovider.cpp.
|
overridevirtual |
[AI] Gets the size, in bytes, of the open file/buffer to be streamed.
Implements MxStreamProvider.
Definition at line 380 of file mxdiskstreamprovider.cpp.
|
overridevirtual |
[AI] Returns file length as dword-count for bulk/integer-based streaming use cases.
Implements MxStreamProvider.
Definition at line 392 of file mxdiskstreamprovider.cpp.
|
overridevirtual |
[AI] Gets the number of stream buffers/splits for the file, used to drive parallel reads.
Implements MxStreamProvider.
Definition at line 386 of file mxdiskstreamprovider.cpp.
|
overridevirtual |
[AI] Tests if the object is of, or derives from, the supplied class name.
p_name | The class name to check against. [AI] |
Reimplemented from MxCore.
void MxDiskStreamProvider::PerformWork | ( | ) |
[AI] Performs a single unit of scheduled streaming work, i.e., loading data for queued actions.
[AI] Used internally by the worker thread to process actions on the work queue, handling buffer/finalization and controller callbacks.
Definition at line 213 of file mxdiskstreamprovider.cpp.
|
overridevirtual |
[AI] Opens and prepares a resource for streaming from disk based on the controller's atom (resource key).
[AI] Tries to open the resource from hard disk, then falls back to CD. Initializes queues and starts the thread.
p_resource | The stream controller resource descriptor. [AI] |
Reimplemented from MxStreamProvider.
Definition at line 85 of file mxdiskstreamprovider.cpp.
|
overridevirtual |
[AI] Cancels or reclaims outstanding streaming actions based on object ID, returning associated actions to free buffer.
p_action | The DS action (can be a kill-all or single-object). [AI] |
Reimplemented from MxStreamProvider.
Definition at line 117 of file mxdiskstreamprovider.cpp.
MxResult MxDiskStreamProvider::WaitForWorkToComplete | ( | ) |
[AI] Blocks until all scheduled streaming work is finished (used by the streaming worker thread).
[AI] Repeatedly waits on the busy semaphore and delegates to PerformWork as needed until remaining work is done.
Definition at line 164 of file mxdiskstreamprovider.cpp.
|
protected |
[AI] Semaphore used to synchronize and signal work for the background thread.
Definition at line 163 of file mxdiskstreamprovider.h.
|
protected |
[AI] Synchronizes access to the work item queue (m_list).
Definition at line 178 of file mxdiskstreamprovider.h.
|
protected |
[AI] List of streaming actions to be processed/completed by the thread.
Definition at line 183 of file mxdiskstreamprovider.h.
|
protected |
[AI] Indicates whether more streaming work remains for the thread.
Definition at line 168 of file mxdiskstreamprovider.h.
|
protected |
[AI] Thread object handling streaming actions asynchronously.
Definition at line 158 of file mxdiskstreamprovider.h.
|
protected |
[AI] Internal flag signaling available work for the thread or shutdown in progress.
Definition at line 173 of file mxdiskstreamprovider.h.