diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/on_disk/chunks/writer.h | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/on_disk/chunks/writer.h')
-rw-r--r-- | library/cpp/on_disk/chunks/writer.h | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/library/cpp/on_disk/chunks/writer.h b/library/cpp/on_disk/chunks/writer.h index fbd02eef4b..ab14522bdd 100644 --- a/library/cpp/on_disk/chunks/writer.h +++ b/library/cpp/on_disk/chunks/writer.h @@ -9,49 +9,49 @@ inline void WriteBin(IOutputStream* out, typename TTypeTraits<T>::TFuncParam t) } class TChunkedDataWriter: public IOutputStream { -public: - TChunkedDataWriter(IOutputStream& slave); - ~TChunkedDataWriter() override; +public: + TChunkedDataWriter(IOutputStream& slave); + ~TChunkedDataWriter() override; - void NewBlock(); + void NewBlock(); - template <typename T> - inline void WriteBinary(typename TTypeTraits<T>::TFuncParam t) { - this->Write(&t, sizeof(T)); - } + template <typename T> + inline void WriteBinary(typename TTypeTraits<T>::TFuncParam t) { + this->Write(&t, sizeof(T)); + } - void WriteFooter(); + void WriteFooter(); - size_t GetCurrentBlockOffset() const; - size_t GetBlockCount() const; + size_t GetCurrentBlockOffset() const; + size_t GetBlockCount() const; -protected: - void DoWrite(const void* buf, size_t len) override { - Slave.Write(buf, len); - Offset += len; - } +protected: + void DoWrite(const void* buf, size_t len) override { + Slave.Write(buf, len); + Offset += len; + } -private: - static inline size_t PaddingSize(size_t size, size_t boundary) noexcept { - const size_t boundaryViolation = size % boundary; +private: + static inline size_t PaddingSize(size_t size, size_t boundary) noexcept { + const size_t boundaryViolation = size % boundary; - return boundaryViolation == 0 ? 0 : boundary - boundaryViolation; - } + return boundaryViolation == 0 ? 0 : boundary - boundaryViolation; + } - inline void Pad(size_t boundary) { - const size_t newOffset = Offset + PaddingSize(Offset, boundary); + inline void Pad(size_t boundary) { + const size_t newOffset = Offset + PaddingSize(Offset, boundary); - while (Offset < newOffset) { - Write('\0'); + while (Offset < newOffset) { + Write('\0'); } - } + } -private: - static const ui64 Version = 1; +private: + static const ui64 Version = 1; - IOutputStream& Slave; + IOutputStream& Slave; - size_t Offset; - TVector<ui64> Offsets; - TVector<ui64> Lengths; + size_t Offset; + TVector<ui64> Offsets; + TVector<ui64> Lengths; }; |