XII Release 0.1.0
Loading...
Searching...
No Matches
xiiMemoryStreamStorageInterface Class Referenceabstract

Instances of this class act as storage for memory streams. More...

#include <MemoryStream.h>

Inheritance diagram for xiiMemoryStreamStorageInterface:
[legend]

Public Member Functions

xiiUInt32 GetStorageSize32 () const
 Returns the number of bytes that are currently stored. Asserts that the stored amount is less than 4GB.
 
virtual xiiUInt64 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 xiiUInt64 GetHeapMemoryUsage () const =0
 Returns the amount of bytes that are currently allocated on the heap.
 
void ReadAll (xiiStreamReader &ref_stream, xiiUInt64 uiMaxBytes=xiiMath::MaxValue< xiiUInt64 >())
 Copies all data from the given stream into the storage.
 
virtual void Reserve (xiiUInt64 uiBytes)=0
 Reserves N bytes of storage.
 
virtual xiiResult CopyToStream (xiiStreamWriter &ref_stream) const =0
 Writes the entire content of the storage to the provided stream.
 
virtual xiiArrayPtr< const xiiUInt8 > GetContiguousMemoryRange (xiiUInt64 uiStartByte) const =0
 Returns a read-only xiiArrayPtr that represents a contiguous area in memory which starts at the given first byte.
 
virtual xiiArrayPtr< xiiUInt8 > GetContiguousMemoryRange (xiiUInt64 uiStartByte)=0
 Non-const overload of GetContiguousMemoryRange().
 

Friends

class xiiMemoryStreamReader
 
class xiiMemoryStreamWriter
 

Detailed Description

Instances of this class act as storage for memory streams.

Member Function Documentation

◆ Clear()

virtual void xiiMemoryStreamStorageInterface::Clear ( )
pure virtual

Clears the entire storage. All readers and writers must be reset to start from the beginning again.

Implemented in xiiDefaultMemoryStreamStorage, xiiMemoryStreamContainerStorage< CONTAINER >, xiiMemoryStreamContainerStorage< xiiHybridArray< xiiUInt8, 256 > >, and xiiMemoryStreamContainerWrapperStorage< CONTAINER >.

◆ Compact()

virtual void xiiMemoryStreamStorageInterface::Compact ( )
pure virtual

◆ CopyToStream()

virtual xiiResult xiiMemoryStreamStorageInterface::CopyToStream ( xiiStreamWriter & ref_stream) const
pure virtual

◆ GetContiguousMemoryRange() [1/2]

virtual xiiArrayPtr< const xiiUInt8 > xiiMemoryStreamStorageInterface::GetContiguousMemoryRange ( xiiUInt64 uiStartByte) const
pure virtual

Returns a read-only xiiArrayPtr 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 xiiDefaultMemoryStreamStorage, xiiMemoryStreamContainerStorage< CONTAINER >, xiiMemoryStreamContainerStorage< xiiHybridArray< xiiUInt8, 256 > >, and xiiMemoryStreamContainerWrapperStorage< CONTAINER >.

◆ GetContiguousMemoryRange() [2/2]

virtual xiiArrayPtr< xiiUInt8 > xiiMemoryStreamStorageInterface::GetContiguousMemoryRange ( xiiUInt64 uiStartByte)
pure virtual

◆ GetHeapMemoryUsage()

virtual xiiUInt64 xiiMemoryStreamStorageInterface::GetHeapMemoryUsage ( ) const
pure virtual

◆ GetStorageSize64()

virtual xiiUInt64 xiiMemoryStreamStorageInterface::GetStorageSize64 ( ) const
pure virtual

◆ Reserve()

virtual void xiiMemoryStreamStorageInterface::Reserve ( xiiUInt64 uiBytes)
pure virtual

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