Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
uni20::output_session Class Reference

An explicitly finalized set of owned result streams, with no global display changes. More...

#include <output_session.hpp>

Public Member Functions

template<presentation::DataTableValue... Ts>
output_report attach (presentation::data_table< Ts... > &table, std::string name, presentation::sink_replay replay=presentation::sink_replay::all, std::vector< std::size_t > destinations={})
 Replay selected destinations, then subscribe them to future rows.
 
std::size_t file (std::filesystem::path path, output_format format, output_destination_options options={})
 
output_report finish (metadata_document summary={})
 Write the run summary, flush and close every destination, preserving original and cleanup failures.
 
output_report flush ()
 Flush all active destinations without ending tables or writing summaries. Does not fsync.
 
output_report open ()
 Preflight aliases before opening any files, then emit the human/comment preamble once.
 
output_session & operator= (output_session &&)=delete
 
output_session & operator= (output_session const &)=delete
 
 output_session (metadata_document initial={}, bool quiet=false)
 
 output_session (output_session &&)=default
 
 output_session (output_session const &)=delete
 
output_report report () const
 
std::size_t standard_output (output_format format=output_format::terminal, output_destination_options options={})
 
std::size_t stream (std::string name, std::shared_ptr< std::ostream > out, output_format format, output_destination_options options={}, std::function< void()> close={})
 Retain a shared stream owner. An optional explicit closer participates in finish error reporting.
 
template<presentation::DataTableValue... Ts>
output_report write_table (presentation::data_table< Ts... > &table, std::string name, presentation::table_metadata summary={})
 Export retained rows, closing only these subscriptions and leaving the source table appendable.
 

Detailed Description

An explicitly finalized set of owned result streams, with no global display changes.

Single-caller. Finish tables before finishing the session. Destruction only releases resources; it never certifies successful output. Failures disable the destination, all other destinations are attempted, and required failures are thrown after delivery. Rows are never retried. After a destination has opened, registration preflights new additions and rolls them back on error, leaving existing destinations usable. Initial registrations are preflighted together at open().

Constructor & Destructor Documentation

◆ output_session() [1/3]

uni20::output_session::output_session ( metadata_document  initial = {},
bool  quiet = false 
)
inlineexplicit

◆ output_session() [2/3]

uni20::output_session::output_session ( output_session const &  )
delete

◆ output_session() [3/3]

uni20::output_session::output_session ( output_session &&  )
default

Member Function Documentation

◆ attach()

template<presentation::DataTableValue... Ts>
output_report uni20::output_session::attach ( presentation::data_table< Ts... > &  table,
std::string  name,
presentation::sink_replay  replay = presentation::sink_replay::all,
std::vector< std::size_t >  destinations = {} 
)
inline

Replay selected destinations, then subscribe them to future rows.

◆ file()

std::size_t uni20::output_session::file ( std::filesystem::path  path,
output_format  format,
output_destination_options  options = {} 
)

◆ finish()

output_report uni20::output_session::finish ( metadata_document  summary = {})

Write the run summary, flush and close every destination, preserving original and cleanup failures.

Named JSON records document status "complete" independently of scientific outcome in the summary. Flush and close can still fail; check the returned report or exception. Repeated calls return/rethrow the recorded report without repeating any writes.

◆ flush()

output_report uni20::output_session::flush ( )

Flush all active destinations without ending tables or writing summaries. Does not fsync.

◆ open()

output_report uni20::output_session::open ( )

Preflight aliases before opening any files, then emit the human/comment preamble once.

◆ operator=() [1/2]

output_session & uni20::output_session::operator= ( output_session &&  )
delete

◆ operator=() [2/2]

output_session & uni20::output_session::operator= ( output_session const &  )
delete

◆ report()

output_report uni20::output_session::report ( ) const

◆ standard_output()

std::size_t uni20::output_session::standard_output ( output_format  format = output_format::terminal,
output_destination_options  options = {} 
)

◆ stream()

std::size_t uni20::output_session::stream ( std::string  name,
std::shared_ptr< std::ostream >  out,
output_format  format,
output_destination_options  options = {},
std::function< void()>  close = {} 
)

Retain a shared stream owner. An optional explicit closer participates in finish error reporting.

◆ write_table()

template<presentation::DataTableValue... Ts>
output_report uni20::output_session::write_table ( presentation::data_table< Ts... > &  table,
std::string  name,
presentation::table_metadata  summary = {} 
)
inline

Export retained rows, closing only these subscriptions and leaving the source table appendable.

No row copies are made. An already finished table replays its original summary.


The documentation for this class was generated from the following files: