diff options
author | vvvv <vvvv@ydb.tech> | 2022-10-30 10:41:16 +0300 |
---|---|---|
committer | vvvv <vvvv@ydb.tech> | 2022-10-30 10:41:16 +0300 |
commit | a34b8d13197580c648158c2d2a29812d0b211713 (patch) | |
tree | d9cbcbb05c3157d7c140b35901bf6b5c600e9072 /library/cpp/yt/memory/serialize.h | |
parent | 8985a698521744e4065500f5945d44ca52f797a9 (diff) | |
download | ydb-a34b8d13197580c648158c2d2a29812d0b211713.tar.gz |
[pg] initialize tx timestamps
влияет на функции now, statement_timestamp - они будут брать кешированное значение с момента инициализации comp graph.
clock_timestamp сейчас всегда возвращает некешированное системное время - это потом надо будет увести в TimeProvider
Diffstat (limited to 'library/cpp/yt/memory/serialize.h')
-rw-r--r-- | library/cpp/yt/memory/serialize.h | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/library/cpp/yt/memory/serialize.h b/library/cpp/yt/memory/serialize.h index 03fc286515..c113e04961 100644 --- a/library/cpp/yt/memory/serialize.h +++ b/library/cpp/yt/memory/serialize.h @@ -1,6 +1,6 @@ #pragma once -#include "new.h" +#include "intrusive_ptr.h" //////////////////////////////////////////////////////////////////////////////// @@ -8,27 +8,13 @@ template <class T> class TSerializer<NYT::TIntrusivePtr<T>> { public: - static inline void Save(IOutputStream* out, const NYT::TIntrusivePtr<T>& ptr) - { - bool hasValue = ptr.operator bool(); - ::Save(out, hasValue); - if (hasValue) { - ::Save(out, *ptr); - } - } + static inline void Save(IOutputStream* output, const NYT::TIntrusivePtr<T>& ptr); - static inline void Load(IInputStream* in, NYT::TIntrusivePtr<T>& ptr) - { - bool hasValue; - ::Load(in, hasValue); - if (hasValue) { - auto tmp = NYT::New<T>(); - ::Load(in, *tmp); - ptr = std::move(tmp); - } else { - ptr.Reset(); - } - } + static inline void Load(IInputStream* input, NYT::TIntrusivePtr<T>& ptr); }; //////////////////////////////////////////////////////////////////////////////// + +#define SERIALIZE_PTR_INL_H_ +#include "serialize-inl.h" +#undef SERIALIZE_PTR_INL_H_ |