Isle
|
[AI] Provides RAM-backed stream data access. More...
#include <mxramstreamprovider.h>
Public Member Functions | |
MxRAMStreamProvider () | |
[AI] Constructs a new MxRAMStreamProvider and initializes the buffer members to defaults/nullptr. More... | |
~MxRAMStreamProvider () override | |
[AI] Destroys the MxRAMStreamProvider, releasing all memory buffers. More... | |
const char * | ClassName () const override |
[AI] Returns the runtime class name string for this object. More... | |
MxBool | IsA (const char *p_name) const override |
[AI] Runtime type check against this and parent class. More... | |
MxResult | SetResourceToGet (MxStreamController *p_resource) override |
[AI] Loads the requested resource (SI file) fully into memory, prepares internal buffers for fast access. More... | |
MxU32 | GetFileSize () override |
[AI] Returns the loaded file's full byte size. More... | |
MxS32 | GetStreamBuffersNum () override |
[AI] Returns number of stream buffers contained (always 1 for RAM provider). More... | |
MxU32 | GetLengthInDWords () override |
[AI] Returns length (number) of 32-bit words in buffer (DWORD units). More... | |
MxU32 * | GetBufferForDWords () override |
[AI] Returns pointer to the buffer as array of 32bit values (DWORDs), for data accessing aligned to 4 bytes. More... | |
MxU8 * | GetBufferOfFileSize () |
[AI] Returns pointer to raw file buffer as byte array. 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... | |
Protected Attributes | |
MxU32 | m_bufferSize |
[AI] Actual size in bytes of the buffer allocated for file (may match or exceed file size). More... | |
MxU32 | m_fileSize |
[AI] Size in bytes of the loaded resource file. More... | |
MxU8 * | m_pBufferOfFileSize |
[AI] Pointer to full byte buffer with loaded SI file contents. More... | |
MxU32 | m_lengthInDWords |
[AI] Number of DWORD (4 byte) entries in buffer. More... | |
MxU32 * | m_bufferForDWords |
[AI] Pointer to DWORD buffer for 4-byte-aligned access to SI chunk data. 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] Provides RAM-backed stream data access.
Handles loading entire SI files into memory buffers for fast reading and easy chunk combination. Subclass of MxStreamProvider.
[AI] The MxRAMStreamProvider loads the whole referenced SI file either from the HDD or CD to a dedicated memory buffer, and provides methods to access the buffer directly in various formats (raw bytes, DWORDs). It is essential for efficient in-memory streaming access, especially for objects that don't require disk streaming.
Definition at line 13 of file mxramstreamprovider.h.
MxRAMStreamProvider::MxRAMStreamProvider | ( | ) |
[AI] Constructs a new MxRAMStreamProvider and initializes the buffer members to defaults/nullptr.
Definition at line 13 of file mxramstreamprovider.cpp.
|
override |
[AI] Destroys the MxRAMStreamProvider, releasing all memory buffers.
Definition at line 47 of file mxramstreamprovider.cpp.
|
inlineoverridevirtual |
[AI] Returns the runtime class name string for this object.
Reimplemented from MxCore.
Definition at line 29 of file mxramstreamprovider.h.
|
overridevirtual |
[AI] Returns pointer to the buffer as array of 32bit values (DWORDs), for data accessing aligned to 4 bytes.
Implements MxStreamProvider.
Definition at line 41 of file mxramstreamprovider.cpp.
|
inline |
[AI] Returns pointer to raw file buffer as byte array.
Definition at line 75 of file mxramstreamprovider.h.
|
overridevirtual |
[AI] Returns the loaded file's full byte size.
Returns 0 if nothing loaded.
Implements MxStreamProvider.
Definition at line 23 of file mxramstreamprovider.cpp.
|
overridevirtual |
[AI] Returns length (number) of 32-bit words in buffer (DWORD units).
Implements MxStreamProvider.
Definition at line 35 of file mxramstreamprovider.cpp.
|
overridevirtual |
[AI] Returns number of stream buffers contained (always 1 for RAM provider).
[AI]
Implements MxStreamProvider.
Definition at line 29 of file mxramstreamprovider.cpp.
|
inlineoverridevirtual |
[AI] Runtime type check against this and parent class.
p_name | Name to check type against (case-sensitive/classname) [AI] |
Reimplemented from MxCore.
Definition at line 40 of file mxramstreamprovider.h.
|
overridevirtual |
[AI] Loads the requested resource (SI file) fully into memory, prepares internal buffers for fast access.
Tries HDD, then CD for the file.
p_resource | Stream controller providing atom name and linkage. [AI] |
Reimplemented from MxStreamProvider.
Definition at line 62 of file mxramstreamprovider.cpp.
|
protected |
[AI] Pointer to DWORD buffer for 4-byte-aligned access to SI chunk data.
Definition at line 82 of file mxramstreamprovider.h.
|
protected |
[AI] Actual size in bytes of the buffer allocated for file (may match or exceed file size).
Definition at line 78 of file mxramstreamprovider.h.
|
protected |
[AI] Size in bytes of the loaded resource file.
Definition at line 79 of file mxramstreamprovider.h.
|
protected |
[AI] Number of DWORD (4 byte) entries in buffer.
Definition at line 81 of file mxramstreamprovider.h.
|
protected |
[AI] Pointer to full byte buffer with loaded SI file contents.
Definition at line 80 of file mxramstreamprovider.h.