Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
imx500::FrameLease Class Reference

Exactly-once release of a borrowed frame, including exception exits. More...

#include <imx500_camera.hpp>

Collaboration diagram for imx500::FrameLease:

Public Types

using Release = void (*)(void *) noexcept
 Nonthrowing release callback; a destructor must never unwind through it.

Public Member Functions

 FrameLease (FrameView view, void *owner, Release release) noexcept
 Associate borrowed evidence with exactly one release operation.
 ~FrameLease ()
 Release once on every scope exit, including a processing exception.
 FrameLease (FrameLease &&other) noexcept
 Transfer release responsibility and empty the moved-from view.
 FrameLease (const FrameLease &)=delete
 Copies are forbidden because two destructors cannot own one request.
FrameLease & operator= (const FrameLease &)=delete
 Copy assignment cannot duplicate capture ownership.
FrameLease & operator= (FrameLease &&)=delete
 Assignment is disabled; move construction is the supported transfer.
const FrameView & view () const noexcept
 Read evidence only while this unmoved lease remains alive.

Private Attributes

FrameView view_
void * owner_
Release release_

Friends

class Camera

Detailed Description

Exactly-once release of a borrowed frame, including exception exits.

The capture owner must outlive its lease. Only one lease per Camera may exist. Move transfers ownership; copies and move assignment are disabled.

Definition at line 119 of file imx500_camera.hpp.

Member Typedef Documentation

◆ Release

using imx500::FrameLease::Release = void (*)(void *) noexcept

Nonthrowing release callback; a destructor must never unwind through it.

Definition at line 122 of file imx500_camera.hpp.

Constructor & Destructor Documentation

◆ FrameLease() [1/3]

imx500::FrameLease::FrameLease ( FrameView view,
void * owner,
Release release )
noexcept

Associate borrowed evidence with exactly one release operation.

Parameters
viewEvidence whose backing storage is retained by owner.
ownerBorrowed capture-owner context, alive until release completes.
releaseCallback to recycle the held request, or NULL for an unowned view.

Camera constructs leases before interpreting metadata so failures during extraction also release the request.

The lease owns the right to recycle the request, not the DMA memory. Keeping that distinction avoids both full-frame copies and premature reuse.

Definition at line 238 of file imx500_camera.cpp.

◆ ~FrameLease()

imx500::FrameLease::~FrameLease ( )

Release once on every scope exit, including a processing exception.

Return a held request exactly once, including during exception unwinding.

Definition at line 244 of file imx500_camera.cpp.

◆ FrameLease() [2/3]

imx500::FrameLease::FrameLease ( FrameLease && other)
noexcept

Transfer release responsibility and empty the moved-from view.

Parameters
otherLease to consume; it will no longer recycle the request.

Moving transfers the recycling obligation; it does not extend the lifetime of the camera state or make an owned copy of the borrowed pixels.

Definition at line 255 of file imx500_camera.cpp.

◆ FrameLease() [3/3]

imx500::FrameLease::FrameLease ( const FrameLease & )
delete

Copies are forbidden because two destructors cannot own one request.

Member Function Documentation

◆ operator=() [1/2]

FrameLease & imx500::FrameLease::operator= ( const FrameLease & )
delete

Copy assignment cannot duplicate capture ownership.

◆ operator=() [2/2]

FrameLease & imx500::FrameLease::operator= ( FrameLease && )
delete

Assignment is disabled; move construction is the supported transfer.

◆ view()

const FrameView & imx500::FrameLease::view ( ) const
inlinenoexcept

Read evidence only while this unmoved lease remains alive.

Returns
Borrowed immutable view; its tensor spans have the lease's lifetime.

Definition at line 145 of file imx500_camera.hpp.

◆ Camera

friend class Camera
friend

Definition at line 148 of file imx500_camera.hpp.

Field Documentation

◆ owner_

void* imx500::FrameLease::owner_
private

Context whose lifetime must exceed this lease.

Definition at line 150 of file imx500_camera.hpp.

◆ release_

Release imx500::FrameLease::release_
private

Sole remaining release operation, NULL after a move.

Definition at line 151 of file imx500_camera.hpp.

◆ view_

FrameView imx500::FrameLease::view_
private

Borrowed metadata, never a second image/tensor allocation.

Definition at line 149 of file imx500_camera.hpp.


The documentation for this class was generated from the following files: