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
pangea_survey::StorageDescriptor Class Reference

Own a working-file descriptor through success and exception paths. More...

#include <map_storage.h>

Public Member Functions

 StorageDescriptor (int descriptor=-1)
 Adopt a descriptor without duplicating it.
 StorageDescriptor (const StorageDescriptor &)=delete
 Noncopyable: ownership cannot be shared by copying the FD number.
StorageDescriptor & operator= (const StorageDescriptor &)=delete
 Nonassignable: use reset() to replace the owned descriptor.
 ~StorageDescriptor ()
 Close an owned descriptor; use close() when the status matters.
int get () const
 Borrow the descriptor without transferring ownership.
void reset (int descriptor)
 Relinquish the old descriptor and adopt a distinct replacement.
int close ()
 Close explicitly and report the system call result.

Private Attributes

int descriptor_

Detailed Description

Own a working-file descriptor through success and exception paths.

Definition at line 45 of file map_storage.h.

Constructor & Destructor Documentation

◆ StorageDescriptor() [1/2]

pangea_survey::StorageDescriptor::StorageDescriptor ( int descriptor = -1)
inlineexplicit

Adopt a descriptor without duplicating it.

Parameters
descriptorOwned descriptor, or -1 for no open file.

Definition at line 50 of file map_storage.h.

◆ StorageDescriptor() [2/2]

pangea_survey::StorageDescriptor::StorageDescriptor ( const StorageDescriptor & )
delete

Noncopyable: ownership cannot be shared by copying the FD number.

◆ ~StorageDescriptor()

pangea_survey::StorageDescriptor::~StorageDescriptor ( )
inline

Close an owned descriptor; use close() when the status matters.

Definition at line 56 of file map_storage.h.

Member Function Documentation

◆ close()

int pangea_survey::StorageDescriptor::close ( )
inline

Close explicitly and report the system call result.

Returns
Close status; the owner is empty even when close fails.

Clear ownership first so destruction cannot close a reused number.

Definition at line 70 of file map_storage.h.

◆ get()

int pangea_survey::StorageDescriptor::get ( ) const
inline

Borrow the descriptor without transferring ownership.

Returns
Open descriptor number, or -1.

Definition at line 59 of file map_storage.h.

◆ operator=()

StorageDescriptor & pangea_survey::StorageDescriptor::operator= ( const StorageDescriptor & )
delete

Nonassignable: use reset() to replace the owned descriptor.

◆ reset()

void pangea_survey::StorageDescriptor::reset ( int descriptor)
inline

Relinquish the old descriptor and adopt a distinct replacement.

Parameters
descriptorNew owned descriptor, or -1 to leave the slot empty.

The old close status is not reported; do not pass get() back in.

Definition at line 63 of file map_storage.h.

Field Documentation

◆ descriptor_

int pangea_survey::StorageDescriptor::descriptor_
private

Definition at line 46 of file map_storage.h.


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