aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream/aligned.h
diff options
context:
space:
mode:
authordprokoptsev <dprokoptsev@yandex-team.ru>2022-02-10 16:50:05 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:05 +0300
commitcf94099c3ea704df29c11dfb77e2adec41a6708d (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/stream/aligned.h
parent94e596fdab09d4aeb51a3d27767959d8ed030a3d (diff)
downloadydb-cf94099c3ea704df29c11dfb77e2adec41a6708d.tar.gz
Restoring authorship annotation for <dprokoptsev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/stream/aligned.h')
-rw-r--r--util/stream/aligned.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/util/stream/aligned.h b/util/stream/aligned.h
index 39d17ef827..70e7be05a9 100644
--- a/util/stream/aligned.h
+++ b/util/stream/aligned.h
@@ -1,8 +1,8 @@
#pragma once
-
+
#include "input.h"
#include "output.h"
-
+
#include <util/system/yassert.h>
#include <util/generic/bitops.h>
@@ -16,12 +16,12 @@
* aligned data easier.
*/
class TAlignedInput: public IInputStream {
-public:
+public:
TAlignedInput(IInputStream* s)
: Stream_(s)
, Position_(0)
- {
- }
+ {
+ }
/**
* Ensures alignment of the position in the input stream by skipping
@@ -39,7 +39,7 @@ public:
len -= DoSkip(len);
} while (len);
}
- }
+ }
private:
size_t DoRead(void* ptr, size_t len) override;
@@ -50,19 +50,19 @@ private:
private:
IInputStream* Stream_;
ui64 Position_;
-};
-
+};
+
/**
* Proxy output stream that provides additional functions that make writing
* aligned data easier.
*/
class TAlignedOutput: public IOutputStream {
-public:
+public:
TAlignedOutput(IOutputStream* s)
: Stream_(s)
, Position_(0)
- {
- }
+ {
+ }
TAlignedOutput(TAlignedOutput&&) noexcept = default;
TAlignedOutput& operator=(TAlignedOutput&&) noexcept = default;
@@ -86,7 +86,7 @@ public:
if (Position_ & (alignment - 1)) {
DoWrite(unused, alignment - (Position_ & (alignment - 1)));
}
- }
+ }
private:
void DoWrite(const void* ptr, size_t len) override;
@@ -94,6 +94,6 @@ private:
private:
IOutputStream* Stream_;
ui64 Position_;
-};
-
+};
+
/** @} */