Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
uni20::presentation::data_table< Ts > Class Template Reference

Typed result table with synchronous sinks and optional retained history. More...

#include <data_table.hpp>

Public Types

using row_type = std::tuple< Ts... >
 
using schema_type = std::tuple< data_column< Ts >... >
 

Public Member Functions

template<typename... Us>
requires (sizeof...(Ts) == sizeof...(Us) && (data_table_detail::accepts<Ts, Us>() && ...))
data_delivery_report append (Us &&... values)
 Validate once, retain when enabled, then deliver to every active sink in attachment order.
 
template<typename Sink >
data_attachment attach (Sink &&output, data_sink_options options={})
 Own a sink, begin its output and replay history before subscribing to future rows.
 
schema_type const & columns () const noexcept
 
 data_table (data_table &&)=default
 
 data_table (data_table const &)=delete
 
 data_table (std::string title, data_column< Ts >... columns)
 
 data_table (std::string title, data_table_options options, data_column< Ts >... columns)
 
data_delivery_report finish (table_metadata summary={})
 End row insertion and finalize all active outputs, retaining the summary for later replay.
 
data_delivery_report finish_sink (data_sink_id id, table_metadata const &summary={})
 Finalize and unsubscribe one sink without ending the table or discarding rows.
 
bool finished () const noexcept
 
table_metadata const & metadata () const noexcept
 
data_table & operator= (data_table &&)=delete
 
data_table & operator= (data_table const &)=delete
 
std::size_t retained_size () const noexcept
 
retention retention_policy () const noexcept
 
std::span< row_type const > rows () const
 Require complete retained history before inspecting or exporting rows.
 
data_sink_state sink_state (data_sink_id id) const
 
std::size_t size () const noexcept
 
std::optional< table_metadata > const & summary () const noexcept
 
std::string const & title () const noexcept
 

Static Public Member Functions

template<typename... Us>
requires (sizeof...(Ts) == sizeof...(Us) && (data_table_detail::accepts<Ts, Us>() && ...))
static row_type make_row (Us &&... values)
 Construct a checked, owning row independently of storage or output.
 

Detailed Description

template<DataTableValue... Ts>
class uni20::presentation::data_table< Ts >

Typed result table with synchronous sinks and optional retained history.

Move-only: copying live outputs would duplicate delivery. Call finish explicitly to observe flush errors. Mutation is single-caller and non-reentrant; sink callbacks receive borrowed const schema/rows.

Member Typedef Documentation

◆ row_type

template<DataTableValue... Ts>
using uni20::presentation::data_table< Ts >::row_type = std::tuple<Ts...>

◆ schema_type

template<DataTableValue... Ts>
using uni20::presentation::data_table< Ts >::schema_type = std::tuple<data_column<Ts>...>

Constructor & Destructor Documentation

◆ data_table() [1/4]

template<DataTableValue... Ts>
uni20::presentation::data_table< Ts >::data_table ( std::string  title,
data_column< Ts >...  columns 
)
inline

◆ data_table() [2/4]

template<DataTableValue... Ts>
uni20::presentation::data_table< Ts >::data_table ( std::string  title,
data_table_options  options,
data_column< Ts >...  columns 
)
inline

◆ data_table() [3/4]

template<DataTableValue... Ts>
uni20::presentation::data_table< Ts >::data_table ( data_table< Ts > const &  )
delete

◆ data_table() [4/4]

template<DataTableValue... Ts>
uni20::presentation::data_table< Ts >::data_table ( data_table< Ts > &&  )
default

Member Function Documentation

◆ append()

template<DataTableValue... Ts>
template<typename... Us>
requires (sizeof...(Ts) == sizeof...(Us) && (data_table_detail::accepts<Ts, Us>() && ...))
data_delivery_report uni20::presentation::data_table< Ts >::append ( Us &&...  values)
inline

Validate once, retain when enabled, then deliver to every active sink in attachment order.

Conversion failure leaves the table unchanged. Output failure occurs after row acceptance; inspect optional failures in the returned report and never retry a failed delivery automatically.

◆ attach()

template<DataTableValue... Ts>
template<typename Sink >
data_attachment uni20::presentation::data_table< Ts >::attach ( Sink &&  output,
data_sink_options  options = {} 
)
inline

Own a sink, begin its output and replay history before subscribing to future rows.

Sink must provide begin(title, schema, metadata, start), row(schema, row), and finish(summary). Streams/resources borrowed by a sink must outlive its attachment. Failed sinks are disabled.

◆ columns()

template<DataTableValue... Ts>
schema_type const & uni20::presentation::data_table< Ts >::columns ( ) const
inlinenoexcept

◆ finish()

template<DataTableValue... Ts>
data_delivery_report uni20::presentation::data_table< Ts >::finish ( table_metadata  summary = {})
inline

End row insertion and finalize all active outputs, retaining the summary for later replay.

Repeated finish with no new summary (or the same summary) does not write again. Destruction never substitutes for explicit finalization; snapshots remain available afterwards.

◆ finish_sink()

template<DataTableValue... Ts>
data_delivery_report uni20::presentation::data_table< Ts >::finish_sink ( data_sink_id  id,
table_metadata const &  summary = {} 
)
inline

Finalize and unsubscribe one sink without ending the table or discarding rows.

◆ finished()

template<DataTableValue... Ts>
bool uni20::presentation::data_table< Ts >::finished ( ) const
inlinenoexcept

◆ make_row()

template<DataTableValue... Ts>
template<typename... Us>
requires (sizeof...(Ts) == sizeof...(Us) && (data_table_detail::accepts<Ts, Us>() && ...))
static row_type uni20::presentation::data_table< Ts >::make_row ( Us &&...  values)
inlinestatic

Construct a checked, owning row independently of storage or output.

◆ metadata()

template<DataTableValue... Ts>
table_metadata const & uni20::presentation::data_table< Ts >::metadata ( ) const
inlinenoexcept

◆ operator=() [1/2]

template<DataTableValue... Ts>
data_table & uni20::presentation::data_table< Ts >::operator= ( data_table< Ts > &&  )
delete

◆ operator=() [2/2]

template<DataTableValue... Ts>
data_table & uni20::presentation::data_table< Ts >::operator= ( data_table< Ts > const &  )
delete

◆ retained_size()

template<DataTableValue... Ts>
std::size_t uni20::presentation::data_table< Ts >::retained_size ( ) const
inlinenoexcept

◆ retention_policy()

template<DataTableValue... Ts>
retention uni20::presentation::data_table< Ts >::retention_policy ( ) const
inlinenoexcept

◆ rows()

template<DataTableValue... Ts>
std::span< row_type const > uni20::presentation::data_table< Ts >::rows ( ) const
inline

Require complete retained history before inspecting or exporting rows.

◆ sink_state()

template<DataTableValue... Ts>
data_sink_state uni20::presentation::data_table< Ts >::sink_state ( data_sink_id  id) const
inline

◆ size()

template<DataTableValue... Ts>
std::size_t uni20::presentation::data_table< Ts >::size ( ) const
inlinenoexcept

◆ summary()

template<DataTableValue... Ts>
std::optional< table_metadata > const & uni20::presentation::data_table< Ts >::summary ( ) const
inlinenoexcept

◆ title()

template<DataTableValue... Ts>
std::string const & uni20::presentation::data_table< Ts >::title ( ) const
inlinenoexcept

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