diff options
author | rtk0c <[email protected]> | 2021-08-15 21:22:01 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-08-15 21:22:01 -0700 |
commit | f4422ec11c3ef1be2b38495e947719b7bf28584d (patch) | |
tree | d9cc505b895a267e511d846b226fc7d1c2d5fa7f /core/src/Utils/IO | |
parent | 87b964591c9a93146bd43e8813387392f8520337 (diff) |
Rename original "IO adapter" (read/write operation abstraction) to "IO proxy"
Diffstat (limited to 'core/src/Utils/IO')
-rw-r--r-- | core/src/Utils/IO/DataStream.hpp | 20 | ||||
-rw-r--r-- | core/src/Utils/IO/fwd.hpp | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/core/src/Utils/IO/DataStream.hpp b/core/src/Utils/IO/DataStream.hpp index fb55f42..a88fe07 100644 --- a/core/src/Utils/IO/DataStream.hpp +++ b/core/src/Utils/IO/DataStream.hpp @@ -6,7 +6,7 @@ #include <cstdint> #include <span> -class SerializationAdapter +class SerializationStreamProxy { public: static constexpr bool IsSerializer() @@ -42,7 +42,7 @@ public: } }; -class DeserializationAdapter +class DeserializationStreamProxy { public: static constexpr bool IsSerializer() @@ -90,8 +90,8 @@ concept HasMember = requires(T t) template <class T> concept HasIOAdapterMember = requires(T t) { - t.OperateIOAdapter(std::declval<SerializationAdapter>()); - t.OperateIOAdapter(std::declval<DeserializationAdapter>()); + t.OperateIOProxy(std::declval<SerializationStreamProxy>()); + t.OperateIOProxy(std::declval<DeserializationStreamProxy>()); }; } // namespace DataStreamTraits @@ -177,9 +177,9 @@ public: using namespace DataStreamTraits; if constexpr (requires(TObject t) { t.ReadFromDataStream(std::declval<DataStream>()); }) { obj.ReadFromDataStream(*this); - } else if constexpr (requires(TObject t) { t.OperateIOAdapter(std::declval<DeserializationAdapter>()); }) { - DeserializationAdapter adapter{ this }; - obj.OperateIOAdapter(adapter); + } else if constexpr (requires(TObject t) { t.OperateIOProxy(std::declval<DeserializationStreamProxy>()); }) { + DeserializationStreamProxy adapter{ this }; + obj.OperateIOProxy(adapter); } else { static_assert(false && sizeof(TObject), "This type does not have integration with DataStream."); } @@ -197,9 +197,9 @@ public: using namespace DataStreamTraits; if constexpr (requires(TObject t) { t.WriteToDataStream(std::declval<DataStream>()); }) { obj.WriteToDataStream(*this); - } else if constexpr (requires(TObject t) { t.OperateIOAdapter(std::declval<SerializationAdapter>()); }) { - SerializationAdapter adapter{ this }; - obj.OperateIOAdapter(adapter); + } else if constexpr (requires(TObject t) { t.OperateIOProxy(std::declval<SerializationStreamProxy>()); }) { + SerializationStreamProxy adapter{ this }; + obj.OperateIOProxy(adapter); } else { static_assert(false && sizeof(TObject), "This type does not have integration with DataStream."); } diff --git a/core/src/Utils/IO/fwd.hpp b/core/src/Utils/IO/fwd.hpp index 755d94f..848c78f 100644 --- a/core/src/Utils/IO/fwd.hpp +++ b/core/src/Utils/IO/fwd.hpp @@ -1,6 +1,6 @@ -#pragma onceDeserializationAdapter +#pragma once // DataStream.hpp -class SerializationAdapter; -class DeserializationAdapter; +class SerializationStreamProxy; +class DeserializationStreamProxy; class DataStream; |