ezEngine  Release 25.03
ezMemoryStreamContainerWrapperStorage< CONTAINER > Class Template Reference

Wrapper around an existing container to implement ezMemoryStreamStorageInterface. More...

#include <MemoryStream.h>

Inheritance diagram for ezMemoryStreamContainerWrapperStorage< CONTAINER >:

Public Member Functions

 ezMemoryStreamContainerWrapperStorage (CONTAINER *pContainer)
 
virtual ezUInt64 GetStorageSize64 () const override
 Returns the number of bytes that are currently stored.
 
virtual void Clear () override
 Clears the entire storage. All readers and writers must be reset to start from the beginning again.
 
virtual void Compact () override
 Deallocates any allocated memory that's not needed to hold the currently stored data.
 
virtual ezUInt64 GetHeapMemoryUsage () const override
 Returns the amount of bytes that are currently allocated on the heap.
 
virtual void Reserve (ezUInt64 uiBytes) override
 Reserves N bytes of storage.
 
virtual ezResult CopyToStream (ezStreamWriter &inout_stream) const override
 Writes the entire content of the storage to the provided stream.
 
virtual ezArrayPtr< const ezUInt8 > GetContiguousMemoryRange (ezUInt64 uiStartByte) const override
 Returns a read-only ezArrayPtr that represents a contiguous area in memory which starts at the given first byte. More...
 
virtual ezArrayPtr< ezUInt8 > GetContiguousMemoryRange (ezUInt64 uiStartByte) override
 Non-const overload of GetContiguousMemoryRange().
 
- Public Member Functions inherited from ezMemoryStreamStorageInterface
ezUInt32 GetStorageSize32 () const
 Returns the number of bytes that are currently stored. Asserts that the stored amount is less than 4GB.
 
void ReadAll (ezStreamReader &inout_stream, ezUInt64 uiMaxBytes=ezMath::MaxValue< ezUInt64 >())
 Copies all data from the given stream into the storage.
 

Detailed Description

template<typename CONTAINER>
class ezMemoryStreamContainerWrapperStorage< CONTAINER >

Wrapper around an existing container to implement ezMemoryStreamStorageInterface.

Member Function Documentation

◆ GetContiguousMemoryRange()

template<typename CONTAINER >
virtual ezArrayPtr<const ezUInt8> ezMemoryStreamContainerWrapperStorage< CONTAINER >::GetContiguousMemoryRange ( ezUInt64  uiStartByte) const
inlineoverridevirtual

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.

Implements ezMemoryStreamStorageInterface.


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