Quantum 3xplorer (Q3)
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
"
15
#include "
io/input/parser/input_format_registry.hpp
"
16
#include "
io/output/results.hpp
"
17
18
namespace
q3
{
19
20
/// Write the companion outputs of the format `input` was read from, if it has any.
21
inline
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
q3::InputFormat
One input format a run can be read from; see the file comment.
Definition
input_format.hpp:36
data.hpp
input_format_registry.hpp
q3
Definition
q3_core_api.hpp:33
q3::input_format_registry
Registry< InputFormat > & input_format_registry()
The registry every entry point reads input formats from.
Definition
input_format_registry.hpp:23
q3::write_companion_outputs
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.
Definition
companion_outputs.hpp:21
results.hpp
q3::InputData
Parsed input data — holds raw values read from input files.
Definition
data.hpp:27
q3::InputData::source_format
std::string source_format
Definition
data.hpp:174
src
io
output
companion_outputs.hpp
Generated by
1.9.8