6 #ifndef IFM3D_DESERIALIZE_UTILS_HPP
7 #define IFM3D_DESERIALIZE_UTILS_HPP
12 template <
typename T,
size_t n>
14 mkarray(
const uint8_t* data, std::array<T, n>& arr)
16 int element_index = 0;
19 val = mkval<T>(data +
sizeof(T) * element_index);
24 template <
typename T,
size_t num_of_parameter>
29 Read(
const uint8_t*
data,
size_t size)
31 if (size < (num_of_parameter *
sizeof(T)))
35 const uint8_t* start_ptr =
data;
36 mkarray<T, num_of_parameter>(start_ptr, this->data);
42 std::array<T, num_of_parameter>
data;
45 Deserialize(
const Buffer& o3d_buffer)
49 data.Read(o3d_buffer.
ptr<uint8_t>(0), o3d_buffer.
size());
56 #endif // IFM3D_DESERIALIZE_UTILS_HPP