EHM DAL 0.2.5
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
ehm_dal::column_data::ColumnIndexList Class Reference

The ColumnIndexList class is a container/list of ehm_dal::column_data::Column
indexes from ehm_dal::column_data::ColumnData. It provides a convenient way of creating a list of various columns from one or more ehm_dal::column_data::ColumnData. In other words, it represents a list of column indexes from one or more tables. More...

#include <column_index_list.h>

Public Member Functions

 ColumnIndexList (std::shared_ptr< ehm_dal::tables::AbstractTable > table)
 Constructs a ColumnIndexList using all columns from table
 
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.
 
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.
 
void addAll (std::shared_ptr< ehm_dal::tables::AbstractTable > table)
 Adds all columns from the table to the column list.
 
const Columncolumn (const qint32 column_index) const
 Returns a raw pointer to the Column with a column index of column_index.
 
std::optional< qint32 > columnId (const qint32 column_index) const
 Returns the column id of the Column with a column index of column_index.
 
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. This is equivalent to ehm_dal::tables::AbstractTable::index(row, column_index).
 
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 the table to which column_index relates. This is equivalent to ehm_dal::tables::AbstractTable::index(row, column_index, QModelIndex(parent_row, parent_column)).
 
std::shared_ptr< ehm_dal::tables::AbstractTabletable (const qint32 column_index) const
 Returns a shared_pointer to the AbstractTable relating tocolumn_index.
 
qint32 columnCount () const
 Returns the number of columns.
 
qint32 rowCount (const qint32 table_index=0) const
 Returns the number of rows for the selected table.
 

Detailed Description

The ColumnIndexList class is a container/list of ehm_dal::column_data::Column
indexes from ehm_dal::column_data::ColumnData. It provides a convenient way of creating a list of various columns from one or more ehm_dal::column_data::ColumnData. In other words, it represents a list of column indexes from one or more tables.

Constructor & Destructor Documentation

◆ ColumnIndexList()

ehm_dal::column_data::ColumnIndexList::ColumnIndexList ( std::shared_ptr< ehm_dal::tables::AbstractTable table)

Constructs a ColumnIndexList using all columns from table

Parameters
tableSource table

Member Function Documentation

◆ add() [1/2]

void ehm_dal::column_data::ColumnIndexList::add ( std::shared_ptr< ehm_dal::tables::AbstractTable table,
const qint32  column_index 
)

Adds the column_index from the table to the column list.

Parameters
tableto which the column relates.
column_indexto add to the list.

◆ add() [2/2]

void ehm_dal::column_data::ColumnIndexList::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.

Parameters
tableto which the column relates.
column_indexesto add to the list.

◆ addAll()

void ehm_dal::column_data::ColumnIndexList::addAll ( std::shared_ptr< ehm_dal::tables::AbstractTable table)

Adds all columns from the table to the column list.

Parameters
tableto which the columns relate

◆ column()

const Column * ehm_dal::column_data::ColumnIndexList::column ( const qint32  column_index) const

Returns a raw pointer to the Column with a column index of column_index.

Parameters
column_indexcolumn index.

◆ columnCount()

qint32 ehm_dal::column_data::ColumnIndexList::columnCount ( ) const

Returns the number of columns.

Returns
column count

◆ columnId()

std::optional< qint32 > ehm_dal::column_data::ColumnIndexList::columnId ( const qint32  column_index) const

Returns the column id of the Column with a column index of column_index.

Parameters
column_indexcolumn index.
Returns
column id

◆ index() [1/2]

QModelIndex ehm_dal::column_data::ColumnIndexList::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. This is equivalent to ehm_dal::tables::AbstractTable::index(row, column_index).

Parameters
rowRow of the table
column_indexColumn index of the table
Returns
QModelIndex

◆ index() [2/2]

QModelIndex ehm_dal::column_data::ColumnIndexList::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 the table to which column_index relates. This is equivalent to ehm_dal::tables::AbstractTable::index(row, column_index, QModelIndex(parent_row, parent_column)).

Parameters
rowRow of the table
column_indexColumn index of the table
parent_rowParent row
parent_columnParent column (typically 0)
Returns
QModelIndex

◆ rowCount()

qint32 ehm_dal::column_data::ColumnIndexList::rowCount ( const qint32  table_index = 0) const

Returns the number of rows for the selected table.

Returns
row count

◆ table()

std::shared_ptr< ehm_dal::tables::AbstractTable > ehm_dal::column_data::ColumnIndexList::table ( const qint32  column_index) const

Returns a shared_pointer to the AbstractTable relating tocolumn_index.

Parameters
column_indexcolumn index
Returns
shared_ptr to AbstractTable