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/on_disk/chunks/writer.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/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 ab14522bdd..fbd02eef4b 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; }; |