diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/system/pipe.h | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'util/system/pipe.h')
-rw-r--r-- | util/system/pipe.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/util/system/pipe.h b/util/system/pipe.h index 92dd33362f..75d0360049 100644 --- a/util/system/pipe.h +++ b/util/system/pipe.h @@ -17,42 +17,42 @@ using PIPEHANDLE = SOCKET; /// Pipe-like object: pipe on POSIX and socket on windows class TPipeHandle: public TNonCopyable { public: - inline TPipeHandle() noexcept + inline TPipeHandle() noexcept : Fd_(INVALID_PIPEHANDLE) { } - inline TPipeHandle(PIPEHANDLE fd) noexcept + inline TPipeHandle(PIPEHANDLE fd) noexcept : Fd_(fd) { } - inline ~TPipeHandle() { + inline ~TPipeHandle() { Close(); } - bool Close() noexcept; + bool Close() noexcept; - inline PIPEHANDLE Release() noexcept { + inline PIPEHANDLE Release() noexcept { PIPEHANDLE ret = Fd_; Fd_ = INVALID_PIPEHANDLE; return ret; } - inline void Swap(TPipeHandle& r) noexcept { + inline void Swap(TPipeHandle& r) noexcept { DoSwap(Fd_, r.Fd_); } - inline operator PIPEHANDLE() const noexcept { + inline operator PIPEHANDLE() const noexcept { return Fd_; } - inline bool IsOpen() const noexcept { + inline bool IsOpen() const noexcept { return Fd_ != INVALID_PIPEHANDLE; } - ssize_t Read(void* buffer, size_t byteCount) const noexcept; - ssize_t Write(const void* buffer, size_t byteCount) const noexcept; + ssize_t Read(void* buffer, size_t byteCount) const noexcept; + ssize_t Write(const void* buffer, size_t byteCount) const noexcept; // Only CloseOnExec is supported static void Pipe(TPipeHandle& reader, TPipeHandle& writer, EOpenMode mode = 0); @@ -66,12 +66,12 @@ public: TPipe(); /// Takes ownership of handle, so closes it when the last holder of descriptor dies. explicit TPipe(PIPEHANDLE fd); - ~TPipe(); + ~TPipe(); void Close(); - bool IsOpen() const noexcept; - PIPEHANDLE GetHandle() const noexcept; + bool IsOpen() const noexcept; + PIPEHANDLE GetHandle() const noexcept; size_t Read(void* buf, size_t len) const; size_t Write(const void* buf, size_t len) const; |