gwnavruntime/blob/blobarray.h Source File
Go to the documentation of this file.
9 #ifndef Navigation_BlobArray_H
10 #define Navigation_BlobArray_H
61 SwapEndianness(e,
self.m_count);
62 SwapEndianness(e,
self.m_offset);
64 T* values =
self.GetValues();
65 for (
KyUInt32 i = 0; i <
self.m_count; ++i)
66 SwapEndianness(e, values[i]);
72 T* values =
self.GetValues();
74 SwapEndianness(e,
self.m_count);
75 SwapEndianness(e,
self.m_offset);
78 SwapEndianness(e, values[i]);
85 template <
class ArrayT,
class BlobArrayT>
86 void InitArrayFromBlobArray_Assign(ArrayT& kyArray,
const BlobArrayT& blobArray)
88 const typename BlobArrayT::ValueType* blobValues = blobArray.GetValues();
89 KyUInt32 blobValuesCount = blobArray.GetCount();
91 kyArray.Resize(blobValuesCount);
92 for (
KyUInt32 i = 0; i < blobValuesCount; ++i)
93 kyArray[i] = blobValues[i];
98 template <
class ArrayT,
class BlobArrayT>
99 void InitArrayFromBlobArray_InitFromBlob(ArrayT& kyArray,
const BlobArrayT& blobArray)
101 const typename BlobArrayT::ValueType* blobValues = blobArray.GetValues();
102 KyUInt32 blobValuesCount = blobArray.GetCount();
104 kyArray.Resize(blobValuesCount);
105 for (
KyUInt32 i = 0; i < blobValuesCount; ++i)
106 kyArray[i].InitFromBlob(blobValues[i]);
110 template <
class ArrayT,
class BlobArrayT>
111 void InitArrayFromBlobArray_String(ArrayT& kyArray,
const BlobArrayT& blobArray)
113 const typename BlobArrayT::ValueType* blobValues = blobArray.GetValues();
114 KyUInt32 blobValuesCount = blobArray.GetCount();
116 kyArray.Resize(blobValuesCount);
117 for (
KyUInt32 i = 0; i < blobValuesCount; ++i)
118 kyArray[i] = blobValues[i].GetValues();
KyInt32 m_offset
Set by BLOB_ARRAY and BLOB_ARRAY_COPY during BaseBlobBuilder::DoBuild(). Do not modify.
Definition: blobarray.h:56
The same endianness type as the current platform.
Definition: endianness.h:37
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
A BlobArray an array that is compatible with the blob serialization framework.
Definition: blobarray.h:28
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
KyUInt32 m_count
The number of elements in this BlobArray. Set by BLOB_ARRAY and BLOB_ARRAY_COPY during BaseBlobBuilde...
Definition: blobarray.h:55
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
const T * GetValues() const
Retrieves a const pointer to the data stored in this array.
Definition: blobarray.h:44