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

[AI] Represents a streamable chunk of data, typically sourced from a media buffer and designed for notification and streaming within Lego Island's resource system. More...

#include <mxstreamchunk.h>

Inheritance diagram for MxStreamChunk:
Collaboration diagram for MxStreamChunk:

Public Member Functions

 MxStreamChunk ()
 [AI] Constructs a new MxStreamChunk with a null buffer pointer. More...
 
 ~MxStreamChunk () override
 [AI] Cleans up the stream chunk, releasing its associated buffer if any. More...
 
const char * ClassName () const override
 [AI] Returns the class name identifier for runtime type checking and reflection. More...
 
MxBool IsA (const char *p_name) const override
 [AI] Performs runtime type checking against this or parent class names. More...
 
MxDSBufferGetBuffer ()
 [AI] Retrieves the buffer associated with this chunk. More...
 
MxResult ReadChunk (MxDSBuffer *p_buffer, MxU8 *p_chunkData)
 [AI] Reads the chunk's header and initializes from a chunk data buffer of a streamed data segment. More...
 
MxU32 ReadChunkHeader (MxU8 *p_chunkData)
 [AI] Reads this chunk's header fields from the provided chunk data. More...
 
MxResult SendChunk (MxDSSubscriberList &p_subscriberList, MxBool p_append, MxS16 p_obj24val)
 [AI] Dispatches this stream chunk to a list of subscribers matching certain criteria. More...
 
void SetBuffer (MxDSBuffer *p_buffer)
 [AI] Sets the buffer reference for this chunk, without incrementing the reference count. More...
 
- Public Member Functions inherited from MxDSChunk
 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 MxU16IntoFlags (MxU8 *p_buffer)
 [AI] Utility to cast a chunk header buffer into the flags field pointer, facilitating direct parsing. More...
 
static MxU32IntoObjectId (MxU8 *p_buffer)
 [AI] Utility to cast a chunk header buffer into the objectId field pointer, facilitating direct parsing. More...
 
static MxLongIntoTime (MxU8 *p_buffer)
 [AI] Utility to cast a chunk header buffer into the time field pointer, facilitating direct parsing. More...
 
static MxU32IntoLength (MxU8 *p_buffer)
 [AI] Utility to cast a chunk header buffer into the data length field pointer, facilitating direct parsing. More...
 
- Static Public Member Functions inherited from MxDSChunk
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...
 

Additional Inherited Members

- Protected Attributes inherited from MxDSChunk
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 streamable chunk of data, typically sourced from a media buffer and designed for notification and streaming within Lego Island's resource system.

Derived from MxDSChunk, it is used to facilitate chunk-based streaming, particularly in video and audio playback pipelines.

[AI] Holds meta-data and a reference to an MxDSBuffer containing the raw data, and can parse and propagate its chunk to a list of stream subscribers.

Definition at line 19 of file mxstreamchunk.h.

Constructor & Destructor Documentation

◆ MxStreamChunk()

MxStreamChunk::MxStreamChunk ( )
inline

[AI] Constructs a new MxStreamChunk with a null buffer pointer.

Definition at line 24 of file mxstreamchunk.h.

◆ ~MxStreamChunk()

MxStreamChunk::~MxStreamChunk ( )
override

[AI] Cleans up the stream chunk, releasing its associated buffer if any.

Definition at line 8 of file mxstreamchunk.cpp.

Member Function Documentation

◆ ClassName()

const char * MxStreamChunk::ClassName ( ) const
inlineoverridevirtual

[AI] Returns the class name identifier for runtime type checking and reflection.

Returns
Pointer to string "MxStreamChunk". [AI]

Reimplemented from MxDSChunk.

Definition at line 35 of file mxstreamchunk.h.

◆ GetBuffer()

MxDSBuffer * MxStreamChunk::GetBuffer ( )
inline

[AI] Retrieves the buffer associated with this chunk.

Returns
Pointer to the MxDSBuffer for this chunk, or NULL if unset. [AI]

