![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
Non-owning wrapper around a file descriptor. More...
#include <dfx-utilities/BorrowedFd.hpp>
Public Member Functions | |
| BorrowedFd () noexcept=default | |
| Create an invalid BorrowedFd. | |
| BorrowedFd (int fd) noexcept | |
| Create a non-owning view from a raw file descriptor. | |
| DFX_ENABLE_DEFAULT_COPY_AND_MOVE_NOEXCEPT (BorrowedFd) | |
| void | swap (BorrowedFd &other) noexcept |
| bool | operator== (BorrowedFd const &fd) const noexcept |
| bool | operator== (int fd) const noexcept |
| int | get () const noexcept |
| Get the underlying file descriptor value. | |
| bool | isValid () const noexcept |
| Check if the current BorrowedFd contains a valid fd. | |
| void | reset () noexcept |
| Invalidate this BorrowedFd. | |
Non-owning wrapper around a file descriptor.
BorrowedFd provides a lightweight, copyable view of an existing file descriptor. It does not own the descriptor and will never close it.
The referenced file descriptor must remain valid for the entire lifetime of all BorrowedFd instances referring to it.
An invalid BorrowedFd is represented by a value of -1.
|
defaultnoexcept |
Create an invalid BorrowedFd.
|
explicitnoexcept |
Create a non-owning view from a raw file descriptor.
| fd | File descriptor value |
|
inlinenoexcept |
Get the underlying file descriptor value.
|
inlinenoexcept |
Check if the current BorrowedFd contains a valid fd.
|
inlinenoexcept |
Invalidate this BorrowedFd.