diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/http/io/compression.h | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/io/compression.h')
-rw-r--r-- | library/cpp/http/io/compression.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/http/io/compression.h b/library/cpp/http/io/compression.h index f16c4a18eb..b566bbb796 100644 --- a/library/cpp/http/io/compression.h +++ b/library/cpp/http/io/compression.h @@ -1,17 +1,17 @@ #pragma once - + #include "stream.h" - + #include <util/generic/deque.h> #include <util/generic/hash.h> - + class TCompressionCodecFactory { -public: +public: using TDecoderConstructor = std::function<THolder<IInputStream>(IInputStream*)>; using TEncoderConstructor = std::function<THolder<IOutputStream>(IOutputStream*)>; - + TCompressionCodecFactory(); - + static inline TCompressionCodecFactory& Instance() noexcept { return *SingletonWithPriority<TCompressionCodecFactory, 0>(); } @@ -20,10 +20,10 @@ public: if (auto codec = Codecs_.FindPtr(name)) { return &codec->Decoder; } - + return nullptr; } - + inline const TEncoderConstructor* FindEncoder(TStringBuf name) const { if (auto codec = Codecs_.FindPtr(name)) { return &codec->Encoder; @@ -31,23 +31,23 @@ public: return nullptr; } - + inline TArrayRef<const TStringBuf> GetBestCodecs() const { return BestCodecs_; } -private: +private: void Add(TStringBuf name, TDecoderConstructor d, TEncoderConstructor e); - + struct TCodec { TDecoderConstructor Decoder; TEncoderConstructor Encoder; }; - + TDeque<TString> Strings_; THashMap<TStringBuf, TCodec> Codecs_; TVector<TStringBuf> BestCodecs_; -}; +}; namespace NHttp { template <typename F> |