The ConstData object holds a pointer and size information to a read-only memory data location. More...
#include "murl_data.h"
Public Member Functions | |
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 UInt8 * | GetData () 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 UInt8 * | GetData (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 ConstData object holds a pointer and size information to a read-only memory data location.
see also Data, BufferedData
Constructor & Destructor Documentation
◆ ConstData()
|
inline |
The constructor taking data and byte size.
- Parameters
-
data Pointer to the memory data location. byteSize Byte size of the memory data location.
Member Function Documentation
◆ AssignData()
|
inlinevirtual |
Assign a memory data location.
- Parameters
-
data Pointer to the memory data location. byteSize Byte size of the memory data location.
Reimplemented in Murl::BufferedData, and Murl::Data.
◆ IsEmpty()
|
inline |
Check if the data object is empty.
- Returns
- true if the data pointer is null.
◆ GetByteSize32()
|
inline |
Get the 32 bit byte size of the memory data location.
- Returns
- The 32 bit byte size of the memory data location or zero if the memory data byte size does not fit into 32 bit.
◆ GetByteSize()
|
inline |
Get the byte size of the memory data location.
- Returns
- The byte size of the memory data location.
◆ GetData() [1/4]
|
inline |
Get the pointer to the memory data location.
- Template Parameters
-
DataType The type of the returned pointer.
- Returns
- The pointer to the memory data location.
◆ GetData() [2/4]
|
inline |
Get the pointer to the memory data location.
- Returns
- The pointer to the memory data location.
◆ GetData() [3/4]
|
inline |
Get the pointer to the memory data location including a byte offset.
A valid byte offset is in range [0 .. GetByteSize() - 1].
- Template Parameters
-
DataType The type of the returned pointer.
- Parameters
-
byteOffset The byte offset.
- Returns
- The pointer to the memory data location or null if the byte offset is out of range.
◆ GetData() [4/4]
Get the pointer to the memory data location including a byte offset.
A valid byte offset is in range [0 .. GetByteSize() - 1].
- Parameters
-
byteOffset The byte offset.
- Returns
- The pointer to the memory data location or null if the byte offset is out of range.
◆ CopyTo()
|
inline |
Copy the memory data to a destination.
A valid byte offset is in range [0 .. GetByteSize() - 1].
- Parameters
-
destination The pointer to the destination memory. byteSize The destination byte size. byteOffset The source byte offset.
- Returns
- The number of bytes copied to the destination.
References Murl::Util::MemCopy().
Referenced by Murl::MutableData::CopyDataTo().
◆ GetString() [1/2]
|
inline |
Get a string from the memory data.
(!) This method does not take care of zero termination.
- Returns
- The string object containing the memory data.
◆ GetString() [2/2]
Get a string from the memory data with length.
(!) This method does not take care of zero termination.
- Parameters
-
length The length of the string.
- Returns
- The string object containing the memory data.
◆ GetHashValue()
|
inline |
Calculate the data hash value.
- Returns
- The hash value.
References Murl::Util::Hash::GetMemoryHashValue().
◆ operator==() [1/2]
|
inline |
Equal to comparison operator.
- Parameters
-
rhs The right hand side data to compare.
- Returns
- true if the memory bytes are equal.
References Murl::Util::MemCompare().
◆ operator!=() [1/2]
|
inline |
Not equal to comparison operator.
- Parameters
-
rhs The right hand side data to compare.
- Returns
- true if the memory bytes are not equal.
◆ operator==() [2/2]
|
inline |
Equal to comparison operator with string.
- Parameters
-
rhs The right hand side string to compare.
- Returns
- true if the memory and string bytes are equal.
References Murl::String::Begin(), Murl::String::GetLength(), and Murl::Util::MemCompare().
◆ operator!=() [2/2]
|
inline |
Not equal to comparison operator with string.
- Parameters
-
rhs The right hand side string to compare.
- Returns
- true if the memory and string bytes are not equal.
◆ CollectObjectStatistics()
|
inlineoverride |
Implementation of IStatisticsObject::CollectObjectStatistics().
- Parameters
-
stat The object statistics container.
References Murl::IEnums::MEMORY_TYPE_HEAP.
The documentation for this class was generated from the following file:
- murl_data.h