diff options
author | rtk0c <[email protected]> | 2021-08-15 21:12:35 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-08-15 21:12:35 -0700 |
commit | 87b964591c9a93146bd43e8813387392f8520337 (patch) | |
tree | 6e9db197c7fcd584acbcd6655854a3a8612382b9 /core/src/Utils/IO/VectorIntegration.hpp | |
parent | b79a244d76c66287c6228e3845aa3af91a847f5d (diff) |
Turn IO adapter's mechanism from function overload into structs that are given by the user
Diffstat (limited to 'core/src/Utils/IO/VectorIntegration.hpp')
-rw-r--r-- | core/src/Utils/IO/VectorIntegration.hpp | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/core/src/Utils/IO/VectorIntegration.hpp b/core/src/Utils/IO/VectorIntegration.hpp index 45929ed..ff6e3a8 100644 --- a/core/src/Utils/IO/VectorIntegration.hpp +++ b/core/src/Utils/IO/VectorIntegration.hpp @@ -2,27 +2,30 @@ #include <vector> -namespace DataStreamIntegrations { -template <class TElement> -void ReadFromDataStream(DataStream& s, std::vecetor<TElement>& vec) +namespace DataStreamAdapters { +struct Vector { - s.Write((uint64_t)vec.size()); - for (auto& element : vec) { - // TODO + template <class TElement> + void ReadFromDataStream(DataStream& s, std::vecetor<TElement>& vec) + { + s.Write((uint64_t)vec.size()); + for (auto& element : vec) { + // TODO + } } -} -template <class TElement> -void WriteToDataStream(DataStream& s, const std::vecetor<TElement>& vec) -{ - uint64_t size; - s >> size; + template <class TElement> + void WriteToDataStream(DataStream& s, const std::vecetor<TElement>& vec) + { + uint64_t size; + s >> size; - vec.clear(); - vec.reserve(size); + vec.clear(); + vec.reserve(size); - for (uint64_t i = 0; i < size; ++i) { - // TODO + for (uint64_t i = 0; i < size; ++i) { + // TODO + } } -} -} // namespace DataStreamIntegrations +}; +} // namespace DataStreamAdapters |