XII Release 0.1.0
Loading...
Searching...
No Matches
xiiMemoryStreamContainerWrapperStorage< CONTAINER > Class Template Reference

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

#include <MemoryStream.h>

Inheritance diagram for xiiMemoryStreamContainerWrapperStorage< CONTAINER >:
[legend]

Public Member Functions

 xiiMemoryStreamContainerWrapperStorage (CONTAINER *pContainer)
 
virtual xiiUInt64 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 xiiUInt64 GetHeapMemoryUsage () const override
 Returns the amount of bytes that are currently allocated on the heap.
 
virtual void Reserve (xiiUInt64 uiBytes) override
 Reserves N bytes of storage.
 
virtual xiiResult CopyToStream (xiiStreamWriter &ref_stream) const override
 Writes the entire content of the storage to the provided stream.
 
virtual xiiArrayPtr< const xiiUInt8 > GetContiguousMemoryRange (xiiUInt64 uiStartByte) const override
 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) override
 Non-const overload of GetContiguousMemoryRange().
 
- Public Member Functions inherited from xiiMemoryStreamStorageInterface
xiiUInt32 GetStorageSize32 () const
 Returns the number of bytes that are currently stored. Asserts that the stored amount is less than 4GB.
 
void ReadAll (xiiStreamReader &ref_stream, xiiUInt64 uiMaxBytes=xiiMath::MaxValue< xiiUInt64 >())
 Copies all data from the given stream into the storage.
 

Detailed Description

template<typename CONTAINER>
class xiiMemoryStreamContainerWrapperStorage< CONTAINER >

Wrapper around an existing container to implement xiiMemoryStreamStorageInterface.

Member Function Documentation

◆ Clear()

template<typename CONTAINER>
virtual void xiiMemoryStreamContainerWrapperStorage< CONTAINER >::Clear ( )
inlineoverridevirtual

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

Implements xiiMemoryStreamStorageInterface.

◆ Compact()

template<typename CONTAINER>
virtual void xiiMemoryStreamContainerWrapperStorage< CONTAINER >::Compact ( )
inlineoverridevirtual

Deallocates any allocated memory that's not needed to hold the currently stored data.

Implements xiiMemoryStreamStorageInterface.

◆ CopyToStream()

template<typename CONTAINER>
virtual xiiResult xiiMemoryStreamContainerWrapperStorage< CONTAINER >::CopyToStream ( xiiStreamWriter & ref_stream) const
inlineoverridevirtual

Writes the entire content of the storage to the provided stream.

Implements xiiMemoryStreamStorageInterface.

◆ GetContiguousMemoryRange() [1/2]

template<typename CONTAINER>
virtual xiiArrayPtr< const xiiUInt8 > xiiMemoryStreamContainerWrapperStorage< CONTAINER >::GetContiguousMemoryRange ( xiiUInt64 uiStartByte) const
inlineoverridevirtual

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.

Implements xiiMemoryStreamStorageInterface.

◆ GetContiguousMemoryRange() [2/2]

template<typename CONTAINER>
virtual xiiArrayPtr< xiiUInt8 > xiiMemoryStreamContainerWrapperStorage< CONTAINER >::GetContiguousMemoryRange ( xiiUInt64 uiStartByte)
inlineoverridevirtual

Non-const overload of GetContiguousMemoryRange().

Implements xiiMemoryStreamStorageInterface.

◆ GetHeapMemoryUsage()

template<typename CONTAINER>
virtual xiiUInt64 xiiMemoryStreamContainerWrapperStorage< CONTAINER >::GetHeapMemoryUsage ( ) const
inlineoverridevirtual

Returns the amount of bytes that are currently allocated on the heap.

Implements xiiMemoryStreamStorageInterface.

◆ GetStorageSize64()

template<typename CONTAINER>
virtual xiiUInt64 xiiMemoryStreamContainerWrapperStorage< CONTAINER >::GetStorageSize64 ( ) const
inlineoverridevirtual

Returns the number of bytes that are currently stored.

Implements xiiMemoryStreamStorageInterface.

◆ Reserve()

template<typename CONTAINER>
virtual void xiiMemoryStreamContainerWrapperStorage< CONTAINER >::Reserve ( xiiUInt64 uiBytes)
inlineoverridevirtual

Reserves N bytes of storage.

Implements xiiMemoryStreamStorageInterface.

◆ SetInternalSize()

template<typename CONTAINER>
virtual void xiiMemoryStreamContainerWrapperStorage< CONTAINER >::SetInternalSize ( xiiUInt64 uiSize)
inlineoverrideprivatevirtual

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