diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:40 +0300 |
commit | 5d50718e66d9c037dc587a0211110b7d25a66185 (patch) | |
tree | e98df59de24d2ef7c77baed9f41e4875a2fef972 /library/cpp/yson_pull/bridge.h | |
parent | a6a92afe03e02795227d2641b49819b687f088f8 (diff) | |
download | ydb-5d50718e66d9c037dc587a0211110b7d25a66185.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson_pull/bridge.h')
-rw-r--r-- | library/cpp/yson_pull/bridge.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/library/cpp/yson_pull/bridge.h b/library/cpp/yson_pull/bridge.h index db3806d3d3..ac767dcba0 100644 --- a/library/cpp/yson_pull/bridge.h +++ b/library/cpp/yson_pull/bridge.h @@ -1,34 +1,34 @@ -#pragma once - -#include "consumer.h" -#include "event.h" -#include "writer.h" - -namespace NYsonPull { +#pragma once + +#include "consumer.h" +#include "event.h" +#include "writer.h" + +namespace NYsonPull { //! \brief Connect YSON stream producer and consumer. //! //! Useful for writing YSON stream filters. //! \p Producer must have a \p next_event() method (like \p NYsonPull::reader). //! \p Consumer must be like \p NYsonPull::consumer interface. template <typename Producer, typename Consumer> - inline void Bridge(Producer&& producer, Consumer&& consumer) { + inline void Bridge(Producer&& producer, Consumer&& consumer) { for (;;) { - auto& event = producer.NextEvent(); - consumer.OnEvent(event); - if (event.Type() == EEventType::EndStream) { + auto& event = producer.NextEvent(); + consumer.OnEvent(event); + if (event.Type() == EEventType::EndStream) { break; } - } - } - + } + } + template <typename Producer> - inline void Bridge(Producer&& producer, TWriter& writer_) { - Bridge(std::forward<Producer>(producer), writer_.GetConsumer()); + inline void Bridge(Producer&& producer, TWriter& writer_) { + Bridge(std::forward<Producer>(producer), writer_.GetConsumer()); } - + template <typename Producer> - inline void Bridge(Producer&& producer, TWriter&& writer_) { - Bridge(std::forward<Producer>(producer), writer_.GetConsumer()); + inline void Bridge(Producer&& producer, TWriter&& writer_) { + Bridge(std::forward<Producer>(producer), writer_.GetConsumer()); } - + } |