![]() |
ezEngine Release 26.3
|
Abstract interface for memory stream storage providing pluggable backend implementations. More...
#include <MemoryStream.h>

Public Member Functions | |
| ezUInt32 | GetStorageSize32 () const |
| Returns the number of bytes that are currently stored. Asserts that the stored amount is less than 4GB. | |
| virtual ezUInt64 | GetStorageSize64 () const =0 |
| Returns the number of bytes that are currently stored. | |
| virtual void | Clear ()=0 |
| Clears the entire storage. All readers and writers must be reset to start from the beginning again. | |
| virtual void | Compact ()=0 |
| Deallocates any allocated memory that's not needed to hold the currently stored data. | |
| virtual ezUInt64 | GetHeapMemoryUsage () const =0 |
| Returns the amount of bytes that are currently allocated on the heap. | |
| void | ReadAll (ezStreamReader &inout_stream, ezUInt64 uiMaxBytes=ezMath::MaxValue< ezUInt64 >()) |
| Copies all data from the given stream into the storage. | |
| virtual void | Reserve (ezUInt64 uiBytes)=0 |
| Reserves N bytes of storage. | |
| virtual ezResult | CopyToStream (ezStreamWriter &inout_stream) const =0 |
| Writes the entire content of the storage to the provided stream. | |
| virtual ezArrayPtr< const ezUInt8 > | GetContiguousMemoryRange (ezUInt64 uiStartByte) const =0 |
| Returns a read-only ezArrayPtr that represents a contiguous area in memory which starts at the given first byte. | |
| virtual ezArrayPtr< ezUInt8 > | GetContiguousMemoryRange (ezUInt64 uiStartByte)=0 |
| Non-const overload of GetContiguousMemoryRange(). | |
Friends | |
| class | ezMemoryStreamReader |
| class | ezMemoryStreamWriter |
Abstract interface for memory stream storage providing pluggable backend implementations.
MemoryStreamStorageInterface defines the contract for storage backends used by memory streams. Different implementations can optimize for specific use cases such as small temporary buffers, large datasets, or zero-copy operations with existing containers.
|
pure virtual |
Clears the entire storage. All readers and writers must be reset to start from the beginning again.
Implemented in ezMemoryStreamContainerStorage< CONTAINER >, ezMemoryStreamContainerStorage< ezHybridArray< ezUInt8, 256 > >, ezDefaultMemoryStreamStorage, and ezMemoryStreamContainerWrapperStorage< CONTAINER >.
|
pure virtual |
Deallocates any allocated memory that's not needed to hold the currently stored data.
Implemented in ezMemoryStreamContainerStorage< CONTAINER >, ezMemoryStreamContainerStorage< ezHybridArray< ezUInt8, 256 > >, ezDefaultMemoryStreamStorage, and ezMemoryStreamContainerWrapperStorage< CONTAINER >.
|
pure virtual |
Writes the entire content of the storage to the provided stream.
Implemented in ezMemoryStreamContainerStorage< CONTAINER >, ezMemoryStreamContainerStorage< ezHybridArray< ezUInt8, 256 > >, ezDefaultMemoryStreamStorage, and ezMemoryStreamContainerWrapperStorage< CONTAINER >.
|
pure virtual |
Returns a read-only ezArrayPtr that represents a contiguous area in memory which starts at the given first byte.
This piece of memory can be read/copied/modified in one operation (memcpy etc). The next byte after this slice may be located somewhere entirely different in memory. Call GetContiguousMemoryRange() again with the next byte after this range, to get access to the next memory area.
Chunks may differ in size.
Implemented in ezMemoryStreamContainerStorage< CONTAINER >, ezMemoryStreamContainerStorage< ezHybridArray< ezUInt8, 256 > >, ezDefaultMemoryStreamStorage, and ezMemoryStreamContainerWrapperStorage< CONTAINER >.
|
pure virtual |
|
pure virtual |
Returns the amount of bytes that are currently allocated on the heap.
Implemented in ezMemoryStreamContainerStorage< CONTAINER >, ezMemoryStreamContainerStorage< ezHybridArray< ezUInt8, 256 > >, ezDefaultMemoryStreamStorage, and ezMemoryStreamContainerWrapperStorage< CONTAINER >.
|
pure virtual |
Returns the number of bytes that are currently stored.
Implemented in ezMemoryStreamContainerStorage< CONTAINER >, ezMemoryStreamContainerStorage< ezHybridArray< ezUInt8, 256 > >, ezDefaultMemoryStreamStorage, and ezMemoryStreamContainerWrapperStorage< CONTAINER >.
|
pure virtual |
Reserves N bytes of storage.
Implemented in ezMemoryStreamContainerStorage< CONTAINER >, ezMemoryStreamContainerStorage< ezHybridArray< ezUInt8, 256 > >, ezDefaultMemoryStreamStorage, and ezMemoryStreamContainerWrapperStorage< CONTAINER >.