17 #include <pia/clone/clone_definitions.h> 35 template <
typename Type_>
51 static void Serialize(
void* pBuffer,
const Type& value)
54 if (reinterpret_cast<u32>(pBuffer) % __alignof(Type) != 0)
56 OSBlockMove(pBuffer, &value,
sizeof(Type), FALSE);
60 *
reinterpret_cast<Type*
>(pBuffer) = value;
63 nn::nstd::MemCpy(pBuffer, &value,
sizeof(Type));
65 *
reinterpret_cast<Type*
>(pBuffer) = value;
77 static void Deserialize(Type* pValue,
const void* cpData)
80 if (reinterpret_cast<u32>(cpData) % __alignof(Type) != 0)
82 OSBlockMove(pValue, cpData,
sizeof(Type), FALSE);
86 *pValue = *
reinterpret_cast<const Type*
>(cpData);
89 nn::nstd::MemCpy(pValue, cpData,
sizeof(Type));
91 *pValue = *
reinterpret_cast<const Type*
>(cpData);
103 static size_t GetSize()
115 static const size_t SIZE =
sizeof(
Type);
Serializes the source data structure without changes.
Definition: clone_StraightSerializePolicy.h:36
Type_ Type
Defines the type of the data to be serialized.
Definition: clone_StraightSerializePolicy.h:42