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

[AI] Represents a chunk of data extracted from a stream (typically from a Mindscape/Mx SI file or streaming media resource). More...

#include <mxdschunk.h>

Inheritance diagram for MxDSChunk:
Collaboration diagram for MxDSChunk:

Public Member Functions

 MxDSChunk ()
 [AI] Constructs a new, empty chunk. All members initialized to safe defaults. [AI] More...
 
 ~MxDSChunk () override
 [AI] Virtual destructor. Cleans up any owned chunk data if flagged by DS_CHUNK_BIT1. [AI] More...
 
const char * ClassName () const override
 [AI] Returns the class name ("MxDSChunk") for runtime type identification. [AI] More...
 
MxBool IsA (const char *p_name) const override
 [AI] Checks if this object or any parent class matches the provided class name string. More...
 
void SetChunkFlags (MxU16 p_flags)
 [AI] Sets all chunk header flag bits. More...
 
void SetObjectId (undefined4 p_objectid)
 [AI] Sets the object id for this chunk (links chunk data to logical entity, resource, or action). More...
 
void SetTime (MxLong p_time)
 [AI] Sets the time (timestamp/tick/frame) associated with this chunk. More...
 
void SetLength (MxU32 p_length)
 [AI] Sets the payload data length for this chunk. More...
 
void SetData (MxU8 *p_data)
 [AI] Sets the pointer to the raw payload data (may or may not be owned by chunk object). More...
 
MxU16 GetChunkFlags ()
 [AI] Returns the chunk's flag bitfield. [AI] More...
 
undefined4 GetObjectId ()
 [AI] Returns the object id of this chunk. [AI] More...
 
MxLong GetTime ()
 [AI] Returns the time (timestamp or tick) associated with this chunk. [AI] More...
 
MxU32 GetLength ()
 [AI] Returns the length in bytes of the data payload. [AI] More...
 
MxU8GetData ()
 [AI] Returns a pointer to the start of the data payload. [AI] More...
 
void Release ()
 [AI] Releases (deletes) data payload if present, regardless of flags; call to explicitly free memory and avoid leaks, especially when chunk objects are reused. [AI] 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...
 

Static Public Member Functions

static MxU32 GetHeaderSize ()
 [AI] Returns the fixed size of the chunk header, typically used for parsing binary streams. More...
 
static MxU32 Size (MxU8 *p_buffer)
 [AI] Returns the total size (header + data) of a chunk from a raw buffer pointer. More...
 
static MxU8End (MxU8 *p_buffer)
 [AI] Returns a pointer to the end of this chunk for sequential iteration through a chunked buffer. More...
 

Protected Attributes

MxU16 m_flags
 [AI] Flag bitfield indicating properties/status of the chunk. See DS_CHUNK_* defines. [AI] More...
 
MxU32 m_objectId
 [AI] Logical id field linking chunk to a resource, action, or entity. [AI] More...
 
MxLong m_time
 [AI] Timestamp (tick/frame) value for the chunk. Used for ordering, sequencing, and synchronization. [AI] More...
 
MxU32 m_length
 [AI] Number of bytes of data in this chunk's payload. [AI] More...
 
MxU8m_data
 [AI] Pointer to chunk's raw data buffer. Ownership is determined by DS_CHUNK_BIT1 flag and usage context. [AI] More...
 

Detailed Description

[AI] Represents a chunk of data extracted from a stream (typically from a Mindscape/Mx SI file or streaming media resource).

[AI]

[AI] This class encapsulates a block of raw data together with metadata such as its object id, timestamp, length, and flags. Chunks are used as the standard means of interoperation between the file/disk/ram streaming layer and the other subsystems, including media presentation and game object instantiation. [AI]

DS "chunks" are a core primitive for all streamed or serialized data in the LEGO Island engine. [AI]

See also
MxCore, MxDSBuffer, MxDSFile [AI]

Definition at line 38 of file mxdschunk.h.

Constructor & Destructor Documentation

◆ MxDSChunk()

MxDSChunk::MxDSChunk ( )

[AI] Constructs a new, empty chunk. All members initialized to safe defaults. [AI]

Definition at line 7 of file mxdschunk.cpp.

◆ ~MxDSChunk()

MxDSChunk::~MxDSChunk ( )
override

[AI] Virtual destructor. Cleans up any owned chunk data if flagged by DS_CHUNK_BIT1. [AI]

Definition at line 18 of file mxdschunk.cpp.

Member Function Documentation

◆ ClassName()

const char * MxDSChunk::ClassName ( ) const
inlineoverridevirtual

[AI] Returns the class name ("MxDSChunk") for runtime type identification. [AI]

Reimplemented from MxCore.

Reimplemented in MxStreamChunk.

Definition at line 47 of file mxdschunk.h.

◆ End()

static MxU8 * MxDSChunk::End ( MxU8 p_buffer)
inlinestatic

[AI] Returns a pointer to the end of this chunk for sequential iteration through a chunked buffer.

[AI]

Parameters
p_bufferPointer to the start of the chunk. [AI]
Returns
Pointer to the byte immediately after this chunk. [AI]

