16 #include <nn/pia/clone/clone_Definitions.h>
32 template <
typename Type_>
33 class StraightSerializePolicy
48 static void Serialize(
void* pBuffer,
const Type& value)
51 if (reinterpret_cast<uint32_t>(pBuffer) % __alignof(Type) != 0)
53 OSBlockMove(pBuffer, &value,
sizeof(Type), FALSE);
57 *
reinterpret_cast<Type*
>(pBuffer) = value;
60 nn::nstd::MemCpy(pBuffer, &value,
sizeof(Type));
61 #elif NN_PIA_NINTENDOSDK
62 memcpy(pBuffer, &value,
sizeof(Type));
64 *
reinterpret_cast<Type*
>(pBuffer) = value;
76 static void Deserialize(Type* pValue,
const void* cpData)
79 if (reinterpret_cast<uint32_t>(cpData) % __alignof(Type) != 0)
81 OSBlockMove(pValue, cpData,
sizeof(Type), FALSE);
85 *pValue = *
reinterpret_cast<const Type*
>(cpData);
88 nn::nstd::MemCpy(pValue, cpData,
sizeof(Type));
89 #elif NN_PIA_NINTENDOSDK
90 memcpy(pValue, cpData,
sizeof(Type));
92 *pValue = *
reinterpret_cast<const Type*
>(cpData);
104 static uint32_t GetSize()
116 static const uint32_t Size =
sizeof(Type);