TableView
TableView
The main orchestrator for tabular data views with lazy evaluation. More…
#include <TableView.h>
Public Functions
| Name | |
|---|---|
| TableView(TableView && other) | |
| TableView & | operator=(TableView && other) |
| TableView(const TableView & other) =delete | |
| TableView & | operator=(const TableView & other) =delete |
| size_t | getRowCount() const Gets the number of rows in the table. |
| size_t | getColumnCount() const Gets the number of columns in the table. |
| template <SupportedColumnType T> std::vector< T > const & |
getColumnValues(std::string const & name) Gets the values of a column with the specified type. |
| std::vector< std::string > | getColumnNames() const Gets the names of all columns in the table. |
| bool | hasColumn(std::string const & name) const Checks if a column exists in the table. |
| std::type_info const & | getColumnType(std::string const & name) const Gets the runtime type information for a column. |
| std::type_index | getColumnTypeIndex(std::string const & name) const Gets the type index for a column. |
| ColumnDataVariant | getColumnDataVariant(std::string const & name) Gets column data as a variant, avoiding try/catch for type detection. |
| template <typename Visitor > decltype(auto) |
visitColumnData(std::string const & name, Visitor && visitor) Applies a visitor to column data in a type-safe manner. |
| void | materializeAll() Materializes all columns in the table. |
| void | clearCache() Clears all cached data, forcing recomputation on next access. |
| TableViewRowDescriptor | getRowDescriptor(size_t row_index) const Gets a descriptor containing the source information for a given row index. |
| std::vector< EntityId > | getRowEntityIds(size_t row_index) const Get contributing EntityIds for a given row, if available. |
| bool | hasEntityColumn() const Check if this table has EntityID information available. |
| std::vector< std::vector< EntityId > > | getEntityIds() const Get all EntityIds for all rows in the table. |
| void | setDirectEntityIds(std::vector< std::vector< EntityId > > entity_ids) Set EntityIds directly for transformed tables. |
| bool | hasColumnEntityIds(std::string const & name) const Check if a specific column has EntityID information available. |
| ColumnEntityIds | getColumnEntityIds(std::string const & name) const Get EntityIds for a specific column. |
| std::vector< EntityId > | getCellEntityIds(std::string const & column_name, size_t row_index) const Get all contributing EntityIDs for a specific cell. |
| std::unique_ptr< IRowSelector > | cloneRowSelectorFiltered(std::vector< size_t > const & keep_indices) const Create a new row selector of the same concrete type, filtered to a subset of rows. |
| std::shared_ptr< DataManagerExtension > | getDataManagerExtension() const Access the data manager extension backing this table. |
Friends
| Name | |
|---|---|
| class | TableViewBuilder |
| class | Column |
Detailed Description
class TableView;The main orchestrator for tabular data views with lazy evaluation.
TableView manages a collection of heterogeneous columns and provides unified access to tabular data. It implements lazy evaluation with caching for both individual columns and ExecutionPlans. The TableView handles dependency resolution and ensures columns are computed in the correct order.
Public Functions Documentation
function TableView
TableView(
TableView && other
)function operator=
TableView & operator=(
TableView && other
)function TableView
TableView(
const TableView & other
) =deletefunction operator=
TableView & operator=(
const TableView & other
) =deletefunction getRowCount
size_t getRowCount() constGets the number of rows in the table.
Return: The row count as determined by the row selector.
function getColumnCount
size_t getColumnCount() constGets the number of columns in the table.
Return: The column count.
function getColumnValues
template <SupportedColumnType T>
std::vector< T > const & getColumnValues(
std::string const & name
)Gets the values of a column with the specified type.
Parameters:
- name The name of the column to retrieve.
Exceptions:
- std::runtime_error if the column is not found or type mismatch.
Template Parameters:
- T The expected type of the column data.
Return: Reference to the column’s data vector.
This method provides type-safe access to column data. It performs a dynamic_cast to ensure the column is of the correct type, and triggers computation if the column is not yet materialized.
function getColumnNames
std::vector< std::string > getColumnNames() constGets the names of all columns in the table.
Return: Vector of column names.
function hasColumn
bool hasColumn(
std::string const & name
) constChecks if a column exists in the table.
Parameters:
- name The column name to check.
Return: True if the column exists, false otherwise.
function getColumnType
std::type_info const & getColumnType(
std::string const & name
) constGets the runtime type information for a column.
Parameters:
- name The column name.
Exceptions:
- std::runtime_error if the column is not found.
Return: The std::type_info for the column’s data type.
function getColumnTypeIndex
std::type_index getColumnTypeIndex(
std::string const & name
) constGets the type index for a column.
Parameters:
- name The column name.
Exceptions:
- std::runtime_error if the column is not found.
Return: The std::type_index for the column’s data type.
function getColumnDataVariant
ColumnDataVariant getColumnDataVariant(
std::string const & name
)Gets column data as a variant, avoiding try/catch for type detection.
Parameters:
- name The column name.
Exceptions:
- std::runtime_error if the column is not found or type not supported.
Return: ColumnDataVariant containing the column data.
This method returns column data in a type-safe variant that contains all possible column types. Consumers can use std::visit or pattern matching to handle the data without try/catch blocks.
function visitColumnData
template <typename Visitor >
decltype(auto) visitColumnData(
std::string const & name,
Visitor && visitor
)Applies a visitor to column data in a type-safe manner.
Parameters:
- name The column name.
- visitor The visitor instance.
Exceptions:
- std::runtime_error if the column is not found or type not supported.
Template Parameters:
- Visitor The visitor type that implements visit methods for all supported types.
Return: The result of the visitor.
function materializeAll
void materializeAll()Materializes all columns in the table.
This method computes all columns that haven’t been materialized yet. It respects dependencies and computes columns in the correct order.
function clearCache
void clearCache()Clears all cached data, forcing recomputation on next access.
function getRowDescriptor
TableViewRowDescriptor getRowDescriptor(
size_t row_index
) constGets a descriptor containing the source information for a given row index.
Parameters:
- row_index The index of the row to get the descriptor for.
Return: RowDescriptor containing the source information for the row.
This method provides reverse lookup capability, allowing clients to trace a row back to its original source definition (e.g., timestamp, interval). This is particularly useful for interactive applications like plotting libraries that need to display tooltips or navigate back to source data.
function getRowEntityIds
std::vector< EntityId > getRowEntityIds(
size_t row_index
) constGet contributing EntityIds for a given row, if available.
Return: Vector of EntityIds; empty if not available.
function hasEntityColumn
bool hasEntityColumn() constCheck if this table has EntityID information available.
Return: True if EntityIDs are available for rows, false otherwise.
function getEntityIds
std::vector< std::vector< EntityId > > getEntityIds() constGet all EntityIds for all rows in the table.
Return: Vector of EntityIds, one per row. Empty vector if no EntityIDs available.
For tables where each row corresponds to a single entity, this returns a vector with one EntityId per row. For tables where rows can have multiple contributing entities, this returns the primary EntityId for each row.
function setDirectEntityIds
void setDirectEntityIds(
std::vector< std::vector< EntityId > > entity_ids
)Set EntityIds directly for transformed tables.
Parameters:
- entity_ids Vector of EntityIds, one per row
This method allows transforms to preserve EntityId information when creating new tables that don’t have execution plans linking back to original data sources.
function hasColumnEntityIds
bool hasColumnEntityIds(
std::string const & name
) constCheck if a specific column has EntityID information available.
Parameters:
- name The column name to check.
Return: True if EntityIDs are available for this column, false otherwise.
function getColumnEntityIds
ColumnEntityIds getColumnEntityIds(
std::string const & name
) constGet EntityIds for a specific column.
Parameters:
- name The column name.
Exceptions:
- std::runtime_error if the column is not found.
Return: Vector of EntityIds, one per row. Empty if not available.
This method returns EntityIDs that correspond to the data sources used to compute the specified column’s values. Each EntityID corresponds to a row in the table.
function getCellEntityIds
std::vector< EntityId > getCellEntityIds(
std::string const & column_name,
size_t row_index
) constGet all contributing EntityIDs for a specific cell.
Parameters:
- column_name The column name.
- row_index The row index.
Exceptions:
- std::runtime_error if the column is not found or row_index is out of bounds.
Return: Vector of EntityIDs that contributed to this cell. Empty if not available.
This method returns all EntityIDs that contributed to the computation of a specific cell in the table. For simple columns, this will return the same as getColumnEntityIds()[row_index]. For complex columns that aggregate data from multiple entities, this may return multiple EntityIDs.
function cloneRowSelectorFiltered
std::unique_ptr< IRowSelector > cloneRowSelectorFiltered(
std::vector< size_t > const & keep_indices
) constCreate a new row selector of the same concrete type, filtered to a subset of rows.
Parameters:
- keep_indices Indices of rows to keep (relative to this table’s current rows), in ascending order.
Return: A new row selector that preserves the original selector’s semantics while containing only the kept rows.
function getDataManagerExtension
inline std::shared_ptr< DataManagerExtension > getDataManagerExtension() constAccess the data manager extension backing this table.
Return: Shared pointer to the [DataManagerExtension](/api_generated/Classes/classDataManagerExtension.md).
Friends
friend TableViewBuilder
friend class TableViewBuilder(
TableViewBuilder
);friend Column
friend class Column(
Column
);Updated on 2026-11-13 at 20:25:39 +0000