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
binary_output.h File Reference

Publish immutable result files without exposing partial contents. More...

Include dependency graph for binary_output.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void saveBinary (const fs::path &path, const void *data, std::size_t size)
 Write bytes to a new path and publish them by same-directory rename.

Detailed Description

Publish immutable result files without exposing partial contents.

A sibling temporary file allows readers to see either no result or the complete renamed result. Existing targets are rejected because survey products are evidence; silently replacing one could conceal a prior run. This helper provides atomic visibility on the same filesystem, not an fsync durability guarantee.

Definition in file binary_output.h.

Function Documentation

◆ saveBinary()

void saveBinary ( const fs::path & path,
const void * data,
std::size_t size )
inline

Write bytes to a new path and publish them by same-directory rename.

Parameters
[in]pathFinal output path; it and its .partial sibling must not exist.
[in]dataAddress of the bytes to write; may be null only when size is zero.
[in]sizeNumber of bytes to publish.
Exceptions
std::runtime_errorIf output exists, writing fails, or rename fails.
Note
Rename prevents readers from observing a partially written target; use the durable checkpoint helpers when crash/power-loss durability matters.

Definition at line 41 of file binary_output.h.