|
|
template<xiiConstructionMode mode, typename T> |
| XII_ALWAYS_INLINE void | Construct (T *pDestination, size_t uiCount) |
|
template<xiiConstructionMode mode, typename T> |
| XII_ALWAYS_INLINE xiiMemoryUtils::ConstructorFunction | MakeConstructorFunction () |
|
template<typename Destination, typename Source> |
| XII_ALWAYS_INLINE void | CopyConstruct (Destination *pDestination, const Source ©, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | CopyConstructArray (T *pDestination, const T *pSource, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE xiiMemoryUtils::CopyConstructorFunction | MakeCopyConstructorFunction () |
|
template<typename T> |
| XII_ALWAYS_INLINE void | MoveConstruct (T *pDestination, T &&source) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | MoveConstruct (T *pDestination, T *pSource, size_t uiCount) |
|
template<typename Destination, typename Source> |
| XII_ALWAYS_INLINE void | CopyOrMoveConstruct (Destination *pDestination, Source &&source) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | RelocateConstruct (T *pDestination, T *pSource, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | Destruct (T *pDestination, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE xiiMemoryUtils::DestructorFunction | MakeDestructorFunction () |
|
template<typename T> |
| XII_ALWAYS_INLINE void | Copy (T *pDestination, const T *pSource, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | CopyOverlapped (T *pDestination, const T *pSource, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | Relocate (T *pDestination, T *pSource, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | RelocateOverlapped (T *pDestination, T *pSource, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | Prepend (T *pDestination, const T &source, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | Prepend (T *pDestination, T &&source, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | Prepend (T *pDestination, const T *pSource, size_t uiSourceCount, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE bool | IsEqual (const T *a, const T *b, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | ZeroFill (T *pDestination, size_t uiCount) |
|
template<typename T, size_t N> |
| XII_ALWAYS_INLINE void | ZeroFillArray (T(&destination)[N]) |
|
template<typename T> |
| XII_ALWAYS_INLINE void | PatternFill (T *pDestination, xiiUInt8 uiBytePattern, size_t uiCount) |
|
template<typename T, size_t N> |
| XII_ALWAYS_INLINE void | PatternFillArray (T(&destination)[N], xiiUInt8 uiBytePattern) |
|
template<typename T> |
| XII_ALWAYS_INLINE xiiInt32 | Compare (const T *a, const T *b, size_t uiCount) |
|
template<typename T> |
| XII_ALWAYS_INLINE T * | AddByteOffset (T *pPtr, std::ptrdiff_t offset) |
|
template<typename T> |
| XII_ALWAYS_INLINE T * | AlignBackwards (T *pPtr, size_t uiAlignment) |
|
template<typename T> |
| XII_ALWAYS_INLINE T * | AlignForwards (T *pPtr, size_t uiAlignment) |
|
template<typename T> |
| XII_ALWAYS_INLINE T | AlignSize (T uiSize, T uiAlignment) |
|
template<typename T> |
| XII_ALWAYS_INLINE bool | IsAligned (const T *pPtr, size_t uiAlignment) |
|
template<typename T> |
| XII_ALWAYS_INLINE bool | IsSizeAligned (T uiSize, T uiAlignment) |
|
| template<xiiConstructionMode mode, typename T> |
| static void | Construct (T *pDestination, size_t uiCount=1) |
|
template<xiiConstructionMode mode, typename T> |
| static ConstructorFunction | MakeConstructorFunction () |
| | Returns a function pointer to construct an instance of T. Returns nullptr for trivial types.
|
|
template<typename Destination, typename Source> |
| static void | CopyConstruct (Destination *pDestination, const Source ©, size_t uiCount=1) |
| | Constructs uiCount objects of type T in a raw buffer at pDestination, by creating uiCount copies of copy.
|
| template<typename T> |
| static void | CopyConstructArray (T *pDestination, const T *pSource, size_t uiCount) |
|
template<typename T> |
| static CopyConstructorFunction | MakeCopyConstructorFunction () |
| | Returns a function pointer to copy construct an instance of T.
|
|
template<typename T> |
| static void | MoveConstruct (T *pDestination, T &&source) |
| | Constructs an object of type T in a raw buffer at pDestination, by using move construction from source.
|
| template<typename T> |
| static void | MoveConstruct (T *pDestination, T *pSource, size_t uiCount=1) |
| template<typename Destination, typename Source> |
| static void | CopyOrMoveConstruct (Destination *pDestination, Source &&source) |
| template<typename T> |
| static void | RelocateConstruct (T *pDestination, T *pSource, size_t uiCount=1) |
|
template<typename T> |
| static void | Destruct (T *pDestination, size_t uiCount=1) |
| | Destructs uiCount objects of type T at pDestination.
|
|
template<typename T> |
| static DestructorFunction | MakeDestructorFunction () |
| | Returns a function pointer to destruct an instance of T. Returns nullptr for POD-types.
|
| template<typename T> |
| static void | Copy (T *pDestination, const T *pSource, size_t uiCount=1) |
|
static void | RawByteCopy (void *pDestination, const void *pSource, size_t uiNumBytesToCopy) |
| | Copies exactly uiNumBytesToCopy from pSource to pDestination, independent of the involved types and their sizes.
|
| template<typename T> |
| static void | CopyOverlapped (T *pDestination, const T *pSource, size_t uiCount=1) |
|
template<typename T> |
| static void | Relocate (T *pDestination, T *pSource, size_t uiCount=1) |
| | Moves objects of type T from pSource to pDestination.
|
| template<typename T> |
| static void | RelocateOverlapped (T *pDestination, T *pSource, size_t uiCount=1) |
|
template<typename T> |
| static void | Prepend (T *pDestination, const T &source, size_t uiCount) |
| | Moves uiCount objects in pDestination by one object and copies source to the free space.
|
|
template<typename T> |
| static void | Prepend (T *pDestination, T &&source, size_t uiCount) |
| | Moves uiCount objects in pDestination by one object and moves source to the free space.
|
|
template<typename T> |
| static void | Prepend (T *pDestination, const T *pSource, size_t uiSourceCount, size_t uiCount) |
| | Moves uiCount objects in pDestination by uiSourceCount objects and copies source to the free space.
|
|
template<typename T> |
| static bool | IsEqual (const T *a, const T *b, size_t uiCount=1) |
| | Tests if objects of type T from pSource and pDestination are equal.
|
|
template<typename T> |
| static void | ZeroFill (T *pDestination, size_t uiCount=1) |
| | Zeros every byte in the provided memory buffer.
|
|
template<typename T, size_t N> |
| static void | ZeroFill (T(&destination)[N])=delete |
| | Overload to prevent confusing calling this on a single object or a static array of objects. Use ZeroFillArray() instead.
|
|
template<typename T, size_t N> |
| static void | ZeroFillArray (T(&destination)[N]) |
| | Zeros every byte in the provided memory buffer.
|
|
template<typename T> |
| static void | PatternFill (T *pDestination, xiiUInt8 uiBytePattern, size_t uiCount=1) |
| | Fills every byte of the provided buffer with the given value.
|
|
template<typename T, size_t N> |
| static void | PatternFill (T(&destination)[N], xiiUInt8 uiBytePattern)=delete |
| | Overload to prevent confusing calling this on a single object or a static array of objects. Use PatternFillArray() instead.
|
|
template<typename T, size_t N> |
| static void | PatternFillArray (T(&destination)[N], xiiUInt8 uiBytePattern) |
| | Fills every byte of the provided buffer with the given value.
|
|
template<typename T> |
| static xiiInt32 | Compare (const T *a, const T *b, size_t uiCount=1) |
| | Compares two buffers of raw memory byte wise.
|
|
static xiiInt32 | RawByteCompare (const void *a, const void *b, size_t uiNumBytesToCompare) |
| | Compares exactly uiNumBytesToCompare from a and b, independent of the involved types and their sizes.
|
| template<typename T> |
| static T * | AddByteOffset (T *pPtr, std::ptrdiff_t offset) |
|
template<typename T> |
| static T * | AlignBackwards (T *pPtr, size_t uiAlignment) |
| | Aligns the pointer ptr by moving its address backwards to the previous multiple of uiAlignment.
|
|
template<typename T> |
| static T * | AlignForwards (T *pPtr, size_t uiAlignment) |
| | Aligns the pointer ptr by moving its address forwards to the next multiple of uiAlignment.
|
|
template<typename T> |
| static T | AlignSize (T uiSize, T uiAlignment) |
| | Aligns the given size uiSize by rounding up to the next multiple of the size.
|
|
template<typename T> |
| static bool | IsAligned (const T *pPtr, size_t uiAlignment) |
| | Checks whether ptr is aligned to a memory address that is a multiple of uiAlignment.
|
|
template<typename T> |
| static bool | IsSizeAligned (T uiSize, T uiAlignment) |
| | Checks whether the given size is aligned.
|
| static void | ReserveLower4GBAddressSpace () |
| | Copyright (c) Theophilus Eriata. All Rights Reserved.
|
This class provides functions to work on raw memory.
The following concepts are realized: Copy: Copying a object from a to b means that two equivalent objects will exists in both a and b. Move: Moving an object from a to b means that the object will exist in b afterwards but a will be empty afterwards, but not destructed. This strictly requires an available move constructor (compile error otherwise). Relocate: Relocating an object from a to b means that the object will exist in b afterwards but will no longer exist in a, which means a will be moved if available or copied, but destructed afterwards in any case. Construct: Constructing assumes that the destination does not contain a valid object. Overlapped: The source and destination range may overlap for the operation to be performed. The above mentioned concepts can be combined, e.g. RelocateConstruct for relocating to an uninitialized buffer.