|
ReUseX
0.0.5
3D Point Cloud Processing for Building Reuse
|
Namespaces | |
| namespace | database |
| namespace | filters |
| namespace | gui |
| namespace | view |
Classes | |
| class | StageParams |
| Accumulates stage parameters as a JSON object. More... | |
| class | VizualizationObserver |
Functions | |
| int | exit_code_for (const reusex::pipeline::StageResult &result) |
| Map a library stage outcome onto a rux exit code. | |
| int | exit_code_for (int status) |
| Translate a run_subcommand_* return value into a process exit code. | |
| void | finish (int status) |
| Hand a run_subcommand_* status to CLI11 so that it reaches the process exit code. | |
| void | setup_processing_observer () |
| void | start_viewer () |
| void | wait_for_viewer () |
| VizualizationObserver & | get_processing_observer () |
| int | run (int argc, char **argv) |
| The whole of the rux CLI, minus the main() symbol itself (#249). | |
| int | check_stage_prerequisites (const reusex::ProjectDB &db, reusex::core::PipelineStage stage, const reusex::core::ArtifactOverrides &overrides={}) |
Check stage's documented inputs against db and report any problem on the CLI log, including the derived "run these commands in order" hint. | |
| int rux::check_stage_prerequisites | ( | const reusex::ProjectDB & | db, |
| reusex::core::PipelineStage | stage, | ||
| const reusex::core::ArtifactOverrides & | overrides = {} ) |
Check stage's documented inputs against db and report any problem on the CLI log, including the derived "run these commands in order" hint.
| overrides | Substitutions for the artifact names a flag can retarget (e.g. {{"labels", opt.semantic_cloud_name}}). |
|
inline |
Map a library stage outcome onto a rux exit code.
invalid_input is what keeps rux create planes -f 'bogus' reporting INVALID_ARGUMENT rather than a generic error, as it did when the subcommand evaluated the filter itself.
Definition at line 32 of file stage_bridge.hpp.
References GENERIC, INVALID_ARGUMENT, reusex::pipeline::StageResult::invalid_input, reusex::pipeline::StageResult::ok, and SUCCESS.
Referenced by finish().
|
inline |
Translate a run_subcommand_* return value into a process exit code.
RuxError values are negative (GENERIC == -1 … NOT_IMPLEMENTED == -4) but a process exit status carries only the low 8 bits, so returning them unchanged would surface to a shell as 255/254/253/252. Mirror them onto small positive codes instead and clamp into 1–125, the range a shell reserves for program status (126/127 mean "not executable"/"not found" and 128+n means "killed by signal n").
Definition at line 23 of file exit_status.hpp.
References SUCCESS.
|
inline |
Hand a run_subcommand_* status to CLI11 so that it reaches the process exit code.
CLI11 takes subcommand callbacks as std::function<void()>, so a callback that merely returns its status has that status silently discarded and rux exits 0 even though the stage failed (issue #299). Wrapping every call in rux::finish() closes that gap:
A successful status returns normally, so long-running and interactive subcommands (view, gui) keep their existing lifecycle: the throw can only happen after run_subcommand_* has already returned.
Definition at line 47 of file exit_status.hpp.
References exit_code_for(), and SUCCESS.
| VizualizationObserver & rux::get_processing_observer | ( | ) |
| int rux::run | ( | int | argc, |
| char ** | argv ) |
The whole of the rux CLI, minus the main() symbol itself (#249).
Installs the fatal-signal handlers and the async spdlog logger, builds the CLI::App, registers every subcommand, parses argv and runs the selected subcommand. The return value is already a process exit code (0 on success, 1-125 on failure — see exit_status.hpp), so main() only has to forward it.
Splitting this out of main() is what lets rux_lib be a static library the unit tests can link: an object file containing main cannot be linked into a Catch2 binary that supplies its own.
Not re-entrant: it mutates process-global state (signal dispositions, the spdlog default logger, the ReUseX log handler) and calls spdlog::shutdown() on the way out. Call it once, from main().
| void rux::setup_processing_observer | ( | ) |
| void rux::start_viewer | ( | ) |
| void rux::wait_for_viewer | ( | ) |