diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
commit | 8cbc307de0221f84c80c42dcbe07d40727537e2c (patch) | |
tree | 625d5a673015d1df891e051033e9fcde5c7be4e5 /util/stream/aligned.h | |
parent | 30d1ef3941e0dc835be7609de5ebee66958f215a (diff) | |
download | ydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream/aligned.h')
-rw-r--r-- | util/stream/aligned.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/util/stream/aligned.h b/util/stream/aligned.h index 70e7be05a9..672ea25494 100644 --- a/util/stream/aligned.h +++ b/util/stream/aligned.h @@ -15,9 +15,9 @@ * Proxy input stream that provides additional functions that make reading * aligned data easier. */ -class TAlignedInput: public IInputStream { +class TAlignedInput: public IInputStream { public: - TAlignedInput(IInputStream* s) + TAlignedInput(IInputStream* s) : Stream_(s) , Position_(0) { @@ -30,7 +30,7 @@ public: * @param alignment Alignment. Must be a power of 2. */ void Align(size_t alignment = sizeof(void*)) { - Y_ASSERT(IsPowerOf2(alignment)); + Y_ASSERT(IsPowerOf2(alignment)); if (Position_ & (alignment - 1)) { size_t len = alignment - (Position_ & (alignment - 1)); @@ -45,10 +45,10 @@ private: size_t DoRead(void* ptr, size_t len) override; size_t DoSkip(size_t len) override; size_t DoReadTo(TString& st, char ch) override; - ui64 DoReadAll(IOutputStream& out) override; + ui64 DoReadAll(IOutputStream& out) override; private: - IInputStream* Stream_; + IInputStream* Stream_; ui64 Position_; }; @@ -56,9 +56,9 @@ private: * Proxy output stream that provides additional functions that make writing * aligned data easier. */ -class TAlignedOutput: public IOutputStream { +class TAlignedOutput: public IOutputStream { public: - TAlignedOutput(IOutputStream* s) + TAlignedOutput(IOutputStream* s) : Stream_(s) , Position_(0) { @@ -78,10 +78,10 @@ public: * @param alignment Alignment. Must be a power of 2. */ void Align(size_t alignment = sizeof(void*)) { - Y_ASSERT(IsPowerOf2(alignment)); + Y_ASSERT(IsPowerOf2(alignment)); static char unused[sizeof(void*) * 2]; - Y_ASSERT(alignment <= sizeof(unused)); + Y_ASSERT(alignment <= sizeof(unused)); if (Position_ & (alignment - 1)) { DoWrite(unused, alignment - (Position_ & (alignment - 1))); @@ -92,7 +92,7 @@ private: void DoWrite(const void* ptr, size_t len) override; private: - IOutputStream* Stream_; + IOutputStream* Stream_; ui64 Position_; }; |