![]() |
Murl Engine API
Version 2025.1
|
Utility template functions (memory manipulation). More...
Modules | |
| Coding Functions | |
| Encoding / Decoding functions. | |
| Compression Functions | |
| Data compression functions. | |
| Sort Functions | |
| Sorting functions. | |
| String Functions | |
| String manipulation and test functions. | |
Functions | |
| template<class DataType > | |
| void | Murl::Util::Release (DataType &p) |
| Release an object. More... | |
| template<class DataType > | |
| void | Murl::Util::ReleaseArray (DataType &p) |
| Release an object array. More... | |
| template<class DestType , class SrcType > | |
| bool | Murl::Util::ReleaseType (SrcType &p) |
| Release an object of specified type. More... | |
| template<class DataType > | |
| void | Murl::Util::MemClear (DataType &memory) |
| Clear the memory of a concrete type. More... | |
| template<class DataType > | |
| void | Murl::Util::MemSet (DataType memory, UInt8 value, UInt64 byteSize) |
| Set memory bytes to a given value. More... | |
| template<class DestType , class SrcType > | |
| void | Murl::Util::MemCopy (DestType destination, const SrcType source, UInt64 byteSize) |
| Copy memory bytes. More... | |
| template<class DataType > | |
| void | Murl::Util::MemCopyArray (DataType &destination, const DataType &source) |
| Copy the memory of a concrete type. More... | |
| template<class DestType , class SrcType > | |
| void | Murl::Util::MemMove (DestType destination, const SrcType source, UInt64 byteSize) |
| Move overlapping memory bytes. More... | |
| template<class DataType1 , class DataType2 > | |
| SInt32 | Murl::Util::MemCompare (const DataType1 source1, const DataType2 source2, UInt64 byteSize) |
| Compare memory bytes. More... | |
| template<class DataType > | |
| void | Murl::Util::Fill (DataType *dstPtr, const DataType *dstEnd, const DataType &value) |
| Fill the memory of a concrete type. More... | |
| template<class ArrayType , class DataType > | |
| void | Murl::Util::FillArray (ArrayType &array, const DataType &value) |
| Set all C-array elements to a given value. More... | |
| template<class DataType > | |
| UInt32 | Murl::Util::Find (const DataType *memory, const DataType &item, const UInt32 maxElements) |
| Find the first appearance of a concrete type in memory. More... | |
| template<class ArrayType , class DataType > | |
| UInt32 | Murl::Util::FindArray (ArrayType &array, const DataType &item) |
| Find the first appearance of an item in a C-array. More... | |
| template<class DataType > | |
| void | Murl::Util::Swap (DataType &a, DataType &b) |
| Swap two values. More... | |
| template<class DataType > | |
| DataType | Murl::Util::RoundToNextPowerOfTwo (DataType value) |
| Round a value to the next power of two. More... | |
| template<class DataType > | |
| Bool | Murl::Util::IsPowerOfTwo (DataType value) |
| Check if a given value equals a power of two. More... | |
| template<class DataType > | |
| DataType | Murl::Util::RoundToNextFourByteBoundary (DataType value) |
| Round a value to the next 4 byte boundary. More... | |
| template<class DataType > | |
| DataType | Murl::Util::RoundToNextEightByteBoundary (DataType value) |
| Round a value to the next 8 byte boundary. More... | |
| template<class DataType > | |
| DataType | Murl::Util::RoundToNextSixteenByteBoundary (DataType value) |
| Round a value to the next 16 byte boundary. More... | |
| template<class DataType > | |
| DataType | Murl::Util::RoundToRaster (DataType value, DataType raster, DataType &diff) |
| Round a value to the next raster and return the rounded value and the difference to the previous raster before rounding. More... | |
| template<class DataType > | |
| DataType | Murl::Util::RoundToRaster (DataType value, DataType raster) |
| Round a value to the next raster. More... | |
| template<class DataType > | |
| UInt32 | Murl::Util::GetNumberOfSetBits (DataType value) |
| Compute the number of set bits. More... | |
| template<class DataType > | |
| UInt32 | Murl::Util::GetNumberOfClearedBits (DataType value) |
| Compute the number of cleared bits. More... | |
| template<class DataType > | |
| UInt32 | Murl::Util::GetNumberOfDigits (DataType value, DataType base=10) |
| Compute the number of digits. More... | |
| const Data & | Murl::Util::StaticEmptyData () |
| Get a constant static empty data object. More... | |
| UInt64 | Murl::Util::SwapBytes (UInt64 value) |
| Swap all bytes of a 64 bit value. More... | |
| UInt32 | Murl::Util::SwapBytes (UInt32 value) |
| Swap all bytes of a 32 bit value. More... | |
| UInt16 | Murl::Util::SwapBytes (UInt16 value) |
| Swap all bytes of a 16 bit value. More... | |
| Bool | Murl::Util::IsDebugBuild () |
| Check if the engine was built using the debug configuration. More... | |
| Bool | Murl::Util::IsReleaseBuild () |
| Check if the engine was built using the release configuration. More... | |
Utility template functions (memory manipulation).
| void Murl::Util::Release | ( | DataType & | p | ) |
Release an object.
After destruction the object pointer is set to null.
| p | The reference to the object to delete. |
| void Murl::Util::ReleaseArray | ( | DataType & | p | ) |
Release an object array.
After destruction the object pointer is set to null.
| p | The reference to the object array to delete. |
| bool Murl::Util::ReleaseType | ( | SrcType & | p | ) |
Release an object of specified type.
The object is dynamic_cast'ed to the specified type. After destruction the object pointer is set to null.
| DestType | The type to dynamic_cast the object pointer to. |
| p | The reference to the object to delete. |
| void Murl::Util::MemClear | ( | DataType & | memory | ) |
Clear the memory of a concrete type.
| memory | A reference to the memory to clear. |
Set memory bytes to a given value.
| memory | The memory to set. |
| value | The byte value to write into the memory. |
| byteSize | The byte size of the memory location. |
| void Murl::Util::MemCopy | ( | DestType | destination, |
| const SrcType | source, | ||
| UInt64 | byteSize | ||
| ) |
Copy memory bytes.
| destination | The destination memory. |
| source | The source memory. |
| byteSize | The number of bytes to copy. |
| void Murl::Util::MemCopyArray | ( | DataType & | destination, |
| const DataType & | source | ||
| ) |
Copy the memory of a concrete type.
The source and destination memory must be the same type.
| destination | A reference to the destination memory. |
| source | A reference to the source memory. |
| void Murl::Util::MemMove | ( | DestType | destination, |
| const SrcType | source, | ||
| UInt64 | byteSize | ||
| ) |
Move overlapping memory bytes.
| destination | The destination memory. |
| source | The source memory. |
| byteSize | The number of bytes to move. |
| SInt32 Murl::Util::MemCompare | ( | const DataType1 | source1, |
| const DataType2 | source2, | ||
| UInt64 | byteSize | ||
| ) |
Compare memory bytes.
| source1 | The 1st source memory. |
| source2 | The 2nd source memory. |
| byteSize | The number of bytes to compare. |
| void Murl::Util::Fill | ( | DataType * | dstPtr, |
| const DataType * | dstEnd, | ||
| const DataType & | value | ||
| ) |
Fill the memory of a concrete type.
| dstPtr | The destination memory start pointer. |
| dstEnd | The destination memory end pointer. |
| value | The value to fill. |
| void Murl::Util::FillArray | ( | ArrayType & | array, |
| const DataType & | value | ||
| ) |
Set all C-array elements to a given value.
| array | A reference to the C-array to set. |
| value | The value to set for each array item. |
| UInt32 Murl::Util::Find | ( | const DataType * | memory, |
| const DataType & | item, | ||
| const UInt32 | maxElements | ||
| ) |
Find the first appearance of a concrete type in memory.
| memory | The source memory pointer. |
| item | The item to find. |
| maxElements | The maximum number of items to scan. |
| UInt32 Murl::Util::FindArray | ( | ArrayType & | array, |
| const DataType & | item | ||
| ) |
Find the first appearance of an item in a C-array.
| array | A reference to the C-array. |
| item | The item to find. |
| void Murl::Util::Swap | ( | DataType & | a, |
| DataType & | b | ||
| ) |
Swap two values.
| a | The 1st value to swap. |
| b | The 2nd value to swap. |
| DataType Murl::Util::RoundToNextPowerOfTwo | ( | DataType | value | ) |
Round a value to the next power of two.
| value | The value to round. |
| Bool Murl::Util::IsPowerOfTwo | ( | DataType | value | ) |
Check if a given value equals a power of two.
| value | The value to check. |
| DataType Murl::Util::RoundToNextFourByteBoundary | ( | DataType | value | ) |
Round a value to the next 4 byte boundary.
| value | The value to round. |
| DataType Murl::Util::RoundToNextEightByteBoundary | ( | DataType | value | ) |
Round a value to the next 8 byte boundary.
| value | The value to round. |
| DataType Murl::Util::RoundToNextSixteenByteBoundary | ( | DataType | value | ) |
Round a value to the next 16 byte boundary.
| value | The value to round. |
| DataType Murl::Util::RoundToRaster | ( | DataType | value, |
| DataType | raster, | ||
| DataType & | diff | ||
| ) |
Round a value to the next raster and return the rounded value and the difference to the previous raster before rounding.
| value | The value to round. |
| raster | The raster to round to. |
| diff | The difference return value. |
| DataType Murl::Util::RoundToRaster | ( | DataType | value, |
| DataType | raster | ||
| ) |
Round a value to the next raster.
| value | The value to round. |
| raster | The raster to round to. |
| UInt32 Murl::Util::GetNumberOfSetBits | ( | DataType | value | ) |
Compute the number of set bits.
| value | The value to count the set bits. |
| UInt32 Murl::Util::GetNumberOfClearedBits | ( | DataType | value | ) |
Compute the number of cleared bits.
| value | The value to count the cleared bits. |
| UInt32 Murl::Util::GetNumberOfDigits | ( | DataType | value, |
| DataType | base = 10 |
||
| ) |
Compute the number of digits.
| value | The value to compute the number of digits. |
| base | The base of the digits. |
| const Data& Murl::Util::StaticEmptyData | ( | ) |
Get a constant static empty data object.
Swap all bytes of a 64 bit value.
| value | The value to swap the bytes. |
Swap all bytes of a 32 bit value.
| value | The value to swap the bytes. |
Swap all bytes of a 16 bit value.
| value | The value to swap the bytes. |
|
inline |
Check if the engine was built using the debug configuration.
|
inline |
Check if the engine was built using the release configuration.