diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-03-12 17:47:25 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-03-12 17:56:50 +0300 |
commit | ae71882489a911042e19da3638416971627f8be6 (patch) | |
tree | 47d51658c5cb0488e3bfc44a42547cf4f5ec0711 | |
parent | 2f909c77e1e1f6026f0189dbdb556b736cb52c78 (diff) | |
download | ydb-ae71882489a911042e19da3638416971627f8be6.tar.gz |
Intermediate changes
-rw-r--r-- | yt/yt/core/misc/protobuf_helpers-inl.h | 14 | ||||
-rw-r--r-- | yt/yt/core/misc/protobuf_helpers.h | 5 |
2 files changed, 11 insertions, 8 deletions
diff --git a/yt/yt/core/misc/protobuf_helpers-inl.h b/yt/yt/core/misc/protobuf_helpers-inl.h index 887d11974a..c55ca941e9 100644 --- a/yt/yt/core/misc/protobuf_helpers-inl.h +++ b/yt/yt/core/misc/protobuf_helpers-inl.h @@ -310,15 +310,16 @@ void ToProtoArrayImpl( } } -template <class TOriginalArray, class TSerializedArray> +template <class TOriginalArray, class TSerializedArray, class... TArgs> void FromProtoArrayImpl( TOriginalArray* originalArray, - const TSerializedArray& serializedArray) + const TSerializedArray& serializedArray, + TArgs&&... args) { originalArray->clear(); originalArray->resize(serializedArray.size()); for (int i = 0; i < serializedArray.size(); ++i) { - FromProto(&(*originalArray)[i], serializedArray.Get(i)); + FromProto(&(*originalArray)[i], serializedArray.Get(i), args...); } } @@ -449,12 +450,13 @@ void ToProto( NYT::NDetail::ToProtoArrayImpl(serializedArray, originalArray); } -template <class TOriginalArray, class TSerialized> +template <class TOriginalArray, class TSerialized, class... TArgs> void FromProto( TOriginalArray* originalArray, - const ::google::protobuf::RepeatedPtrField<TSerialized>& serializedArray) + const ::google::protobuf::RepeatedPtrField<TSerialized>& serializedArray, + TArgs&&... args) { - NYT::NDetail::FromProtoArrayImpl(originalArray, serializedArray); + NYT::NDetail::FromProtoArrayImpl(originalArray, serializedArray, std::forward<TArgs>(args)...); } template <class TOriginalArray, class TSerialized> diff --git a/yt/yt/core/misc/protobuf_helpers.h b/yt/yt/core/misc/protobuf_helpers.h index 893c387076..aed229d7b5 100644 --- a/yt/yt/core/misc/protobuf_helpers.h +++ b/yt/yt/core/misc/protobuf_helpers.h @@ -72,10 +72,11 @@ void ToProto( ::google::protobuf::RepeatedField<TSerialized>* serializedArray, const TOriginalArray& originalArray); -template <class TOriginalArray, class TSerialized> +template <class TOriginalArray, class TSerialized, class... TArgs> void FromProto( TOriginalArray* originalArray, - const ::google::protobuf::RepeatedPtrField<TSerialized>& serializedArray); + const ::google::protobuf::RepeatedPtrField<TSerialized>& serializedArray, + TArgs&&... args); template <class TOriginalArray, class TSerialized> void FromProto( |