aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/http/io/compression.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/http/io/compression.h
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/http/io/compression.h')
-rw-r--r--library/cpp/http/io/compression.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/http/io/compression.h b/library/cpp/http/io/compression.h
index b566bbb796..f16c4a18eb 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>