|
libcamera
v0.1.0
Supporting cameras in Linux since 2019
|
Go to the documentation of this file.
13 #include <libcamera/base/compiler.h>
42 reset(other.release());
53 void reset(
int fd = -1);
57 std::swap(fd_, other.fd_);
60 int get()
const {
return fd_; }
__nodiscard int release()
Release ownership of the file descriptor without closing it.
Definition: unique_fd.h:46
Utilities to help constructing class interfaces.
unique_ptr-like wrapper for a file descriptor
Definition: unique_fd.h:18
int get() const
Retrieve the managed file descriptor.
Definition: unique_fd.h:60
#define LIBCAMERA_DISABLE_COPY(klass)
Disable copy construction and assignment of the klass.
UniqueFD(int fd)
Construct a UniqueFD that owns fd.
Definition: unique_fd.h:25
Top-level libcamera namespace.
Definition: backtrace.h:17
void reset(int fd=-1)
Replace the managed file descriptor.
Definition: unique_fd.cpp:95
void swap(UniqueFD &other)
Swap the managed file descriptors with another UniqueFD.
Definition: unique_fd.h:55
UniqueFD & operator=(UniqueFD &&other)
Move assignment operator, replace a UniqueFD by taking over other.
Definition: unique_fd.h:40
UniqueFD(UniqueFD &&other)
Move constructor, create a UniqueFD by taking over other.
Definition: unique_fd.h:30
~UniqueFD()
Destroy the UniqueFD instance.
Definition: unique_fd.h:35
bool isValid() const
Check if the UniqueFD owns a valid file descriptor.
Definition: unique_fd.h:61
UniqueFD()
Construct a UniqueFD that owns no file descriptor.
Definition: unique_fd.h:20