Isle
Loading...
Searching...
No Matches
mxdssource.h
Go to the documentation of this file.
1#ifndef MXDSSOURCE_H
2#define MXDSSOURCE_H
3
4#include "mxcore.h"
5#include "mxdsbuffer.h"
6
7// VTABLE: LEGO1 0x100dc8c8
8// VTABLE: BETA10 0x101c2450
9// SIZE 0x14
20class MxDSSource : public MxCore {
21public:
26
30 ~MxDSSource() override { delete[] m_pBuffer; }
31
36 const char* ClassName() const override // vtable+0x0c
37 {
38 // STRING: LEGO1 0x10102588
39 return "MxDSSource";
40 }
41
49 MxBool IsA(const char* p_name) const override // vtable+0x10
50 {
51 return !strcmp(p_name, MxDSSource::ClassName()) || MxCore::IsA(p_name);
52 }
53
60 virtual MxLong Open(MxULong p_param) = 0; // vtable+0x14
61
66 virtual MxLong Close() = 0; // vtable+0x18
67
73 virtual MxResult ReadToBuffer(MxDSBuffer* p_buffer)
74 {
75 return Read(p_buffer->GetBuffer(), p_buffer->GetWriteOffset());
76 } // vtable+0x1c
77
85 virtual MxResult Read(unsigned char* p_dest, MxULong p_count) = 0; // vtable+0x20
86
93 virtual MxLong Seek(MxLong p_offset, MxS32 p_origin) = 0; // vtable+0x24
94
98 virtual MxULong GetBufferSize() = 0; // vtable+0x28
99
103 virtual MxULong GetStreamBuffersNum() = 0; // vtable+0x2c
104
109 virtual MxLong GetLengthInDWords() { return m_lengthInDWords; } // vtable+0x30
110
116 virtual MxU32* GetBuffer() { return m_pBuffer; } // vtable+0x34
117
122 MxLong GetPosition() const { return m_position; }
123
124protected:
128};
129
130// SYNTHETIC: LEGO1 0x100c00a0
131// MxDSSource::`scalar deleting destructor'
132
133#endif // MXDSSOURCE_H
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
virtual MxBool IsA(const char *p_name) const
[AI] Checks whether this object's class type or parents match the given name.
Definition: mxcore.h:46
[AI] Buffer for managing streamed DS (Data Stream) chunks and actions.
Definition: mxdsbuffer.h:50
MxU8 * GetBuffer()
[AI] Returns a pointer to the managed chunk data buffer.
MxU32 GetWriteOffset()
[AI] Returns the current buffer write offset (number of bytes with valid data).
[AI] Abstract base class representing a source of streamable data, providing an interface for reading...
Definition: mxdssource.h:20
virtual MxULong GetBufferSize()=0
[AI] Returns the total buffer size in bytes (implementation-dependent).
virtual MxLong Open(MxULong p_param)=0
[AI] Opens the source (e.g., a file, memory buffer, etc).
virtual MxLong Close()=0
[AI] Closes the source and releases any resources held.
~MxDSSource() override
[AI] Virtual destructor, frees internal buffer if allocated.
Definition: mxdssource.h:30
virtual MxU32 * GetBuffer()
[AI] Returns a pointer to the internal buffer as a DWORD (32-bit) pointer.
Definition: mxdssource.h:116
MxLong GetPosition() const
[AI] Returns the current per-source seek/read/write position.
Definition: mxdssource.h:122
virtual MxULong GetStreamBuffersNum()=0
[AI] Returns the number of buffers the stream is internally segmented into (for multi-buffered stream...
virtual MxLong Seek(MxLong p_offset, MxS32 p_origin)=0
[AI] Seek to a specific position in the source, relative to the start, current, or end.
MxLong m_position
[AI] Current seek/read/write position in the source. -1 if uninitialized, otherwise logical/physical ...
Definition: mxdssource.h:127
MxU32 * m_pBuffer
[AI] Pointer to allocated buffer, or NULL if uninitialized. Contains the raw read/streamed data.
Definition: mxdssource.h:126
virtual MxLong GetLengthInDWords()
[AI] Gets the length of the data in DWORDs (32-bit units).
Definition: mxdssource.h:109
MxBool IsA(const char *p_name) const override
[AI] Runtime type information check.
Definition: mxdssource.h:49
MxULong m_lengthInDWords
[AI] Length of valid data in the stream, in DWORDs (32-bit units). Used for sizing and range checking...
Definition: mxdssource.h:125
MxDSSource()
[AI] Constructor, initializes buffer pointer to NULL, position to -1 and lengthInDWords to 0.
Definition: mxdssource.h:25
virtual MxResult Read(unsigned char *p_dest, MxULong p_count)=0
[AI] Read a specified number of bytes into user-supplied buffer, starting at the current position.
const char * ClassName() const override
[AI] Returns the class name string ("MxDSSource").
Definition: mxdssource.h:36
virtual MxResult ReadToBuffer(MxDSBuffer *p_buffer)
[AI] Reads from this source into a provided MxDSBuffer up to the buffer's current write offset.
Definition: mxdssource.h:73
#define override
Definition: compat.h:21
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
int MxLong
[AI]
Definition: mxtypes.h:83
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxULong
[AI]
Definition: mxtypes.h:93
unsigned int MxU32
[AI]
Definition: mxtypes.h:32