Murl::MutableData Class Reference

The MutableData object holds a pointer and size information to a mutable memory data location. More...

#include "murl_data.h"

Inheritance diagram for Murl::MutableData:

Public Member Functions

 MutableData ()
 The default constructor.
 
 MutableData (void *data, UInt64 byteSize)
 The constructor taking data and byte size. More...
 
 ~MutableData () override
 The destructor.
 
template<class DataType >
DataType * GetMutableData () const
 Get the pointer to the mutable memory data location. More...
 
UInt8GetMutableData () const
 Get the pointer to the mutable memory data location. More...
 
template<class DataType >
DataType * GetMutableData (UInt64 byteOffset) const
 Get the pointer to the mutable memory data location including a byte offset. More...
 
UInt8GetMutableData (UInt64 byteOffset) const
 Get the pointer to the mutable memory data location including a byte offset. More...
 
UInt64 CopyDataTo (MutableData &destination, UInt64 byteOffset) const
 Copy the memory data to a destination data object. More...
 
UInt64 CopyFrom (const void *source, UInt64 byteSize, UInt64 byteOffset) const
 Copy the memory data from a source memory location. More...
 
UInt64 CopyDataFrom (const ConstData &source, UInt64 byteOffset) const
 Copy the memory data from a source data object. More...
 
- Public Member Functions inherited from Murl::ConstData
 ConstData ()
 The default constructor.
 
 ConstData (const void *data, const UInt64 byteSize)
 The constructor taking data and byte size. More...
 
 ~ConstData () override=default
 The destructor.
 
virtual void ReleaseData ()
 Release the data, set data pointer to null and size to zero.
 
virtual void AssignData (const void *data, UInt64 byteSize)
 Assign a memory data location. More...
 
Bool IsEmpty () const
 Check if the data object is empty. More...
 
UInt32 GetByteSize32 () const
 Get the 32 bit byte size of the memory data location. More...
 
UInt64 GetByteSize () const
 Get the byte size of the memory data location. More...
 
template<class DataType >
const DataType * GetData () const
 Get the pointer to the memory data location. More...
 
const UInt8GetData () const
 Get the pointer to the memory data location. More...
 
template<class DataType >
const DataType * GetData (UInt64 byteOffset) const
 Get the pointer to the memory data location including a byte offset. More...
 
const UInt8GetData (UInt64 byteOffset) const
 Get the pointer to the memory data location including a byte offset. More...
 
UInt64 CopyTo (void *destination, UInt64 byteSize, UInt64 byteOffset) const
 Copy the memory data to a destination. More...
 
String GetString () const
 Get a string from the memory data. More...
 
String GetString (UInt64 length) const
 Get a string from the memory data with length. More...
 
UInt64 GetHashValue () const
 Calculate the data hash value. More...
 
bool operator== (const ConstData &rhs) const
 Equal to comparison operator. More...
 
bool operator!= (const ConstData &rhs) const
 Not equal to comparison operator. More...
 
bool operator== (const String &rhs) const
 Equal to comparison operator with string. More...
 
bool operator!= (const String &rhs) const
 Not equal to comparison operator with string. More...
 
void CollectObjectStatistics (IObjectStatistics *stat) const override
 Implementation of IStatisticsObject::CollectObjectStatistics(). More...
 

Detailed Description

The MutableData object holds a pointer and size information to a mutable memory data location.

Constructor & Destructor Documentation

◆ MutableData()

Murl::MutableData::MutableData ( void *  data,
UInt64  byteSize 
)
inline

The constructor taking data and byte size.

Parameters
dataPointer to the memory data location.
byteSizeByte size of the memory data location.

Member Function Documentation

◆ GetMutableData() [1/4]

template<class DataType >
DataType* Murl::MutableData::GetMutableData ( ) const
inline

Get the pointer to the mutable memory data location.

Template Parameters
DataTypeThe type of the returned pointer.
Returns
The pointer to the mutable memory data location.

◆ GetMutableData() [2/4]

UInt8* Murl::MutableData::GetMutableData ( ) const
inline

Get the pointer to the mutable memory data location.

Returns
The pointer to the mutable memory data location.

◆ GetMutableData() [3/4]

template<class DataType >
DataType* Murl::MutableData::GetMutableData ( UInt64  byteOffset) const
inline

Get the pointer to the mutable memory data location including a byte offset.

A valid byte offset is in range [0 .. GetByteSize() - 1].

Template Parameters
DataTypeThe type of the returned pointer.
Parameters
byteOffsetThe byte offset.
Returns
The pointer to the mutable memory data location or null if the byte offset is out of range.

◆ GetMutableData() [4/4]

UInt8* Murl::MutableData::GetMutableData ( UInt64  byteOffset) const
inline

Get the pointer to the mutable memory data location including a byte offset.

A valid byte offset is in range [0 .. GetByteSize() - 1].

Parameters
byteOffsetThe byte offset.
Returns
The pointer to the mutable memory data location or null if the byte offset is out of range.

◆ CopyDataTo()

UInt64 Murl::MutableData::CopyDataTo ( MutableData destination,
UInt64  byteOffset 
) const
inline

Copy the memory data to a destination data object.

The destination data object must have already assigned memory. A valid byte offset is in range [0 .. GetByteSize() - 1].

Parameters
destinationThe the destination data object.
byteOffsetThe source byte offset.
Returns
The number of bytes copied to the destination.

References Murl::ConstData::CopyTo().

◆ CopyFrom()

UInt64 Murl::MutableData::CopyFrom ( const void *  source,
UInt64  byteSize,
UInt64  byteOffset 
) const
inline

Copy the memory data from a source memory location.

The data object must have already assigned memory. A valid byte offset is in range [0 .. GetByteSize() - 1].

Parameters
sourceThe pointer to the source memory.
byteSizeThe source byte size.
byteOffsetThe destination byte offset.
Returns
The number of bytes copied to the destination.

References Murl::Util::MemCopy().

Referenced by Murl::BufferedData::AppendData(), and CopyDataFrom().

◆ CopyDataFrom()

UInt64 Murl::MutableData::CopyDataFrom ( const ConstData source,
UInt64  byteOffset 
) const
inline

Copy the memory data from a source data object.

The data object must have already assigned memory. A valid byte offset is in range [0 .. GetByteSize() - 1].

Parameters
sourceThe source data object.
byteOffsetThe destination byte offset.
Returns
The number of bytes copied to the destination.

References CopyFrom().


The documentation for this class was generated from the following file:
  • murl_data.h


Copyright © 2011-2024 Spraylight GmbH.