Definition at line 55 of file mxstreamchunk.h.

◆ IntoFlags()

MxU16 * MxStreamChunk::IntoFlags ( MxU8 p_buffer)
static

[AI] Utility to cast a chunk header buffer into the flags field pointer, facilitating direct parsing.

Parameters
p_bufferPointer to start of a chunk header. [AI]
Returns
Pointer to the MxU16 flags within the header. [AI]

Definition at line 87 of file mxstreamchunk.cpp.

◆ IntoLength()

MxU32 * MxStreamChunk::IntoLength ( MxU8 p_buffer)
static

[AI] Utility to cast a chunk header buffer into the data length field pointer, facilitating direct parsing.

Parameters
p_bufferPointer to start of a chunk header. [AI]
Returns
Pointer to the MxU32 length field within the header. [AI]

Definition at line 106 of file mxstreamchunk.cpp.

◆ IntoObjectId()

MxU32 * MxStreamChunk::IntoObjectId ( MxU8 p_buffer)
static

[AI] Utility to cast a chunk header buffer into the objectId field pointer, facilitating direct parsing.

Parameters
p_bufferPointer to start of a chunk header. [AI]
Returns
Pointer to the MxU32 objectId within the header. [AI]

Definition at line 93 of file mxstreamchunk.cpp.

◆ IntoTime()

MxLong * MxStreamChunk::IntoTime ( MxU8 p_buffer)
static

[AI] Utility to cast a chunk header buffer into the time field pointer, facilitating direct parsing.

Parameters
p_bufferPointer to start of a chunk header. [AI]
Returns
Pointer to the MxLong time field within the header. [AI]

Definition at line 100 of file mxstreamchunk.cpp.

◆ IsA()

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

[AI] Performs runtime type checking against this or parent class names.

Parameters
p_nameThe class name string to compare against. [AI]
Returns
TRUE if p_name matches this class or ancestors; FALSE otherwise. [AI]

Reimplemented from MxDSChunk.

Definition at line 46 of file mxstreamchunk.h.

◆ ReadChunk()

MxResult MxStreamChunk::ReadChunk ( MxDSBuffer p_buffer,
MxU8 p_chunkData 
)

[AI] Reads the chunk's header and initializes from a chunk data buffer of a streamed data segment.

Parameters
p_bufferThe buffer to associate with this stream chunk. [AI]
p_chunkDataPointer to raw chunk data; expects the "MxCh" identifier in the first 4 bytes. [AI]
Returns
Returns SUCCESS if properly initialized and associated; otherwise FAILURE. [AI]

Definition at line 16 of file mxstreamchunk.cpp.

◆ ReadChunkHeader()

MxU32 MxStreamChunk::ReadChunkHeader ( MxU8 p_chunkData)

[AI] Reads this chunk's header fields from the provided chunk data.

Parameters
p_chunkDataPointer to the start of header bytes within a chunk. [AI]
Returns
Number of bytes read from the header. [AI]

Definition at line 34 of file mxstreamchunk.cpp.

◆ SendChunk()

MxResult MxStreamChunk::SendChunk ( MxDSSubscriberList p_subscriberList,
MxBool  p_append,
MxS16  p_obj24val 
)

[AI] Dispatches this stream chunk to a list of subscribers matching certain criteria.

Parameters
p_subscriberListThe list of subscribers eligible to receive this chunk. [AI]
p_appendWhether the chunk data should be appended to existing data. [AI]
p_obj24valAdditional identity or filtering parameter (typically corresponds to object state/ID). [AI]
Returns
SUCCESS if at least one eligible subscriber received the chunk; otherwise FAILURE. [AI]

Definition at line 61 of file mxstreamchunk.cpp.

◆ SetBuffer()

void MxStreamChunk::SetBuffer ( MxDSBuffer p_buffer)

[AI] Sets the buffer reference for this chunk, without incrementing the reference count.

Parameters
p_bufferThe buffer to associate with this chunk. [AI]

Definition at line 80 of file mxstreamchunk.cpp.


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