3 #include "Serializing/Core/SerializerStream.h"
19 template<
typename Type =
int,
bool IsH
idden = false,
typename TSize = u
int,
typename T = std::vector<Type>>
31 template<
typename TCopy = Type,
typename std::enable_if_t<std::is_base_of_v<Serializing::IField, TCopy>> * =
nullptr>
46 template<
typename TCopy = Type,
typename std::enable_if_t<std::is_base_of_v<Serializing::IStruct, TCopy>> * =
nullptr>
60 template<
typename TCopy = Type,
61 typename std::enable_if_t<!std::is_base_of_v<Serializing::IField, TCopy>> * =
nullptr,
62 typename std::enable_if_t<!std::is_base_of_v<Serializing::IStruct, TCopy>> * =
nullptr>
64 for (
const TCopy &tType: this->
m_tValue) {
65 i_oStream.
push<TCopy>(tType);
74 i_oStream.
push<TSize>(
static_cast<TSize
>(this->
m_tValue.size()));
75 this->_serialize(i_oStream);
90 template<
typename TCopy = Type,
typename std::enable_if_t<std::is_base_of_v<Serializing::IField, TCopy>> * =
nullptr>
92 for (; i_nSize > 0; i_nSize--) {
107 template<
typename TCopy = Type,
typename std::enable_if_t<std::is_base_of_v<Serializing::IStruct, TCopy>> * =
nullptr>
109 for (; i_nSize > 0; i_nSize--) {
123 template<
typename TCopy = Type,
124 typename std::enable_if_t<!std::is_base_of_v<Serializing::IField, TCopy>> * =
nullptr,
125 typename std::enable_if_t<!std::is_base_of_v<Serializing::IStruct, TCopy>> * =
nullptr>
127 for (; i_nSize > 0; i_nSize--) {
128 this->
m_tValue.push_back(i_oStream.get<Type>());
137 const TSize nSize = i_oStream.
get<TSize>();
138 this->
m_tValue.reserve(nSize > 30 ? 30 : nSize);
140 this->_deserialize(i_oStream, nSize);
145 CreateSerializeOperators(T, IsHidden);
A class for reading data from a buffer. This class provides functionality to read data from a buffer....
Definition: ReadStream.h:37
T get(const size_t i_nPosition, const bool i_fSetPosition)
Reads a value of type T from the buffer.
Definition: ReadStream.h:344
A class for writing data to a buffer. This class provides functionality to write data to a buffer....
Definition: WriteStream.h:42
void push(const void *i_pBuffer, size_t i_nSize)
Pushes the specified data to the buffer.
Definition: WriteStream.cpp:30
Template class representing a data field.
Definition: SerializableData.h:86
bool doDeserialize(IO::CReadStream &i_oStream)
Deserializes the data from a read stream.
Definition: SerializableData.h:117
bool doSerialize(IO::CWriteStream &i_oStream) const
Serializes the data to a write stream.
Definition: SerializableData.h:97
T m_tValue
The value.
Definition: SerializableData.h:78
A class representing a vector for serialization.
Definition: SerializableVector.h:20
The namespace encapsulating serializing related functionality in the Devel framework.
bool SerializeStream(const T &i_oStruct, IO::CWriteStream &i_oStream)
Serializes a struct to a write stream.
Definition: SerializerStream.h:20
bool DeserializeStream(T &i_oStruct, IO::CReadStream &i_oStream, size_t i_nStructSize=sizeof(T))
Deserializes a struct from a read stream.
Definition: SerializerStream.h:39