4#include "include/column_data/column.h"
14namespace ehm_dal::column_data {
39 void add(std::shared_ptr<ehm_dal::tables::AbstractTable>
table,
const qint32 column_index);
45 void add(std::shared_ptr<ehm_dal::tables::AbstractTable>
table,
46 const std::vector<qint32> &column_indexes);
51 void addAll(std::shared_ptr<ehm_dal::tables::AbstractTable>
table);
64 std::optional<qint32>
columnId(
const qint32 column_index)
const;
73 QModelIndex
index(
const qint32 row,
const qint32 column_index)
const;
85 QModelIndex
index(
const qint32 row,
86 const qint32 column_index,
87 const qint32 parent_row,
88 const qint32 parent_column = 0)
const;
94 std::shared_ptr<ehm_dal::tables::AbstractTable>
table(
const qint32 column_index)
const;
106 qint32
rowCount(
const qint32 table_index = 0)
const;
111 qint32 column_id_{0};
112 qint32 table_index_{0};
114 ColumnIndex(
const qint32 table_index,
const qint32 column_id);
118 std::vector<ColumnIndex> indexes_;
119 std::vector<std::shared_ptr<ehm_dal::tables::AbstractTable>> tables_;
127 qint32 addTable(std::shared_ptr<ehm_dal::tables::AbstractTable>
table);
The Column class represents a column of data in a Table.
Definition: column.h:19
The ColumnIndexList class is a container/list of ehm_dal::column_data::Column indexes from ehm_dal:...
Definition: column_index_list.h:24
void add(std::shared_ptr< ehm_dal::tables::AbstractTable > table, const std::vector< qint32 > &column_indexes)
Adds all of the column_indexes from the table to the column list.
const Column * column(const qint32 column_index) const
Returns a raw pointer to the Column with a column index of column_index.
ColumnIndexList(std::shared_ptr< ehm_dal::tables::AbstractTable > table)
Constructs a ColumnIndexList using all columns from table
qint32 columnCount() const
Returns the number of columns.
std::optional< qint32 > columnId(const qint32 column_index) const
Returns the column id of the Column with a column index of column_index.
qint32 rowCount(const qint32 table_index=0) const
Returns the number of rows for the selected table.
QModelIndex index(const qint32 row, const qint32 column_index, const qint32 parent_row, const qint32 parent_column=0) const
Returns a QModelIndex for row and column_index with a parent of parent_row and parent_column using th...
void addAll(std::shared_ptr< ehm_dal::tables::AbstractTable > table)
Adds all columns from the table to the column list.
QModelIndex index(const qint32 row, const qint32 column_index) const
Returns a QModelIndex for row and column_index using the table to which column_index relates....
std::shared_ptr< ehm_dal::tables::AbstractTable > table(const qint32 column_index) const
Returns a shared_pointer to the AbstractTable relating tocolumn_index.
void add(std::shared_ptr< ehm_dal::tables::AbstractTable > table, const qint32 column_index)
Adds the column_index from the table to the column list.
namespace ehm_dal::tables
Definition: column.h:4