Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cValArray Struct Reference

#include <cValT.h>

Static Public Member Functions

template<class TYPE >
static bool IsFilledQty (const TYPE *pArray, ITERATE_t nBlocks, TYPE nFillValue) noexcept
 
template<class TYPE >
static bool IsFilledSize (const void *pArray, size_t nArraySizeBytes, TYPE nFillValue) noexcept
 
template<class TYPE >
static bool IsEqualQty (const TYPE *pArray1, const TYPE *pArray2, ITERATE_t nBlocks) noexcept
 
template<class TYPE >
static COMPARE_t CompareQty (const TYPE *pArray1, const TYPE *pArray2, ITERATE_t nBlocks) noexcept
 
template<class TYPE >
static void FillQty (TYPE *pArray, ITERATE_t nBlocks, TYPE nFillValue=0) noexcept
 
template<class TYPE >
static void ZeroQty (TYPE *pArray, ITERATE_t nBlocks) noexcept
 
template<class TYPE >
static void FillSize (void *pArray, size_t nArraySizeBytes, TYPE nFillValue) noexcept
 
template<class TYPE >
static void CopyQty (TYPE *pDst, const TYPE *pSrc, ITERATE_t nBlocks) noexcept
 
template<class TYPE >
static void CopyQtyRev (TYPE *pDst, const TYPE *pSrc, ITERATE_t nBlocks) noexcept
 
template<class TYPE >
static void ReverseArray (TYPE *pArray, size_t nArraySizeBytes) noexcept
 
static void __stdcall ReverseArrayBlocks (void *pArray, size_t nArraySizeBytes, size_t iBlockSize)
 
template<>
void FillQty (BYTE *pData, ITERATE_t nBlocks, BYTE bFill) noexcept
 
template<>
void FillSize (void *pData, size_t nSizeBlock, BYTE bFill) noexcept
 

Detailed Description

Helper functions for array of values of some TYPE in memory.

Note
optimizations can be made if we know we are working on larger native types over treating the same things as bytes.

Member Function Documentation

◆ CompareQty()

template<class TYPE >
static COMPARE_t Gray::cValArray::CompareQty ( const TYPE pArray1,
const TYPE pArray2,
ITERATE_t  nBlocks 
)
inlinestaticnoexcept

Compare 2 arrays of a TYPE. like memcmp.

◆ CopyQty()

template<class TYPE >
static void Gray::cValArray::CopyQty ( TYPE pDst,
const TYPE pSrc,
ITERATE_t  nBlocks 
)
inlinestaticnoexcept

Forward Copy array of values. like memcpy.

◆ CopyQtyRev()

template<class TYPE >
static void Gray::cValArray::CopyQtyRev ( TYPE pDst,
const TYPE pSrc,
ITERATE_t  nBlocks 
)
inlinestaticnoexcept

Reverse Copy array of values. like memmove.

◆ FillQty() [1/2]

template<>
void Gray::cValArray::FillQty ( BYTE *  pData,
ITERATE_t  nBlocks,
BYTE  bFill 
)
inlinestaticnoexcept

FillMemory BYTEs like memset()

◆ FillQty() [2/2]

template<class TYPE >
static void Gray::cValArray::FillQty ( TYPE pArray,
ITERATE_t  nBlocks,
TYPE  nFillValue = 0 
)
inlinestaticnoexcept

fill an array with a repeating TYPE nFillValue. Ignore negative value for nBlocks

◆ FillSize() [1/2]

template<class TYPE >
static void Gray::cValArray::FillSize ( void *  pArray,
size_t  nArraySizeBytes,
TYPE  nFillValue 
)
inlinestaticnoexcept

Fill a block of memory with a repeating TYPE nFillValue by size_t not quantity. Similar to the native memset() FillMemory If TYPE is not BYTE this may leave unaligned block at the end.

◆ FillSize() [2/2]

template<>
void Gray::cValArray::FillSize ( void *  pData,
size_t  nSizeBlock,
BYTE  bFill 
)
inlinestaticnoexcept

FillMemory BYTEs like memset()

◆ IsEqualQty()

template<class TYPE >
static bool Gray::cValArray::IsEqualQty ( const TYPE pArray1,
const TYPE pArray2,
ITERATE_t  nBlocks 
)
inlinestaticnoexcept

Test 2 arrays of a TYPE. like memcmp.

◆ IsFilledQty()

template<class TYPE >
static bool Gray::cValArray::IsFilledQty ( const TYPE pArray,
ITERATE_t  nBlocks,
TYPE  nFillValue 
)
inlinestaticnoexcept

Is this array filled with a repeating value ?

◆ IsFilledSize()

template<class TYPE >
static bool Gray::cValArray::IsFilledSize ( const void *  pArray,
size_t  nArraySizeBytes,
TYPE  nFillValue 
)
inlinestaticnoexcept

Is this array filled with a repeating value ? _countof()

◆ ReverseArray()

template<class TYPE >
static void Gray::cValArray::ReverseArray ( TYPE pArray,
size_t  nArraySizeBytes 
)
inlinestaticnoexcept

reverse the order of an array of a TYPE. similar to cMem::ReverseArrayBlocks but iBlockSize==sizeof(TYPE) TYPE = BYTE = reverse bytes in a block. similar to htonl(), etc. Use ReverseType<> if TYPE = BYTE and nArraySizeBytes <= largest intrinsic type size?

◆ ReverseArrayBlocks()

void GRAYCALL Gray::cValArray::ReverseArrayBlocks ( void *  pArray,
size_t  nArraySizeBytes,
size_t  iBlockSize 
)
static

reverse the order of an array of blocks/objects. similar to ReverseArray() but without the TYPE. where nBlockSize == sizeof(TYPE)

  • nArraySizeBytes = the size of the whole array in bytes. nBlockSize = size of array element in bytes.

◆ ZeroQty()

template<class TYPE >
static void Gray::cValArray::ZeroQty ( TYPE pArray,
ITERATE_t  nBlocks 
)
inlinestaticnoexcept

fill an array with a repeating TYPE 0.


The documentation for this struct was generated from the following files: