|
@@ -5,13 +5,14 @@
|
|
|
#include "mpl.h"
|
|
|
#include "property.h"
|
|
|
#include "serialize_dump.h"
|
|
|
-
|
|
|
#include "maybe_inf.h"
|
|
|
|
|
|
#include <library/cpp/yt/assert/assert.h>
|
|
|
|
|
|
#include <library/cpp/yt/memory/ref.h>
|
|
|
|
|
|
+#include <library/cpp/yt/misc/strong_typedef.h>
|
|
|
+
|
|
|
#include <util/stream/buffered.h>
|
|
|
#include <util/stream/file.h>
|
|
|
#include <util/stream/zerocopy_output.h>
|
|
@@ -212,20 +213,8 @@ private:
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
-struct TEntitySerializationKey
|
|
|
-{
|
|
|
- constexpr TEntitySerializationKey();
|
|
|
- constexpr explicit TEntitySerializationKey(int index);
|
|
|
-
|
|
|
- constexpr bool operator==(const TEntitySerializationKey& other) const = default;
|
|
|
-
|
|
|
- constexpr explicit operator bool() const;
|
|
|
-
|
|
|
- void Save(TEntityStreamSaveContext& context) const;
|
|
|
- void Load(TEntityStreamLoadContext& context);
|
|
|
-
|
|
|
- int Index;
|
|
|
-};
|
|
|
+YT_DEFINE_STRONG_TYPEDEF(TEntitySerializationKey, i32);
|
|
|
+constexpr auto NullEntitySerializationKey = TEntitySerializationKey(-1);
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
@@ -241,7 +230,7 @@ public:
|
|
|
|
|
|
TEntitySerializationKey GenerateSerializationKey();
|
|
|
|
|
|
- static inline const TEntitySerializationKey InlineKey = TEntitySerializationKey(-3);
|
|
|
+ static constexpr TEntitySerializationKey InlineKey = TEntitySerializationKey(-3);
|
|
|
|
|
|
template <class T>
|
|
|
TEntitySerializationKey RegisterRawEntity(T* entity);
|