summaryrefslogtreecommitdiff
path: root/include/libcamera/base
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-11-28 05:45:34 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-12-04 23:05:05 +0200
commit5c85e7024027c90b1b054782e510691b8b9c7419 (patch)
tree4fa3beff65de2a9a1236ad5c931b8e2495fd6eb2 /include/libcamera/base
parent3dc3e2e61e548e4cd3e213b1b3022ed4d8e7ecee (diff)
libcamera: base: Rename FileDescriptor to SharedFD
Now that we have a UniqueFD class, the name FileDescriptor is ambiguous. Rename it to SharedFD. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include/libcamera/base')
-rw-r--r--include/libcamera/base/meson.build2
-rw-r--r--include/libcamera/base/shared_fd.h (renamed from include/libcamera/base/file_descriptor.h)22
2 files changed, 12 insertions, 12 deletions
diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build
index fce6eaa4..4410aba8 100644
--- a/include/libcamera/base/meson.build
+++ b/include/libcamera/base/meson.build
@@ -11,7 +11,6 @@ libcamera_base_headers = files([
'event_dispatcher_poll.h',
'event_notifier.h',
'file.h',
- 'file_descriptor.h',
'flags.h',
'log.h',
'message.h',
@@ -19,6 +18,7 @@ libcamera_base_headers = files([
'object.h',
'private.h',
'semaphore.h',
+ 'shared_fd.h',
'signal.h',
'span.h',
'thread.h',
diff --git a/include/libcamera/base/file_descriptor.h b/include/libcamera/base/shared_fd.h
index 12a43f95..a786885c 100644
--- a/include/libcamera/base/file_descriptor.h
+++ b/include/libcamera/base/shared_fd.h
@@ -2,7 +2,7 @@
/*
* Copyright (C) 2019, Google Inc.
*
- * file_descriptor.h - File descriptor wrapper
+ * shared_fd.h - File descriptor wrapper with shared ownership
*/
#pragma once
@@ -13,18 +13,18 @@ namespace libcamera {
class UniqueFD;
-class FileDescriptor final
+class SharedFD final
{
public:
- explicit FileDescriptor(const int &fd = -1);
- explicit FileDescriptor(int &&fd);
- explicit FileDescriptor(UniqueFD fd);
- FileDescriptor(const FileDescriptor &other);
- FileDescriptor(FileDescriptor &&other);
- ~FileDescriptor();
-
- FileDescriptor &operator=(const FileDescriptor &other);
- FileDescriptor &operator=(FileDescriptor &&other);
+ explicit SharedFD(const int &fd = -1);
+ explicit SharedFD(int &&fd);
+ explicit SharedFD(UniqueFD fd);
+ SharedFD(const SharedFD &other);
+ SharedFD(SharedFD &&other);
+ ~SharedFD();
+
+ SharedFD &operator=(const SharedFD &other);
+ SharedFD &operator=(SharedFD &&other);
bool isValid() const { return fd_ != nullptr; }
int fd() const { return fd_ ? fd_->fd() : -1; }