TableViewBuilder
TableViewBuilder
Builder class for constructing TableView objects with a fluent API. More…
#include <TableViewBuilder.h>
Public Functions
| Name | |
|---|---|
| TableViewBuilder(std::shared_ptr< DataManagerExtension > dataManager) Constructs a TableViewBuilder with the given data manager. |
|
| ~TableViewBuilder() | |
| TableViewBuilder & | setRowSelector(std::unique_ptr< IRowSelector > rowSelector) Sets the row selector that defines the table rows. |
| TableViewBuilder & | addColumn(std::string const & name, std::unique_ptr< IColumnComputer< double > > computer) Adds a column to the table being built. |
| template <typename T > TableViewBuilder & |
addColumn(std::string const & name, std::unique_ptr< IColumnComputer< T > > computer) Adds a templated column to the table being built. |
| template <typename T > TableViewBuilder & |
addColumns(std::string const & baseName, std::unique_ptr< IMultiColumnComputer< T > > computer) Adds multiple columns backed by a single multi-output computer. |
| TableView | build() Builds the final TableView object. |
Detailed Description
class TableViewBuilder;Builder class for constructing TableView objects with a fluent API.
The TableViewBuilder provides a step-by-step, fluent API for constructing TableView objects, simplifying the setup of complex configurations.
Public Functions Documentation
function TableViewBuilder
explicit TableViewBuilder(
std::shared_ptr< DataManagerExtension > dataManager
)Constructs a TableViewBuilder with the given data manager.
Parameters:
- dataManager Shared pointer to the data manager extension.
function ~TableViewBuilder
~TableViewBuilder()function setRowSelector
TableViewBuilder & setRowSelector(
std::unique_ptr< IRowSelector > rowSelector
)Sets the row selector that defines the table rows.
Parameters:
- rowSelector Unique pointer to the row selector.
Return: Reference to this builder for method chaining.
function addColumn
TableViewBuilder & addColumn(
std::string const & name,
std::unique_ptr< IColumnComputer< double > > computer
)Adds a column to the table being built.
Parameters:
- name The name of the column.
- computer Unique pointer to the column computer.
Return: Reference to this builder for method chaining.
function addColumn
template <typename T >
TableViewBuilder & addColumn(
std::string const & name,
std::unique_ptr< IColumnComputer< T > > computer
)Adds a templated column to the table being built.
Parameters:
- name The name of the column.
- computer Unique pointer to the templated column computer.
Template Parameters:
- T The type of the column data.
Return: Reference to this builder for method chaining.
function addColumns
template <typename T >
TableViewBuilder & addColumns(
std::string const & baseName,
std::unique_ptr< IMultiColumnComputer< T > > computer
)Adds multiple columns backed by a single multi-output computer.
Parameters:
- baseName Base name for the columns; per-output suffixes are provided by the computer.
- computer Unique pointer to the multi-output computer.
Template Parameters:
- T Element type of the outputs.
Return: Reference to this builder for method chaining.
function build
TableView build()Builds the final TableView object.
Exceptions:
- std::runtime_error if the configuration is invalid.
Return: The constructed TableView object.
This method validates the configuration and constructs the TableView. After calling build(), the builder is in an invalid state and should not be used further.
Updated on 2026-11-13 at 20:25:39 +0000