morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::table::DataSource Class Referenceabstract

The rows of a table, as the engine reads them. More...

#include <data_source.hpp>

Inheritance diagram for morph::table::DataSource:
morph::table::RowsSource< Row > morph::table::VectorSource

Public Member Functions

virtual std::span< ColumnInfo const > columns () const =0
 The table's columns.
virtual std::shared_ptr< RowSnapshot const > snapshot () const =0
 The current rows as an immutable snapshot. Taking one is cheap.
virtual void subscribe (ChangeListener &listener)=0
 Registers listener for change notifications.
virtual void unsubscribe (ChangeListener &listener)=0
 Removes listener.

Detailed Description

The rows of a table, as the engine reads them.

Owner-affine: every member is called on the owner thread. The engine reads cells only from snapshot(), which it may hand to a worker.

Definition at line 732 of file data_source.hpp.

Member Function Documentation

◆ columns()

virtual std::span< ColumnInfo const > morph::table::DataSource::columns ( ) const
nodiscardpure virtual

The table's columns.

Returns
The columns, in source order.

Implemented in morph::table::RowsSource< Row >, and morph::table::VectorSource.

◆ snapshot()

virtual std::shared_ptr< RowSnapshot const > morph::table::DataSource::snapshot ( ) const
nodiscardpure virtual

The current rows as an immutable snapshot. Taking one is cheap.

Returns
The snapshot.

Implemented in morph::table::RowsSource< Row >, and morph::table::VectorSource.

◆ subscribe()

virtual void morph::table::DataSource::subscribe ( ChangeListener & listener)
pure virtual

Registers listener for change notifications.

Parameters
listenerReceives notifications until unsubscribe; must outlive the subscription.

Implemented in morph::table::RowsSource< Row >, and morph::table::VectorSource.

◆ unsubscribe()

virtual void morph::table::DataSource::unsubscribe ( ChangeListener & listener)
pure virtual

Removes listener.

Parameters
listenerA listener previously subscribed.

Implemented in morph::table::RowsSource< Row >, and morph::table::VectorSource.


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