diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/codecs/comptable_codec.h | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/codecs/comptable_codec.h')
-rw-r--r-- | library/cpp/codecs/comptable_codec.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/library/cpp/codecs/comptable_codec.h b/library/cpp/codecs/comptable_codec.h new file mode 100644 index 00000000000..7ba4f4c5432 --- /dev/null +++ b/library/cpp/codecs/comptable_codec.h @@ -0,0 +1,40 @@ +#pragma once + +#include "codecs.h" + +#include <util/generic/ptr.h> + +namespace NCodecs { + class TCompTableCodec: public ICodec { + class TImpl; + TIntrusivePtr<TImpl> Impl; + + public: + enum EQuality { + Q_LOW = 0, + Q_HIGH = 1 + }; + + explicit TCompTableCodec(EQuality q = Q_HIGH); + ~TCompTableCodec() override; + + static TStringBuf MyNameHQ() { + return "comptable-hq"; + } + static TStringBuf MyNameLQ() { + return "comptable-lq"; + } + + TString GetName() const override; + + ui8 Encode(TStringBuf in, TBuffer& out) const override; + + void Decode(TStringBuf in, TBuffer& out) const override; + + protected: + void DoLearn(ISequenceReader& in) override; + void Save(IOutputStream* out) const override; + void Load(IInputStream* in) override; + }; + +} |