From c51a61c0f0de65a3e64f589816a56f21ed4e8528 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 15 Aug 2021 17:14:06 -0700 Subject: Initial work on data streams --- core/src/Utils/IO/VectorIntegration.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 core/src/Utils/IO/VectorIntegration.hpp (limited to 'core/src/Utils/IO/VectorIntegration.hpp') diff --git a/core/src/Utils/IO/VectorIntegration.hpp b/core/src/Utils/IO/VectorIntegration.hpp new file mode 100644 index 0000000..b2c751c --- /dev/null +++ b/core/src/Utils/IO/VectorIntegration.hpp @@ -0,0 +1,28 @@ +#pragma once + +#include "Utils/IO/DataStream.hpp" + +#include + +template +void ReadFromDataStream(DataStream& s, std::vecetor& vec) +{ + s.Write((uint64_t)vec.size()); + for (auto& element : vec) { + // TODO + } +} + +template +void WriteToDataStream(DataStream& s, const std::vecetor& vec) +{ + uint64_t size; + s >> size; + + vec.clear(); + vec.reserve(size); + + for (uint64_t i = 0; i < size; ++i) { + // TODO + } +} -- cgit v1.2.3-70-g09d2