|
Celeritas 0.7.0-3+develop.835656ac1
|
Store classes that can output data at the end of the run. More...
#include <OutputRegistry.hh>
Public Types | |
| enum class | OpenMode { app , trunc } |
Type aliases | |
| using | SPConstInterface = std::shared_ptr< OutputInterface const > |
Public Member Functions | |
| void | open (std::string s) |
Open a persistent file to write with output. | |
| void | open (std::string s, OpenMode) |
Open a persistent file to write with output. | |
| void | close () |
| Close persistent file if open. | |
| std::string const & | output_filename () const |
| Get persistent output filename (debug error if not open). | |
| void | output () const |
| Output all classes to the persistent filename. | |
| bool | is_open () const |
| Whether a persistent file is open. | |
| void | insert (SPConstInterface) |
| Add an interface for writing. | |
| void | output (JsonPimpl *) const |
| Output all classes to a JSON object. | |
| void | output (std::ostream *os) const |
| Output all classes to a JSON object that's written to the given stream. | |
| bool | empty () const |
| Whether no output has been registered. | |
| void | clear () |
| Clear output interfaces. | |
Static Public Member Functions | |
| static std::string | stdout_filename () |
| Special filename for writing persistent output to stdout. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, OutputRegistry const ®) |
| Output to a stream. | |
Store classes that can output data at the end of the run.
Each output interface defines a category (e.g. input, result, system) and a name. The output manager then writes the JSON output from that entry into a nested database:
{"category": {"label": "data"}}
* | void celeritas::OutputRegistry::clear | ( | ) |
Clear output interfaces.
This is useful when printing to a persistent file in JSONL format: the first write includes all the problem setup metadata, and subsequent writes can just include the results (which are presumably added by whoever calls "clear" after).
| void celeritas::OutputRegistry::open | ( | std::string | s | ) |
Open a persistent file to write with output.
This signature defaults to overwriting a file or streaming to stdout.
Open a persistent file to write with output.
only open on the main process.