diff options
author | lukyan <lukyan@yandex-team.com> | 2024-04-09 05:03:59 +0300 |
---|---|---|
committer | lukyan <lukyan@yandex-team.com> | 2024-04-09 05:50:41 +0300 |
commit | a106791f655eec412494a6a3992be68ca28d6553 (patch) | |
tree | ef676edb2233b69d97342b10133113be9185986d | |
parent | ac842f4a10ae7e4d3b2bd4a0826883b8de5dc256 (diff) | |
download | ydb-a106791f655eec412494a6a3992be68ca28d6553.tar.gz |
YT-21484: Remove fields Schema, LookupSupported and KeyWidth from TDataSource
0142af10c4920dfea9b0d910cc93069f9d406e74
-rw-r--r-- | yt/yt/core/misc/protobuf_helpers-inl.h | 16 | ||||
-rw-r--r-- | yt/yt/core/misc/protobuf_helpers.h | 5 |
2 files changed, 12 insertions, 9 deletions
diff --git a/yt/yt/core/misc/protobuf_helpers-inl.h b/yt/yt/core/misc/protobuf_helpers-inl.h index c55ca941e9..bb5894c723 100644 --- a/yt/yt/core/misc/protobuf_helpers-inl.h +++ b/yt/yt/core/misc/protobuf_helpers-inl.h @@ -298,15 +298,16 @@ bool RemoveProtoExtension(NProto::TExtensionSet* extensions) namespace NDetail { -template <class TSerializedArray, class TOriginalArray> +template <class TSerializedArray, class TOriginalArray, class... TArgs> void ToProtoArrayImpl( TSerializedArray* serializedArray, - const TOriginalArray& originalArray) + const TOriginalArray& originalArray, + TArgs&&... args) { serializedArray->Clear(); serializedArray->Reserve(originalArray.size()); for (const auto& item : originalArray) { - ToProto(serializedArray->Add(), item); + ToProto(serializedArray->Add(), item, std::forward<TArgs>(args)...); } } @@ -319,7 +320,7 @@ void FromProtoArrayImpl( originalArray->clear(); originalArray->resize(serializedArray.size()); for (int i = 0; i < serializedArray.size(); ++i) { - FromProto(&(*originalArray)[i], serializedArray.Get(i), args...); + FromProto(&(*originalArray)[i], serializedArray.Get(i), std::forward<TArgs>(args)...); } } @@ -434,12 +435,13 @@ void FromProtoArrayImpl( } // namespace NDetail -template <class TSerialized, class TOriginalArray> +template <class TSerialized, class TOriginalArray, class... TArgs> void ToProto( ::google::protobuf::RepeatedPtrField<TSerialized>* serializedArray, - const TOriginalArray& originalArray) + const TOriginalArray& originalArray, + TArgs&&... args) { - NYT::NDetail::ToProtoArrayImpl(serializedArray, originalArray); + NYT::NDetail::ToProtoArrayImpl(serializedArray, originalArray, std::forward<TArgs>(args)...); } template <class TSerialized, class TOriginalArray> diff --git a/yt/yt/core/misc/protobuf_helpers.h b/yt/yt/core/misc/protobuf_helpers.h index 67727c754d..55caf57468 100644 --- a/yt/yt/core/misc/protobuf_helpers.h +++ b/yt/yt/core/misc/protobuf_helpers.h @@ -64,10 +64,11 @@ template <class T> void FromProto(T* original, ui64 serialized); //////////////////////////////////////////////////////////////////////////////// -template <class TSerialized, class TOriginalArray> +template <class TSerialized, class TOriginalArray, class... TArgs> void ToProto( ::google::protobuf::RepeatedPtrField<TSerialized>* serializedArray, - const TOriginalArray& originalArray); + const TOriginalArray& originalArray, + TArgs&&... args); template <class TSerialized, class TOriginalArray> void ToProto( |