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/packedtypes/packed.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/packedtypes/packed.h')
-rw-r--r-- | library/cpp/packedtypes/packed.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/library/cpp/packedtypes/packed.h b/library/cpp/packedtypes/packed.h index 88cff26ae2..340fd99472 100644 --- a/library/cpp/packedtypes/packed.h +++ b/library/cpp/packedtypes/packed.h @@ -7,8 +7,8 @@ #include "longs.h" -struct Stream_traits { - template <typename T> +struct Stream_traits { + template <typename T> static T get(IInputStream& in) { T x; ::Load(&in, x); @@ -32,23 +32,23 @@ struct Stream_traits { static void put_32(ui32 x, IOutputStream& out) { ::Save(&out, x); } - static int is_good(IInputStream& /*in*/) { - return 1; - } - static int is_good(IOutputStream& /*out*/) { - return 1; - } + static int is_good(IInputStream& /*in*/) { + return 1; + } + static int is_good(IOutputStream& /*out*/) { + return 1; + } }; -struct TZCMemoryInput_traits { - template <typename T> +struct TZCMemoryInput_traits { + template <typename T> static T get(TZCMemoryInput& in) { T x; in.ReadPOD(x); return x; } - static ui8 Y_FORCE_INLINE get_8(TZCMemoryInput& in) { + static ui8 Y_FORCE_INLINE get_8(TZCMemoryInput& in) { return get<ui8>(in); } @@ -73,25 +73,25 @@ void Y_FORCE_INLINE PackUI32(IOutputStream& out, ui32 v) { out.Write(buf, size); } -template <class TStream> -struct TInputStream2Traits { +template <class TStream> +struct TInputStream2Traits { typedef Stream_traits TTraits; }; -template <> -struct TInputStream2Traits<TZCMemoryInput> { +template <> +struct TInputStream2Traits<TZCMemoryInput> { typedef TZCMemoryInput_traits TTraits; }; -template <class TStream> -void Y_FORCE_INLINE UnPackUI32(TStream& in, ui32& v) { +template <class TStream> +void Y_FORCE_INLINE UnPackUI32(TStream& in, ui32& v) { size_t size; UNPACK_28(v, in, TInputStream2Traits<TStream>::TTraits, size); - (void)size; + (void)size; } -template <class TStream> -ui32 Y_FORCE_INLINE UnPackUI32(TStream& in) { +template <class TStream> +ui32 Y_FORCE_INLINE UnPackUI32(TStream& in) { ui32 res; UnPackUI32(in, res); return res; |