Loading...
Searching...
No Matches
companion_outputs.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * Hand a finished run back to the input format it was read from.
5 *
6 * Some input formats come with conventions for what a finished run leaves
7 * beside its results, and the pipelines built around them read those files.
8 * The format that parsed the input knows which files they are, so every entry
9 * point calls this once, after results.json is written, and the format writes
10 * its own (InputFormat::write_companion_outputs). A run read from a format
11 * with no such convention, or assembled in code, writes nothing more.
12 */
13
14#include "io/input/data.hpp"
16#include "io/output/results.hpp"
17
18namespace q3 {
19
20/// Write the companion outputs of the format `input` was read from, if it has any.
21inline void write_companion_outputs(const InputData& input, const generated::Results& results) {
22 if (const InputFormat* format = input_format_registry().find(input.source_format))
23 format->write_companion_outputs(input, results);
24}
25
26} // namespace q3
One input format a run can be read from; see the file comment.
Registry< InputFormat > & input_format_registry()
The registry every entry point reads input formats from.
void write_companion_outputs(const InputData &input, const generated::Results &results)
Write the companion outputs of the format input was read from, if it has any.
Parsed input data — holds raw values read from input files.
Definition data.hpp:27
std::string source_format
Definition data.hpp:174