aboutsummaryrefslogtreecommitdiff
path: root/core/src/Utils/IO/UuidIntegration.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-08-15 21:12:35 -0700
committerrtk0c <[email protected]>2021-08-15 21:12:35 -0700
commit87b964591c9a93146bd43e8813387392f8520337 (patch)
tree6e9db197c7fcd584acbcd6655854a3a8612382b9 /core/src/Utils/IO/UuidIntegration.hpp
parentb79a244d76c66287c6228e3845aa3af91a847f5d (diff)
Turn IO adapter's mechanism from function overload into structs that are given by the user
Diffstat (limited to 'core/src/Utils/IO/UuidIntegration.hpp')
-rw-r--r--core/src/Utils/IO/UuidIntegration.hpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/core/src/Utils/IO/UuidIntegration.hpp b/core/src/Utils/IO/UuidIntegration.hpp
index 9cba4b1..b6ca062 100644
--- a/core/src/Utils/IO/UuidIntegration.hpp
+++ b/core/src/Utils/IO/UuidIntegration.hpp
@@ -1,22 +1,26 @@
#pragma once
-#include <uuid/uuid.h>
+#include "Utils/UUID.hpp"
+
#include <cstddef>
#include <cstdint>
#include <iterator>
-namespace DataStreamIntegrations {
-void ReadFromDataStream(DataStream& s, uuids::uuid& uuid)
+namespace DataStreamAdapters {
+struct Uuid
{
- uint8_t buffer[16];
- s.ReadBytes(16, buffer);
+ void ReadFromDataStream(DataStream& s, uuids::uuid& uuid)
+ {
+ uint8_t buffer[16];
+ s.ReadBytes(16, buffer);
- uuid = uuids::uuid(gsl::span<uint8_t, 16>{ buffer });
-}
+ uuid = uuids::uuid(gsl::span<uint8_t, 16>{ buffer });
+ }
-void WriteToDataStream(DataStream& s, const uuids::uuid& uuid)
-{
- auto gslSpan = uuid.as_bytes();
- s.WriteBytes(gslSpan.size(), gslSpan.data());
-}
-} // namespace DataStreamIntegrations
+ void WriteToDataStream(DataStream& s, const uuids::uuid& uuid)
+ {
+ auto gslSpan = uuid.as_bytes();
+ s.WriteBytes(gslSpan.size(), gslSpan.data());
+ }
+};
+} // namespace DataStreamAdapters