Isle
Loading...
Searching...
No Matches
MxDiskStreamController Class Reference

[AI] Controller for streaming from disk-based SI resources, manages buffers and streaming actions. More...

#include <mxdiskstreamcontroller.h>

Inheritance diagram for MxDiskStreamController:
Collaboration diagram for MxDiskStreamController:

Public Member Functions

 MxDiskStreamController ()
 [AI] Constructor. Initializes internal state and buffer counters. More...
 
 ~MxDiskStreamController () override
 [AI] Destructor. Cleans up streaming actions, buffers, and provider. Unregisters from tickle manager. More...
 
MxResult Tickle () override
 [AI] Called by tickle managers to allow the object to update itself. More...
 
const char * ClassName () const override
 [AI] Update the controller, handling buffer processing and queued actions. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Checks whether the provided string matches the class name or any ancestor's class name. More...
 
MxResult Open (const char *p_filename) override
 [AI] Opens a data stream with the specified resource filename. More...
 
MxResult VTable0x18 (undefined4, undefined4) override
 [AI] Opens the given resource file for streaming. More...
 
MxResult VTable0x20 (MxDSAction *p_action) override
 [AI] Placeholder/overridden method—purpose unknown from context. More...
 
MxResult VTable0x24 (MxDSAction *p_action) override
 [AI] Start or queue the streaming action for the given action, potentially using buffer reuse and streaming mechanics. More...
 
MxDSStreamingActionVTable0x28 () override
 [AI] Marks an action as completed and cleans up associated resources. More...
 
MxResult VTable0x30 (MxDSAction *p_action) override
 [AI] Pops a queued (ready) streaming action and prepares it for buffer assignment. [AI] More...
 
virtual MxResult VTable0x34 (undefined4)
 [AI] Cleans up/aborts all queued streaming actions associated with the specified action. More...
 
MxBool GetUnk0xc4 () const
 [AI] Placeholder/overridden method—purpose unknown from context. More...
 
MxResult FUN_100c7890 (MxDSStreamingAction *p_action)
 [AI] Adds a streaming action to the list (m_list0x80) and possibly processes buffer allocation. More...
 
void FUN_100c7cb0 (MxDSStreamingAction *p_action)
 [AI] Destroys the given streaming action and any associated buffers. More...
 
void FUN_100c7f40 (MxDSStreamingAction *p_streamingaction)
 [AI] Adds a streaming action to m_list0x64 for processing. More...
 
void FUN_100c8120 (MxDSAction *p_action)
 [AI] Cleans up an action and all associated resources, notifies provider. More...
 
void InsertToList74 (MxDSBuffer *p_buffer)
 [AI] Inserts a buffer to the buffer reuse list (m_list0x74). More...
 
void FUN_100c8670 (MxDSStreamingAction *p_streamingAction)
 [AI] Pushes an action to a private list (m_list0xb8) for later cleanup. More...
 
- Public Member Functions inherited from MxStreamController
 MxStreamController ()
 [AI] Constructor. More...
 
 ~MxStreamController () override
 [AI] Destructor. More...
 
const char * ClassName () const override
 [AI] Returns the class name used for runtime type checks. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Performs runtime type checking, matching the given name with this or any parent class. More...
 
virtual MxResult Open (const char *p_filename)
 [AI] Opens a data stream with the specified resource filename. More...
 
virtual MxResult VTable0x18 (undefined4, undefined4)
 [AI] Unknown virtual function placeholder. More...
 
virtual MxResult VTable0x1c (undefined4, undefined4)
 [AI] Unknown virtual function placeholder. More...
 
virtual MxResult VTable0x20 (MxDSAction *p_action)
 [AI] Streams data for the provided action by determining data offset and reading required chunk. More...
 
virtual MxResult VTable0x24 (MxDSAction *p_action)
 [AI] Matches and processes an action in the "unk0x54" (pending) list and triggers sending to subscribers. More...
 
virtual MxDSStreamingActionVTable0x28 ()
 [AI] Returns a pointer to the current/active streaming action object. More...
 
virtual MxResult VTable0x2c (MxDSAction *p_action, MxU32 p_bufferval)
 [AI] Handles allocation and setup of a new streaming action and associated chunk for the action, with prefetch based on buffer value. More...
 
virtual MxResult VTable0x30 (MxDSAction *p_action)
 [AI] Removes a completed action from in-progress ("unk0x3c") list and deletes its data block. More...
 
void AddSubscriber (MxDSSubscriber *p_subscriber)
 [AI] Adds a subscriber to the list who will receive streaming action data. More...
 
void RemoveSubscriber (MxDSSubscriber *p_subscriber)
 [AI] Removes a previously registered subscriber from the stream notification list. More...
 
MxResult FUN_100c1800 (MxDSAction *p_action, MxU32 p_val)
 [AI] Helper function to add a next action data start object for tracking offsets for streaming actions. More...
 
MxResult FUN_100c1a00 (MxDSAction *p_action, MxU32 p_offset)
 [AI] Allocates and inserts a streaming action chunk at a given buffer offset for the supplied action. More...
 
