libcamera: include/libcamera/fence.h Source File

libcamera v0.7.2 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
fence.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: LGPL-2.1-or-later */
2/*
3 * Copyright (C) 2021, Google Inc.
4 *
5 * Synchronization fence
6 */
7
8#pragma once
9
10#include <libcamera/base/class.h>
11#include <libcamera/base/unique_fd.h>
12
13namespace libcamera {
14
15 class Fence
16{
17public:
18 Fence(UniqueFD fd);
19
20 bool isValid() const { return fd_.isValid(); }
21 const UniqueFD &fd() const { return fd_; }
22
23 UniqueFD release() { return std::move(fd_); }
24
25private:
26 LIBCAMERA_DISABLE_COPY_AND_MOVE(Fence)
27
28 UniqueFD fd_;
29};
30
31} /* namespace libcamera */
libcamera::Fence
Synchronization primitive to manage resources.
Definition fence.h:16
libcamera::Fence::isValid
bool isValid() const
Check if a Fence is valid.
Definition fence.h:20
libcamera::Fence::release
UniqueFD release()
Release the ownership of the file descriptor.
Definition fence.h:23
libcamera::Fence::fd
const UniqueFD & fd() const
Retrieve a constant reference to the file descriptor.
Definition fence.h:21
libcamera::Fence::Fence
Fence(UniqueFD fd)
Create a Fence.
Definition fence.cpp:82
libcamera::UniqueFD
unique_ptr-like wrapper for a file descriptor
Definition unique_fd.h:17
libcamera
Top-level libcamera namespace.
Definition bound_method.h:15
unique_fd.h
File descriptor wrapper that owns a file descriptor.