Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Namespaces | Concepts | Typedefs | Enumerations | Functions | Variables
data_table.hpp File Reference

Typed result tables with deferred presentation and numerical export. More...

#include "half_int.hpp"
#include "presentation.hpp"
#include <algorithm>
#include <array>
#include <concepts>
#include <cstdint>
#include <exception>
#include <map>
#include <memory>
#include <optional>
#include <ostream>
#include <span>
#include <stdexcept>
#include <string>
#include <string_view>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
Include dependency graph for data_table.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  uni20::presentation::data_attachment
 Attachment identity and any optional begin/replay/finalization failure. More...
 
class  uni20::presentation::data_column< T >
 Typed column schema with owned metadata and deferred display formatting. More...
 
struct  uni20::presentation::data_column_display
 Column display settings. These never change stored values or default export precision. More...
 
class  uni20::presentation::data_delivery_error
 Required output failed after all eligible sinks were attempted; retained rows are not rolled back. More...
 
struct  uni20::presentation::data_delivery_report
 Newly encountered failures. Callers using optional sinks must inspect this result. More...
 
struct  uni20::presentation::data_sink_failure
 Original exception and attachment identity for one disabled sink. More...
 
struct  uni20::presentation::data_sink_id
 A table-local attachment identifier, stable when its table is moved. More...
 
struct  uni20::presentation::data_sink_options
 
struct  uni20::presentation::data_sink_start
 The index of the first row this attachment can emit (zero for full replay). More...
 
class  uni20::presentation::data_table< Ts >
 Typed result table with synchronous sinks and optional retained history. More...
 
class  uni20::presentation::data_table_detail::classic_numeric_locale
 
struct  uni20::presentation::data_table_detail::optional_traits< T >
 
struct  uni20::presentation::data_table_detail::optional_traits< std::optional< T > >
 
struct  uni20::presentation::data_table_detail::resolved_projection
 
struct  uni20::presentation::data_table_options
 Construction-time table policy and initial application metadata. More...
 
struct  uni20::presentation::delimited_options
 Delimited output policy, independent of terminal styles and width. More...
 
struct  uni20::presentation::table_projection
 Ordered output columns and independent display overrides. Empty columns selects the full schema. More...
 

Namespaces

namespace  uni20
 
namespace  uni20::presentation
 
namespace  uni20::presentation::data_table_detail
 

Concepts

concept  uni20::presentation::data_table_detail::integer
 
concept  uni20::presentation::data_table_detail::supported_real
 
concept  uni20::presentation::DataTableValue
 Types retained directly by data tables, without numerical narrowing or text conversion.
 

Typedefs

using uni20::presentation::table_metadata = std::map< std::string, std::string >
 Application metadata is owned text, independent of numerical rows.
 
template<typename T >
using uni20::presentation::data_table_detail::value_type = typename optional_traits< T >::value_type
 

Enumerations

enum class  uni20::presentation::data_export_precision { uni20::presentation::round_trip , uni20::presentation::display }
 Precision for delimited numerical output; display mode deliberately rounds real values. More...
 
enum class  uni20::presentation::data_sink_operation { uni20::presentation::begin , uni20::presentation::row , uni20::presentation::finish }
 
enum class  uni20::presentation::data_sink_state { uni20::presentation::active , uni20::presentation::closed , uni20::presentation::failed }
 
enum class  uni20::presentation::retention { uni20::presentation::all , uni20::presentation::none }
 Whether accepted rows remain available for snapshots and replay. More...
 
enum class  uni20::presentation::sink_replay { uni20::presentation::all , uni20::presentation::future_only }
 Full replay is the default. Future-only attachment explicitly opts out of history. More...
 

Functions

template<typename To , typename From >
consteval bool uni20::presentation::data_table_detail::accepts ()
 
template<typename T >
std::string uni20::presentation::data_table_detail::cell_text (T const &value, data_column_display const &display, bool machine)
 
void uni20::presentation::data_table_detail::check_output (std::ostream &out)
 
template<typename To , typename From >
requires (accepts<To, From>())
To uni20::presentation::data_table_detail::convert (From &&input)
 
template<typename T >
std::string uni20::presentation::data_table_detail::export_text (T const &value, data_column_display const &display, delimited_options const &options)
 
template<DataTableValue... Ts>
auto uni20::presentation::make_data_table (std::string title, data_column< Ts >... columns)
 Deduce column types with default retained history.
 
template<DataTableValue... Ts>
auto uni20::presentation::make_data_table (std::string title, data_table_options options, data_column< Ts >... columns)
 Deduce column types with an explicit retention policy and initial metadata.
 
template<Real T>
std::string uni20::presentation::data_table_detail::real_text (T value, scalar_format_options options)
 
template<typename Schema >
resolved_projection uni20::presentation::data_table_detail::resolve_projection (Schema const &schema, table_projection const &options)
 
template<DataTableValue... Ts>
report_table uni20::presentation::to_report_table (data_table< Ts... > const &table, table_projection const &projection={})
 Format a snapshot using column display settings and the existing rich table model.
 
void uni20::presentation::data_table_detail::validate_identifier (std::string_view identifier)
 
void uni20::presentation::data_table_detail::validate_numeric_precision (real_format_notation notation, int digits)
 
template<typename Schema , typename Row , typename Function >
void uni20::presentation::data_table_detail::visit_cells (Schema const &schema, Row const &row, Function &&function)
 
template<typename Schema , typename Function >
void uni20::presentation::data_table_detail::visit_column (Schema const &schema, std::size_t index, Function &&function)
 
template<typename Schema , typename Row , typename Function >
void uni20::presentation::data_table_detail::visit_selected (Schema const &schema, Row const &row, resolved_projection const &selection, Function &&function)
 
template<DataTableValue... Ts>
void uni20::presentation::write_csv (std::ostream &out, data_table< Ts... > const &table, delimited_options options={})
 Write a CSV snapshot with stable headers, quoted strings and empty missing numeric fields.
 
template<DataTableValue... Ts>
void uni20::presentation::data_table_detail::write_delimited (std::ostream &out, data_table< Ts... > const &table, char delimiter, delimited_options const &options)
 
template<typename Schema >
void uni20::presentation::data_table_detail::write_delimited_header (std::ostream &out, Schema const &schema, resolved_projection const &selection, char delimiter)
 
template<typename Schema , typename Row >
void uni20::presentation::data_table_detail::write_delimited_row (std::ostream &out, Schema const &schema, Row const &row, resolved_projection const &selection, char delimiter, delimited_options const &options)
 
void uni20::presentation::data_table_detail::write_field (std::ostream &out, std::string_view field, char delimiter, bool quote_empty)
 
template<DataTableValue... Ts>
void uni20::presentation::write_tsv (std::ostream &out, data_table< Ts... > const &table, delimited_options options={})
 Write tab-delimited CSV using CSV quoting, not whitespace-token splitting.
 

Variables

template<typename T >
constexpr bool uni20::presentation::data_table_detail::half_integer = false
 
template<std::signed_integral T>
constexpr bool uni20::presentation::data_table_detail::half_integer< basic_half_int< T > > = true
 
template<typename T >
constexpr bool uni20::presentation::data_table_detail::runtime_real = false
 

Detailed Description

Typed result tables with deferred presentation and numerical export.