MxPresenterFUN_100c1e70 (MxDSAction &p_action)
 [AI] Returns the presenter associated with a given in-progress streaming action. More...
 
MxResult FUN_100c1f00 (MxDSAction *p_action)
 [AI] Sends a streaming chunk to all current subscribers for the specified action, handling recursive send for multi-actions. More...
 
MxBool IsStoped (MxDSObject *p_obj)
 [AI] Checks if the streaming operation for a given object/action has fully stopped and no longer has active subscribers. More...
 
MxResult InsertActionToList54 (MxDSAction *p_action)
 [AI] Inserts a clone of the provided action into the pending ("unk0x54") list. More...
 
MxNextActionDataStartFindNextActionDataStartFromStreamingAction (MxDSStreamingAction *p_action)
 [AI] Finds the corresponding next action data start (offset info) for a streaming action. More...
 
MxAtomIdGetAtom ()
 [AI] Retrieves the atom ID (unique logical identifier) for this stream controller. More...
 
MxStreamProviderGetProvider ()
 [AI] Retrieves the current stream provider abstraction used to access file/memory resources. More...
 
MxDSObjectListGetUnk0x3c ()
 [AI] Returns the list of actions currently being streamed ("in progress" list). More...
 
MxDSObjectListGetUnk0x54 ()
 [AI] Returns the list of actions pending to be streamed ("pending" list). More...
 
MxDSSubscriberListGetSubscriberList ()
 [AI] Returns the list of current stream subscribers. More...
 
- Public Member Functions inherited from MxCore
 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...
 

Additional Inherited Members

- Protected Attributes inherited from MxStreamController
MxCriticalSection m_criticalSection
 [AI] Protects streaming controller state for thread-safety. More...
 
MxAtomId m_atom
 [AI] Unique identifier for this stream, derived from source/resource name. More...
 
MxStreamProviderm_provider
 [AI] Stream provider abstraction, handling resource IO (RAM/disk). More...
 
undefined4m_unk0x2c
 [AI] Unknown data, likely used for streaming internals or as a metadata pointer. More...
 
MxDSSubscriberList m_subscribers
 [AI] List of current subscribers (listening entities for streamed data). More...
 
MxDSObjectList m_unk0x3c
 [AI] List of actions currently being processed/streamed ("in progress" actions). More...
 
MxNextActionDataStartList m_nextActionList
 [AI] List mapping from streamed object/action to starting offset (used for internal tracking). More...
 
MxDSObjectList m_unk0x54
 [AI] List of actions queued and ready to be streamed ("pending" actions). More...
 
MxDSActionm_action0x60
 [AI] Current action pointer used during processing, moved from pending to active as actions are processed. More...
 

Detailed Description

[AI] Controller for streaming from disk-based SI resources, manages buffers and streaming actions.

Extends MxStreamController.

[AI] The MxDiskStreamController handles streaming of resources (usually from disk) via SI (Script/Resource) files. Manages various buffers and actions to allow for asynchronous streaming, buffer reuse, and action lifecycle. Synchronizes access using critical sections for thread safety, and incorporates a tickle-based update mechanism.

Definition at line 23 of file mxdiskstreamcontroller.h.

Constructor & Destructor Documentation

◆ MxDiskStreamController()

MxDiskStreamController::MxDiskStreamController ( )

[AI] Constructor. Initializes internal state and buffer counters.

Definition at line 16 of file mxdiskstreamcontroller.cpp.

◆ ~MxDiskStreamController()

MxDiskStreamController::~MxDiskStreamController ( )
override

[AI] Destructor. Cleans up streaming actions, buffers, and provider. Unregisters from tickle manager.

Definition at line 23 of file mxdiskstreamcontroller.cpp.

Member Function Documentation

◆ ClassName()

const char * MxDiskStreamController::ClassName ( ) const
inlineoverridevirtual

[AI] Update the controller, handling buffer processing and queued actions.

Invoked regularly (see tickle mechanism).

[AI] Frees unused buffers, handles scheduled streaming actions, and launches new buffer loads as necessary.

[AI] Returns the class name as a string literal.

Returns
"MxDiskStreamController" [AI]

Reimplemented from MxCore.

Definition at line 38 of file mxdiskstreamcontroller.h.

◆ FUN_100c7890()

MxResult MxDiskStreamController::FUN_100c7890 ( MxDSStreamingAction p_action)

[AI] Adds a streaming action to the list (m_list0x80) and possibly processes buffer allocation.

Parameters
p_actionStreaming action to add. [AI]

Definition at line 110 of file mxdiskstreamcontroller.cpp.

◆ FUN_100c7cb0()

void MxDiskStreamController::FUN_100c7cb0 ( MxDSStreamingAction p_action)

[AI] Destroys the given streaming action and any associated buffers.

Parameters
p_actionStreaming action to destroy. [AI]

Definition at line 229 of file mxdiskstreamcontroller.cpp.

◆ FUN_100c7f40()

void MxDiskStreamController::FUN_100c7f40 ( MxDSStreamingAction p_streamingaction)