Definition at line 73 of file mxdschunk.h.

◆ GetChunkFlags()

MxU16 MxDSChunk::GetChunkFlags ( )
inline

[AI] Returns the chunk's flag bitfield. [AI]

Definition at line 96 of file mxdschunk.h.

◆ GetData()

MxU8 * MxDSChunk::GetData ( )
inline

[AI] Returns a pointer to the start of the data payload. [AI]

Definition at line 108 of file mxdschunk.h.

◆ GetHeaderSize()

MxU32 MxDSChunk::GetHeaderSize ( )
static

[AI] Returns the fixed size of the chunk header, typically used for parsing binary streams.

[AI]

Returns
Size in bytes of the chunk header. [AI]

Definition at line 27 of file mxdschunk.cpp.

◆ GetLength()

MxU32 MxDSChunk::GetLength ( )
inline

[AI] Returns the length in bytes of the data payload. [AI]

Definition at line 105 of file mxdschunk.h.

◆ GetObjectId()

undefined4 MxDSChunk::GetObjectId ( )
inline

[AI] Returns the object id of this chunk. [AI]

Definition at line 99 of file mxdschunk.h.

◆ GetTime()

MxLong MxDSChunk::GetTime ( )
inline

[AI] Returns the time (timestamp or tick) associated with this chunk. [AI]

Definition at line 102 of file mxdschunk.h.

◆ IsA()

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

[AI] Checks if this object or any parent class matches the provided class name string.

[AI]

Parameters
p_nameName of the class to compare to. [AI]
Returns
True if this class matches the provided name, or is a subclass thereof. [AI]

Reimplemented from MxCore.

Reimplemented in MxStreamChunk.

Definition at line 56 of file mxdschunk.h.

◆ Release()

void MxDSChunk::Release ( )
inline

[AI] Releases (deletes) data payload if present, regardless of flags; call to explicitly free memory and avoid leaks, especially when chunk objects are reused. [AI]

Definition at line 111 of file mxdschunk.h.

◆ SetChunkFlags()

void MxDSChunk::SetChunkFlags ( MxU16  p_flags)
inline

[AI] Sets all chunk header flag bits.

[AI]

Parameters
p_flagsNew flags (see DS_CHUNK_* defines above). [AI]

Definition at line 77 of file mxdschunk.h.

◆ SetData()

void MxDSChunk::SetData ( MxU8 p_data)
inline

[AI] Sets the pointer to the raw payload data (may or may not be owned by chunk object).

[AI]

Parameters
p_dataData pointer. If DS_CHUNK_BIT1 is set in flags, this pointer is owned and deleted by this object. [AI]

Definition at line 93 of file mxdschunk.h.

◆ SetLength()

void MxDSChunk::SetLength ( MxU32  p_length)
inline

[AI] Sets the payload data length for this chunk.

[AI]

Parameters
p_lengthLength in bytes of the chunk data. [AI]

Definition at line 89 of file mxdschunk.h.

◆ SetObjectId()

void MxDSChunk::SetObjectId ( undefined4  p_objectid)
inline

[AI] Sets the object id for this chunk (links chunk data to logical entity, resource, or action).

[AI]

Parameters
p_objectidNew object id for the chunk. [AI]

Definition at line 81 of file mxdschunk.h.

◆ SetTime()

void MxDSChunk::SetTime ( MxLong  p_time)
inline

[AI] Sets the time (timestamp/tick/frame) associated with this chunk.

[AI]

Parameters
p_timeRelative or absolute time value for this chunk. [AI]

Definition at line 85 of file mxdschunk.h.

◆ Size()

static MxU32 MxDSChunk::Size ( MxU8 p_buffer)
inlinestatic

[AI] Returns the total size (header + data) of a chunk from a raw buffer pointer.

Used when parsing binary memory blocks. [AI]

Parameters
p_bufferPointer to the start of the chunk buffer. [AI]
Returns
Total size (in bytes) of the chunk, including header. [AI]

Definition at line 68 of file mxdschunk.h.

Member Data Documentation

◆ m_data

MxU8* MxDSChunk::m_data
protected

[AI] Pointer to chunk's raw data buffer. Ownership is determined by DS_CHUNK_BIT1 flag and usage context. [AI]

Definition at line 127 of file mxdschunk.h.

◆ m_flags

MxU16 MxDSChunk::m_flags
protected

[AI] Flag bitfield indicating properties/status of the chunk. See DS_CHUNK_* defines. [AI]

Definition at line 123 of file mxdschunk.h.

◆ m_length

MxU32 MxDSChunk::m_length
protected

[AI] Number of bytes of data in this chunk's payload. [AI]

Definition at line 126 of file mxdschunk.h.

◆ m_objectId

MxU32 MxDSChunk::m_objectId
protected

[AI] Logical id field linking chunk to a resource, action, or entity. [AI]

Definition at line 124 of file mxdschunk.h.

◆ m_time

MxLong MxDSChunk::m_time
protected

[AI] Timestamp (tick/frame) value for the chunk. Used for ordering, sequencing, and synchronization. [AI]

Definition at line 125 of file mxdschunk.h.


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