12 #include <libcamera/base/class.h> 41 reset(other.release());
52 void reset(
int fd = -1);
56 std::swap(fd_, other.fd_);
59 int get()
const {
return fd_; }
UniqueFD(UniqueFD &&other)
Move constructor, create a UniqueFD by taking over other.
Definition: unique_fd.h:29
UniqueFD()
Construct a UniqueFD that owns no file descriptor.
Definition: unique_fd.h:19
void swap(UniqueFD &other)
Swap the managed file descriptors with another UniqueFD.
Definition: unique_fd.h:54
Top-level libcamera namespace.
Definition: bound_method.h:15
unique_ptr-like wrapper for a file descriptor
Definition: unique_fd.h:16
UniqueFD(int fd)
Construct a UniqueFD that owns fd.
Definition: unique_fd.h:24
bool isValid() const
Check if the UniqueFD owns a valid file descriptor.
Definition: unique_fd.h:60
void reset(int fd=-1)
Replace the managed file descriptor.
Definition: unique_fd.cpp:95
UniqueFD & operator=(UniqueFD &&other)
Move assignment operator, replace a UniqueFD by taking over other.
Definition: unique_fd.h:39
int release()
Release ownership of the file descriptor without closing it.
Definition: unique_fd.h:45
~UniqueFD()
Destroy the UniqueFD instance.
Definition: unique_fd.h:34