[AI] Adds a streaming action to m_list0x64 for processing.

Parameters
p_streamingactionStreaming action to add. [AI]

Definition at line 301 of file mxdiskstreamcontroller.cpp.

◆ FUN_100c8120()

void MxDiskStreamController::FUN_100c8120 ( MxDSAction p_action)

[AI] Cleans up an action and all associated resources, notifies provider.

Parameters
p_actionAction to clean up. [AI]

Definition at line 339 of file mxdiskstreamcontroller.cpp.

◆ FUN_100c8670()

void MxDiskStreamController::FUN_100c8670 ( MxDSStreamingAction p_streamingAction)

[AI] Pushes an action to a private list (m_list0xb8) for later cleanup.

Parameters
p_streamingActionThe streaming action to defer deletion. [AI]

Definition at line 473 of file mxdiskstreamcontroller.cpp.

◆ GetUnk0xc4()

MxBool MxDiskStreamController::GetUnk0xc4 ( ) const
inline

[AI] Placeholder/overridden method—purpose unknown from context.

[AI] Return value of m_unk0xc4, indicating if more action chunks/processing is in progress.

Returns
Boolean processing flag. [AI]

Definition at line 85 of file mxdiskstreamcontroller.h.

◆ InsertToList74()

void MxDiskStreamController::InsertToList74 ( MxDSBuffer p_buffer)

[AI] Inserts a buffer to the buffer reuse list (m_list0x74).

Parameters
p_bufferBuffer to enqueue for later potential reuse or cleanup. [AI]

Definition at line 423 of file mxdiskstreamcontroller.cpp.

◆ IsA()

MxBool MxDiskStreamController::IsA ( const char *  p_name) const
inlineoverridevirtual

[AI] Checks whether the provided string matches the class name or any ancestor's class name.

Parameters
p_nameName to compare. [AI]
Returns
True if the class matches or is a subclass; otherwise, false. [AI]

Reimplemented from MxCore.

Definition at line 50 of file mxdiskstreamcontroller.h.

◆ Open()

MxResult MxDiskStreamController::Open ( const char *  p_filename)
overridevirtual

[AI] Opens a data stream with the specified resource filename.

Parameters
p_filename[AI] Name of the resource file to open (typically .SI).
Returns
[AI] SUCCESS (0) if source name is set, otherwise other status.

[AI] This sets the atom ID with the converted source name for unique logical identification and later lookups.

Reimplemented from MxStreamController.

Definition at line 74 of file mxdiskstreamcontroller.cpp.

◆ Tickle()

MxResult MxDiskStreamController::Tickle ( )
overridevirtual

[AI] Called by tickle managers to allow the object to update itself.

[AI] Override in derived classes for time-sliced processing ("tickling"). Used extensively by game logic and resource management systems.

Returns
[AI] Returns SUCCESS in the base class.

Reimplemented from MxCore.

Definition at line 456 of file mxdiskstreamcontroller.cpp.

◆ VTable0x18()

MxResult MxDiskStreamController::VTable0x18 ( undefined4  ,
undefined4   
)
overridevirtual

[AI] Opens the given resource file for streaming.

Prepares provider/stream for reading actions and registers for tickling.

Parameters
p_filenameName of the resource file to open (without path/extension). [AI]
Returns
[AI] Success on successful setup, otherwise failure status.

Reimplemented from MxStreamController.

Definition at line 103 of file mxdiskstreamcontroller.cpp.

◆ VTable0x20()

MxResult MxDiskStreamController::VTable0x20 ( MxDSAction p_action)
overridevirtual

[AI] Placeholder/overridden method—purpose unknown from context.

Reimplemented from MxStreamController.

Definition at line 311 of file mxdiskstreamcontroller.cpp.

◆ VTable0x24()

MxResult MxDiskStreamController::VTable0x24 ( MxDSAction p_action)
overridevirtual

[AI] Start or queue the streaming action for the given action, potentially using buffer reuse and streaming mechanics.

Parameters
p_actionThe action to process. [AI]

Reimplemented from MxStreamController.

Definition at line 357 of file mxdiskstreamcontroller.cpp.

◆ VTable0x28()

MxDSStreamingAction * MxDiskStreamController::VTable0x28 ( )
overridevirtual

[AI] Marks an action as completed and cleans up associated resources.

Parameters
p_actionThe completed action. [AI]

Reimplemented from MxStreamController.

Definition at line 174 of file mxdiskstreamcontroller.cpp.

◆ VTable0x30()

MxResult MxDiskStreamController::VTable0x30 ( MxDSAction p_action)
overridevirtual

[AI] Pops a queued (ready) streaming action and prepares it for buffer assignment. [AI]

Reimplemented from MxStreamController.

Definition at line 203 of file mxdiskstreamcontroller.cpp.

◆ VTable0x34()

MxResult MxDiskStreamController::VTable0x34 ( undefined4  )
virtual

[AI] Cleans up/aborts all queued streaming actions associated with the specified action.

Parameters
p_actionThe action whose streaming actions to remove. [AI]

Definition at line 123 of file mxdiskstreamcontroller.cpp.


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